liip / bootstrap-blocks-wordpress-plugin

Bootstrap Gutenberg Blocks for WordPress
https://wordpress.org/plugins/wp-bootstrap-blocks/
279 stars 60 forks source link

Unable to lint or build #100

Closed elmarbransch closed 2 years ago

elmarbransch commented 2 years ago

Hi, thanks for this fantastic work.

We wanted to add some blocks and reduce the edit options. I follewed the docs here, but no matter what I trry, I am unable to lint or build the project.

I chased this in various discussion and found out these issues

in ".stylelintrc.json"

with ""extends": "@wordpress/stylelint-config",

i get an error in the linting module Error: Could not find "@wordpress/stylelint-config". Do you need a configBasedir?

if change it to "extends": "stylelint-config-recommended", this error goes away, but linting the scss will raise a linting error about the # and @ in the flles.

(it suggests to install postscss that I have installed)

In the same way building fails, because it is unable to process the scss files.

My node version is 8.1.2

it seems I am out of luck . any idea or did I hit a bug? thanks

tschortsch commented 2 years ago

Hi @elmarbransch. I just tried to reinstall everything from scratch locally and the lint and build commands seem to run fine 🤔 I also tried removing the package-lock.json file and see if some dependencies got removed. Can you maybe try to add the @wordpress/stylelint-config dependency manually (npm i -D @wordpress/stylelint-config) and see if this solves the issue. Theoretically this package is a dependency of the @wordpress/scripts package and should be resolved during the install step. And about the node version: You probably sent the npm version in your ticket right? Because you should use node 16 to run those commands. Do you get any errors when installing the npm dependencies related to the @wordpress/stylelint-config package?

elmarbransch commented 2 years ago

Hi @elmarbransch. I just tried to reinstall everything from scratch locally and the lint and build commands seem to run fine 🤔 I also tried removing the package-lock.json file and see if some dependencies got removed.

Hi @tschortsch , thanks for the ultrafast reply! basically I did : git clone ... npm install ... composer install ... and then I got those errors already on npm run lint

Can you maybe try to add the @wordpress/stylelint-config dependency manually (npm i -D @wordpress/stylelint-config) and see if this solves the issue.

I did, but then get this lintng issues about @ and # chars anyway with the standard .stilelintrc.json

Theoretically this package is a dependency of the @wordpress/scripts package and should be resolved during the install step. And about the node version: You probably sent the npm version in your ticket right? Because you should use node 16 to run those commands.

uhh, my bad, sorry :) yes, node 16, npm 8

Do you get any errors when installing the npm dependencies related to the @wordpress/stylelint-config package?

I get some audit suggestions as usual, but no errors.

Let me try to restart from scratch and install only this single package @wordpress/stylelint-config locally.

elmarbransch commented 2 years ago

I tried a fresh start and I saw a lot of warning and deprecations. Not sure, it these are harmful? (see below)

If i then try to lint I still get

/bootstrap-blocks-wordpress-plugin/src/row/style.scss: When linting something other than CSS, you should install an appropriate syntax, e.g. "postcss-scss", and use the "customSyntax" option /bootstrap-blocks-wordpress-plugin/src/button/editor.scss: When linting something other than CSS, you should install an appropriate syntax, e.g. "postcss-scss", and use the "customSyntax" option /bootstrap-blocks-wordpress-plugin/src/container/editor.scss: When linting something other than CSS, you should install an appropriate syntax, e.g. "postcss-scss", and use the "customSyntax" option /bootstrap-blocks-wordpress-plugin/src/assets/_gutenberg.scss: When linting something other than CSS, you should install an appropriate syntax, e.g. "postcss-scss", and use the "customSyntax" option /bootstrap-blocks-wordpress-plugin/src/row/editor.scss: When linting something other than CSS, you should install an appropriate syntax, e.g. "postcss-scss", and use the "customSyntax" option /bootstrap-blocks-wordpress-plugin/src/settings/settings.scss: When linting something other than CSS, you should install an appropriate syntax, e.g. "postcss-scss", and use the "customSyntax" option followed by couple of errors like src/button/editor.scss 30:5 ✖ Unknown word CssSyntaxError here the warnings from "npm install" npm WARN ERESOLVE overriding peer dependency npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: react-dates@17.2.0 npm WARN Found: react@17.0.2 npm WARN node_modules/react npm WARN peer react@"^0.14 || ^15.0.0 || ^16.0.0-alpha" from airbnb-prop-types@2.16.0 npm WARN node_modules/react-dates/node_modules/airbnb-prop-types npm WARN airbnb-prop-types@"^2.10.0" from react-dates@17.2.0 npm WARN node_modules/react-dates npm WARN npm WARN Could not resolve dependency: npm WARN peer react@"^0.14 || ^15.5.4 || ^16.1.1" from react-dates@17.2.0 npm WARN node_modules/react-dates npm WARN react-dates@"^17.1.1" from @wordpress/components@9.9.0 npm WARN node_modules/@wordpress/block-editor/node_modules/@wordpress/components npm WARN 4 more (@wordpress/components, @wordpress/components, ...) npm WARN npm WARN Conflicting peer dependency: react@16.14.0 npm WARN node_modules/react npm WARN peer react@"^0.14 || ^15.5.4 || ^16.1.1" from react-dates@17.2.0 npm WARN node_modules/react-dates npm WARN react-dates@"^17.1.1" from @wordpress/components@9.9.0 npm WARN node_modules/@wordpress/block-editor/node_modules/@wordpress/components npm WARN 4 more (@wordpress/components, @wordpress/components, ...) npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: react-dates@17.2.0 npm WARN Found: react-dom@17.0.2 npm WARN node_modules/react-dom npm WARN peer react-dom@"^17.0.0" from @wordpress/components@19.4.0 npm WARN node_modules/@wordpress/components npm WARN @wordpress/components@"^19.2.0" from the root project npm WARN 7 more (@wordpress/element, react-spring, framer-motion, ...) npm WARN npm WARN Could not resolve dependency: npm WARN peer react-dom@"^0.14 || ^15.5.4 || ^16.1.1" from react-dates@17.2.0 npm WARN node_modules/react-dates npm WARN react-dates@"^17.1.1" from @wordpress/components@9.9.0 npm WARN node_modules/@wordpress/block-editor/node_modules/@wordpress/components npm WARN 4 more (@wordpress/components, @wordpress/components, ...) npm WARN npm WARN Conflicting peer dependency: react-dom@16.14.0 npm WARN node_modules/react-dom npm WARN peer react-dom@"^0.14 || ^15.5.4 || ^16.1.1" from react-dates@17.2.0 npm WARN node_modules/react-dates npm WARN react-dates@"^17.1.1" from @wordpress/components@9.9.0 npm WARN node_modules/@wordpress/block-editor/node_modules/@wordpress/components npm WARN 4 more (@wordpress/components, @wordpress/components, ...) npm WARN ERESOLVE overriding peer dependency npm WARN ERESOLVE overriding peer dependency npm WARN ERESOLVE overriding peer dependency npm WARN ERESOLVE overriding peer dependency
elmarbransch commented 2 years ago

Hey @tschortsch, sorry for the buzz, I cloned the repo in a new folder again and run composer/npm install and now it runs fine. No idea what changed on my end, but I am lucky it worked :) I guess I loaded some addtional npm packages while trying around and now it works with a clean setup.

tschortsch commented 2 years ago

Good to hear! If you have other questions about the plugin just ask.

elmarbransch commented 2 years ago

many thanks! And thanks for your support!