generator-chisel icon indicating copy to clipboard operation
generator-chisel copied to clipboard

Rewrite with Webpack

Open jakub300 opened this issue 4 years ago • 9 comments

Installation and Testing

# install
yarn global add generator-chisel@next
# or
npm -g install generator-chisel@next

# after installation global chisel command should be added
# go to empty directory and use it to create a project
chisel create

Documentation

Documentation of the new version.

List below is WiP

Existing Chisel Features

Ready

  • [x] Hello message
  • [x] Check for updates before creation
  • [x] Warn when creating in existing project directory
  • [X] JS/SCSS bundling with hot reload in dev mode (now all with webpack)
  • [X] JS/SCSS linting (improved configs)
  • [X] Postcss support (autoprefixer)
  • [X] WP: reload on twig/php changes in template
  • [X] Create separate non-minified bundles during build
  • [X] WP Config during creation (also available when setting up existing project as yarn chisel-scripts wp-config)
  • [X] WP Plugins during creation
  • [X] WP: asses copying (Note: refresh on new assets is buggy, make some change in JS/SCSS to trigger rebuild).
  • [X] bundled WP CLI (yarn wp)
  • [x] Lint on git commit
  • [x] Page generator (yarn add-page)
  • [x] Build report
  • [x] Changelog generation (main one not tested)

In Progress

  • [ ] don't delete me

To Do

On Hold

  • [ ] jQuery
  • [ ] vendor concatenated bundle
  • [ ] placement of src dir
  • [ ] front-end templates (and data injection)

New Features

Ready

  • [X] All static assets are hashed/revisioned (works with assetPath in twig and url('~assets/...') in CSS and JS).
  • [X] React support with hot reload (babel and eslint), possible to enable in chisel.config.js (NOT Gutenberg integration).
  • [X] Automatic polyfills (disabled by default, can be enabled in babel.config.js).
  • [X] Inspect generated webpack config (yarn chisel-scripts inspect)
  • [X] Ask for supported browsers during generation
  • [x] Hooks for modifying webpack config and other things
  • [X] #460 - Add suport for inline SVG - assets can be inlined in (S)CSS with url('~assets/images/something.svg?inline'). SVGO should be automatically applied during minification (not verified).
  • [X] See dashboard: #452, #454, #459, #189, #446, #455, #464, #271

In Progress

  • [ ] don't delete me

To Do

jakub300 avatar Jun 29 '20 12:06 jakub300

@jakub300 tested it on Windows and works nicely for me.

luboskmetko avatar Jul 06 '20 10:07 luboskmetko

This is awesome news! Good job guys - Did you also take a look at Laravel mix? Going to try it out

mortensassi avatar Jul 17 '20 21:07 mortensassi

@jakub300 I tried to generate project on Win10 and got error when database should be created: Error: Too many positional arguments: 1

marziolek avatar Oct 08 '20 17:10 marziolek

Hi there I run into the following problems; After the Plug-in section (I've selected none) i got the Message;

npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated

> [email protected] install W:\SERVER\XAMPP\htdocs\test\xfive-project-wp\node_modules\fibers
> node build.js || nodejs build.js

"win32-x64-72" exists; testing
Binary is fine; exiting

> [email protected] install W:\SERVER\XAMPP\htdocs\test\xfive-project-wp\node_modules\husky
> node husky install

husky > Setting up git hooks
Cannot read property 'toString' of null
husky > Failed to install

After the Database Setup i got some errors like that:

Der Befehl "php" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.

So the command php was not found. It copied all the files except for the Wordpress Installation. After that i installed WP and setup the Database and now it seams to work.

dans-art avatar Oct 18 '20 10:10 dans-art

@marziolek @spy15 thank you for trying new Chisel and for the reports.

@jakub300 can you take a look at those issues when you have time? Thanks

luboskmetko avatar Oct 21 '20 06:10 luboskmetko

What do you guys think about Laravel Mix ? I have already used it with other custom themes and found it very easy to setup and extend to my needs.

mortensassi avatar Jan 19 '21 15:01 mortensassi

@marziolek

@jakub300 I tried to generate project on Win10 and got error when database should be created: Error: Too many positional arguments: 1

I also encountered this issue. Did you find a solution?

anatter avatar Jan 04 '22 14:01 anatter

@marziolek

@jakub300 I tried to generate project on Win10 and got error when database should be created: Error: Too many positional arguments: 1

I also encountered this issue. Did you find a solution?

I didn't have that issue since last time. You should check your local setup, node version, mysql etc.

marziolek avatar Jan 04 '22 14:01 marziolek

@anatter could you please check if you are not on npm v6 like described here https://github.com/xfiveco/generator-chisel/issues/495#issuecomment-974749414? Upgrading npm or using yarn should help. If not, let us know. Thanks

luboskmetko avatar Jan 04 '22 14:01 luboskmetko