Skip to content

Commit

Permalink
fix npm script
Browse files Browse the repository at this point in the history
  • Loading branch information
yuki0410-dev committed Jul 8, 2024
1 parent 0c55430 commit 84d808f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 23 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ jobs:
run: npm ci --no-audit --progress=false --silent

- name: Check Code Formatter
run: npm run prettier:check

- name: Type Check
run: npm run type-check
run: npm run format

- name: Lint
run: npm run lint
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ Local development configuration is pretty snappy. Here's how to get set up:
1. Run `npm run build` from project root (at least the first time, this will get you the `dist` directory that holds the code that will be linked to)
1. Run `npm run start` from project root. (This command launches a documentation app and runs it as a simple webserver at http://localhost:3000.)
1. Open new terminal window
1. Run `npm run build-dev` from project root. (This command sets up a development environment that keeps an eye on any file changes. When a file is updated, it auto-builds using the latest code.)
1. Run `npm run dev` from project root. (This command sets up a development environment that keeps an eye on any file changes. When a file is updated, it auto-builds using the latest code.)

You can run `npm run test` to execute the test suite and linters. To help you develop the component we’ve set up some tests that cover the basic functionality (can be found in `/src/tests`). Even though we’re big fans of testing, this only covers a small piece of the component. We highly recommend you add tests when you’re adding new functionality.

1. After each JS change run `npm run build:js` in project root
1. After each SCSS change run `npm run css:dev && npm run css:modules:dev` in project root
1. After each SCSS change run `npm run dev:css && npm run dev:css:modules` in project root
33 changes: 16 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,27 +85,26 @@
"react-onclickoutside": "^6.13.0"
},
"scripts": {
"eslint": "eslint --ext .js,.jsx,.ts,.tsx ./src",
"precommit": "lint-staged --allow-empty",
"sass-lint": "stylelint 'src/stylesheets/*.scss'",
"lint": "npm run eslint && npm run sass-lint",
"prettier": "prettier --write '**/*.{js,jsx,ts,tsx}'",
"prettier:check": "prettier --check '**/*.{js,jsx,ts,tsx}'",
"prepare": "husky install",
"start": "npm install --prefix docs-site && npm start --prefix docs-site",
"build": "NODE_ENV=production npm run build:js && NODE_ENV=production npm run build:css && NODE_ENV=production npm run dev:css:modules && NODE_ENV=production npm run dev:css && NODE_ENV=production npm run dev:css:modules",
"dev": "NODE_ENV=development npm run dev:js && NODE_ENV=development npm run dev:css && NODE_ENV=development npm run dev:css:modules",
"build:css": "sass --style compressed src/stylesheets/datepicker.scss > dist/react-datepicker.min.css",
"build:css:modules": "sass --style compressed src/stylesheets/datepicker-cssmodules.scss | tee dist/react-datepicker-cssmodules.min.css dist/react-datepicker-min.module.css",
"build:js": "rollup -c",
"dev:css": "sass --style expanded src/stylesheets/datepicker.scss > dist/react-datepicker.css",
"dev:css:modules": "sass --style expanded src/stylesheets/datepicker-cssmodules.scss | tee dist/react-datepicker-cssmodules.css dist/react-datepicker.module.css",
"dev:js": "rollup -cw",
"test": "NODE_ENV=test jest",
"test:ci": "NODE_ENV=test jest --ci --coverage",
"test:watch": "NODE_OPTIONS=--openssl-legacy-provider NODE_ENV=test jest --watch",
"build": "NODE_ENV=production npm run build:src && NODE_ENV=production npm run css:prod && NODE_ENV=production npm run css:modules:dev && NODE_ENV=production npm run css:dev && NODE_ENV=production npm run css:modules:dev",
"build-dev": "NODE_ENV=development npm run js:dev && NODE_ENV=development npm run css:dev && NODE_ENV=development npm run css:modules:dev",
"css:prod": "sass --style compressed src/stylesheets/datepicker.scss > dist/react-datepicker.min.css",
"css:modules:prod": "sass --style compressed src/stylesheets/datepicker-cssmodules.scss | tee dist/react-datepicker-cssmodules.min.css dist/react-datepicker-min.module.css",
"css:dev": "sass --style expanded src/stylesheets/datepicker.scss > dist/react-datepicker.css",
"css:modules:dev": "sass --style expanded src/stylesheets/datepicker-cssmodules.scss | tee dist/react-datepicker-cssmodules.css dist/react-datepicker.module.css",
"type-check": "tsc --project tsconfig.build.json --noEmit",
"type-check:watch": "npm run type-check -- --watch",
"build:src": "rollup -c",
"js:dev": "rollup -cw",
"prepare": "husky install"
"fix": "npm run format:fix",
"lint": "npm run lint:eslint && npm run lint:stylelint",
"lint:eslint": "eslint --ext .js,.jsx,.ts,.tsx ./src",
"lint:stylelint": "stylelint 'src/stylesheets/*.scss'",
"format": "prettier --check '**/*.{js,jsx,ts,tsx}'",
"format:fix": "prettier --write '**/*.{js,jsx,ts,tsx}'",
"precommit": "lint-staged --allow-empty"
},
"lint-staged": {
"*.{js,jsx,ts,tsx,json,css,scss,md}": ["prettier --write", "git add"]
Expand Down

0 comments on commit 84d808f

Please sign in to comment.