You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* chore: yarn to npm
* feat: run project with nx
* chore: add most build and test scripts, use npm in CI
* chore: add all npm scripts
* fix: remove invalid cache seetting from nodejs.yml
* fix: test:ci correct usage
* fix: more scripts
* fix: add npm install to cypress ci
* chore: add changeset cli for versioning
* docs(npm): update setup instructions and readmes
* style(): cleanup
* chore: remove changesets and upgrade lerna for versioning
* fix: lock npm version for lerna
* fix: use npm 9 to support node 16 build
* chore: update scripts of aws cognito
* chore: update workflow to use node 20 instead of 16
Watches all CMS packages and transpiles them on change.
42
-
43
-
```sh
44
-
yarn watch
45
-
```
46
-
47
-
### start
48
-
49
-
Starts the development server. This task runs both the `bootstrap` and `watch` scripts.
50
-
51
-
```sh
52
-
yarn start
53
-
```
54
-
55
28
### clean
56
29
57
30
Removes all of the CMS package `dist` directories.
58
31
59
32
```sh
60
-
yarn clean
33
+
npm run clean
61
34
```
62
35
63
36
### reset
64
37
65
38
Runs the `clean` script and removes all the `node_modules` from the CMS packages.
66
39
67
40
```sh
68
-
yarn reset
41
+
npm run reset
69
42
```
70
43
71
44
### build
72
45
73
46
Runs the `clean` script and builds the CMS packages.
74
47
75
48
```sh
76
-
yarn build
49
+
npm run build
77
50
```
78
51
79
52
### build-preview
80
53
81
54
Runs the `build` and `build-preview` scripts in each package and serves the resulting build locally.
82
55
83
56
```sh
84
-
yarn build-preview
57
+
npm run build-preview
85
58
```
86
59
87
60
### test
88
61
89
62
Runs linting and Jest tests.
90
63
91
64
```sh
92
-
yarntest
65
+
npm runtest
93
66
```
94
67
95
68
### test:all
96
69
97
70
Runs linting, Jest, and Cypress tests.
98
71
99
72
```sh
100
-
yarn test:all
73
+
npm run test:all
101
74
```
102
75
103
76
### test:e2e
104
77
105
78
Runs Cypress e2e tests.
106
79
107
80
```sh
108
-
yarn test:e2e
81
+
npm run test:e2e
109
82
```
110
83
111
84
### test:e2e:dev
112
85
113
86
Runs Cypress e2e tests on watch mode with an open instance of Chrome.
114
87
115
88
```sh
116
-
yarn test:e2e:dev
89
+
npm run test:e2e:dev
117
90
```
118
91
119
92
### format
120
93
121
94
Formats code and docs according to our style guidelines.
122
95
123
96
```sh
124
-
yarn format
97
+
npm run format
125
98
```
126
99
127
100
## Pull Requests
@@ -136,14 +109,14 @@ Decap CMS uses the [Forking Workflow](https://www.atlassian.com/git/tutorials/co
136
109
2. Create a branch from `master`. If you're addressing a specific issue, prefix your branch name with the issue number.
137
110
3. If you've added code that should be tested, add tests.
138
111
4. If you've changed APIs, update the documentation.
139
-
5. Run `yarn test` and ensure the test suite passes.
140
-
6. Use `yarn format` to format and lint your code.
112
+
5. Run `npm run test` and ensure the test suite passes.
113
+
6. Use `npm run format` to format and lint your code.
141
114
7. PR's must be rebased before merge (feel free to ask for help).
142
115
8. PR should be reviewed by two maintainers prior to merging.
143
116
144
117
## Debugging
145
118
146
-
`yarn start` spawns a development server and uses `dev-test/config.yml` and `dev-test/index.html` to serve the CMS.
119
+
`npm run start` spawns a development server and uses `dev-test/config.yml` and `dev-test/index.html` to serve the CMS.
147
120
In order to debug a specific issue follow the next steps:
148
121
149
122
1. Replace `dev-test/config.yml` with the relevant `config.yml`. If you want to test the backend, make sure that the `backend` property of the config indicates which backend you use (GitHub, Gitlab, Bitbucket etc) and path to the repo.
@@ -174,7 +147,7 @@ backend:
174
147
```
175
148
The most important thing is to make sure that Decap CMS is loaded from the `dist` folder. This way, every time you make changes to the source code, they will be compiled and reflected immediately on `localhost`.
176
149
177
-
3. Run `yarn start`
150
+
3. Run `npm run start`
178
151
4. Open `http://localhost:8080/` in the browser and you should have access to the CMS
179
152
180
153
### Debugging Git Gateway
@@ -197,25 +170,25 @@ There are situations where you would want to run a specific test file, or tests
197
170
To run all the tests for a specific file, use this command:
198
171
199
172
```
200
-
yarn jest <filename or file path>
173
+
npx jest <filename or file path>
201
174
```
202
175
203
-
The first part of the command, `yarn jest` means running the locally installed version of `jest`. It is equivalent to running `node_modules/.bin/jest`.
176
+
The first part of the command, `npx jest` means running the locally installed version of `jest`. It is equivalent to running `node_modules/.bin/jest`.
204
177
205
-
Example for running all the tests for the file `gitlab.spec.js`: `yarn jest gitlab.spec.js`
178
+
Example for running all the tests for the file `gitlab.spec.js`: `npx jest gitlab.spec.js`
206
179
207
180
Some test files like `API.spec.js` is available in several packages. You can pass a regexp pattern instead of file path to narrow down files.
208
181
209
182
Example for running all the tests for the file `API.spec.js` in the `decap-cms-backend-gitlab` package:
210
183
211
-
`yarn jest ".+backend-gitlab/.+/API.spec.js`
184
+
`npx jest ".+backend-gitlab/.+/API.spec.js`
212
185
213
186
To run a specific test in a file, add the flag `--testNamePattern`, or `-t` for short followed by a regexp to match your test name.
214
187
215
188
Example for running the test "should return true on project access_level >= 30" in the API.spec.js in `decap-cms-backend-gitlab` package:
216
189
217
190
```
218
-
yarn jest -t "true on p" ".+backend-gitlab/.+/API.spec.js"
191
+
npx jest -t "true on p" ".+backend-gitlab/.+/API.spec.js"
219
192
```
220
193
221
194
For more information about running tests exactly the way you want, check out the official documentation for [Jest CLI](https://jestjs.io/docs/cli).
0 commit comments