Skip to content
This repository was archived by the owner on Sep 5, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Dependency directories
node_modules/
yarn.lock
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When does yarn.lock get created? On my system I am only getting package-lock.json generate which we should ignore too.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A yarn.lockfile is only generated if someone runsyarn install`

Likewise, a package-lock.json is only generated if you run npm install

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stumbled upon this while having my first contact with wordpress after long not touching it. Generally, the lock files are meant to be comitted. Is there any special reason you want to exclude them?

https://stackoverflow.com/questions/44206782/do-i-commit-the-package-lock-json-file-created-by-npm-5

package-lock.json
40 changes: 40 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "_s",
"version": "1.0.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add a licence and repository field too.

"license": "GPL-2.0+",
"scripts": {
"build:css": "npm run compile:css && npm run prefix:css && npm run format:css && npm run fix:css",
"compile:css": "node-sass sass/style.scss style.css --output-style expanded --indent-type tab --indent-width 1",
"prefix:css": "postcss style.css -u autoprefixer -o style.css --no-map",
"lint:scss": "stylelint 'sass/**/*.scss' --syntax scss --config node_modules/stylelint-config-wordpress/scss.js",
"lint:css": "stylelint style.css",
"fix:scss": "stylelint 'sass/**/*.scss' --syntax scss --fix --config node_modules/stylelint-config-wordpress/scss.js",
"fix:css": "stylelint style.css --fix",
"format:css": "stylefmt style.css"
},
"devDependencies": {
"autoprefixer": "^7.1.6",
"browserslist": "^2.9.0",
"node-sass": "^4.6.1",
"postcss-cli": "^4.1.1",
"stylefmt": "^6.0.0",
"stylelint": "^8.2.0",
"stylelint-config-wordpress": "^12.0.0"
},
"stylelint": {
"defaultSeverity": "warning",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@grappler Not sure if this is wanted here?
I added it to get rid of errors printed in the terminal when linting didn't return 0 errors.

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! _s@1.0.0 fix:css: `stylelint style.css --fix`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the _s@1.0.0 fix:css script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/marty/.npm/_logs/2017-11-15T15_48_26_137Z-debug.log
error Command failed with exit code 2.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine with leaving like this. We can look in the future to change the command to something like "stylelint '**/*.scss'; exit 0" if need be.

https://medium.com/@bjankord/how-to-lint-scss-with-stylelint-dc87809a9878

"extends": "stylelint-config-wordpress"
},
"browserslist": [
"> 1%",
"ie >= 11",
"last 1 Android versions",
"last 1 ChromeAndroid versions",
"last 2 Chrome versions",
"last 2 Firefox versions",
"last 2 Safari versions",
"last 2 iOS versions",
"last 2 Edge versions",
"last 2 Opera versions"
]
}