Skip to content

Commit

Permalink
Merge pull request #341 from publishpress/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
htmgarcia authored Mar 8, 2021
2 parents e762b64 + 611d1e9 commit b190372
Show file tree
Hide file tree
Showing 49 changed files with 27,568 additions and 14,204 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.idea/
bundled/
vendor/
node_modules/
blocks.js.map*
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ We will review and contact you as soon as possible.
We use [React](https://facebook.github.io/react/) to build part of the user interface.
The sources files are named with the extension JSX. Which is optional on React, but provides a way to write modern code and compile to be compatible with legacy browsers. We use [babeljs.io](https://babeljs.io/) with the presets: react and es2015 to compile to JS files.

Please check the requirements at [our documentation page](https://publishpress.github.io/docs/development/react-jsx).
Please check the requirements at [our documentation page](https://publishpress.github.io/docs/development/react-jsx).

**Important:** use the npm modules from [package.json](https://github.com/publishpress/Advanced-Gutenberg/blob/master/package.json), and these two files as is that already comes within the repository: webpack.config.js and .babelrc.
**Important:** use the npm modules from [package.json](https://github.com/publishpress/Advanced-Gutenberg/blob/master/package.json), and these two files as is that already comes within the repository: webpack.config.js and .babelrc.

#### Compiling JSX files to JS

Expand All @@ -59,6 +59,14 @@ Run the command `npm run build_react_dev` just once.

Run the command `npm run compile_css` every time after you make changes to any SCSS file in order to compile to CSS.

Please note there are other commands related to CSS compilation that involves specific files from admin. For more details check all the scripts in package.json.

#### Creating a zip installer

You need to have `gulp-cli` installed globally and `gulp` and `gulp-zip` in local. [Click here](https://gulpjs.com/docs/en/getting-started/quick-start/) for more details.

Through command line run `gulp bundle`. A zip ready to install as plugin should be generated inside bundled/ folder. This zip will exclude non required files in WordPress, like JSX and SCSS.

## License

License: [GPLv2 or later](http://www.gnu.org/licenses/gpl-2.0.html)
27 changes: 27 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const gulp = require("gulp");
const zip = require("gulp-zip");

function bundle() {
return gulp.src([
"src/**",
"!.git/**",
"!.idea/**",
"!bundled/**",
"!node_modules/**",
"!vendor/**",
"!.babelrc",
"!.DS_Store",
"!.gitignore",
"!gulpfile.js",
"!package-lock.json",
"!package.json",
"!README.md",
"!webpack.config.js",
"!src/assets/**/*.jsx",
"!src/assets/scss/**",
])
.pipe(zip('advanced-gutenberg.zip'))
.pipe(gulp.dest("bundled"));
}

exports.bundle = bundle;
Loading

0 comments on commit b190372

Please sign in to comment.