Skip to content

Commit ffe13fe

Browse files
authored
Merge branch 'main' into google-docs-formatting
2 parents c7cebde + 47a2f70 commit ffe13fe

File tree

27 files changed

+578
-179
lines changed

27 files changed

+578
-179
lines changed

.github/workflows/nodejs.yml

Lines changed: 12 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ name: Node CI
22

33
on:
44
push:
5-
branches:
6-
- main
75
pull_request:
86
types: [opened, synchronize, reopened]
97

@@ -28,73 +26,37 @@ jobs:
2826
matrix:
2927
os: [macos-latest, windows-latest, ubuntu-latest]
3028
node-version: [18.x, 20.x]
29+
fail-fast: true
3130
if: ${{ needs.changes.outputs.cms == 'true' }}
3231
steps:
3332
- uses: actions/checkout@v3
34-
- name: Use Node.js {{ matrix.node-version }}
33+
- name: Use Node.js ${{ matrix.node-version }}
3534
uses: actions/setup-node@v3
3635
with:
3736
node-version: ${{ matrix.node-version }}
3837
check-latest: true
38+
cache: 'npm'
3939
- name: log versions
4040
run: node --version && npm --version && yarn --version
41-
- name: install dependecies
42-
run: npm install
41+
- name: install dependencies
42+
run: npm ci
4343
- name: run unit tests
4444
run: npm run test:ci
45-
env:
46-
CI: true
47-
NODE_OPTIONS: --max-old-space-size=4096
4845
- name: build demo site
4946
run: npm run build:demo
47+
- name: run e2e tests
48+
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x'
49+
run: npm run test:e2e:run-ci
5050
env:
51-
NODE_OPTIONS: --max-old-space-size=4096
52-
- uses: actions/upload-artifact@master
53-
with:
54-
name: dev-test-website-${{ runner.os }}-${{ matrix.node-version }}
55-
path: dev-test
56-
57-
e2e-with-cypress:
58-
needs: [changes, build]
59-
runs-on: ubuntu-latest
60-
61-
strategy:
62-
matrix:
63-
node-version: [18.x, 20.x]
64-
fail-fast: false
65-
66-
if: ${{ needs.changes.outputs.cms == 'true' }}
67-
steps:
68-
- uses: actions/checkout@v3
69-
- name: Use Node.js
70-
uses: actions/setup-node@v3
71-
with:
72-
node-version: ${{ matrix.node-version }}
73-
check-latest: true
74-
- uses: actions/download-artifact@master
75-
with:
76-
name: dev-test-website-${{ runner.os }}-18.x
77-
path: dev-test
78-
- name: npm install
79-
run: |
80-
node --version
81-
npm --version
82-
yarn --version
83-
npm install
84-
- name: e2e test
85-
run: |
86-
npm run test:e2e:run-ci
87-
env:
88-
IS_FORK: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == true }}
51+
IS_FORK: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == true || github.repository_owner != 'decaporg' }}
8952
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
9053
NODE_OPTIONS: --max-old-space-size=4096
91-
MACHINE_COUNT: 2
92-
MACHINE_INDEX: ${{ matrix.node-version }}
9354
TZ: Europe/Amsterdam
9455
- uses: actions/upload-artifact@v3
95-
if: ${{ always() }}
56+
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x' && failure()
9657
with:
97-
name: cypress-results-${{ matrix.node-version }}
58+
name: cypress-results
9859
path: |
9960
cypress/screenshots
10061
cypress/videos
62+

babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const svgo = {
4242
function presets() {
4343
return [
4444
'@babel/preset-react',
45-
'@babel/preset-env',
45+
['@babel/preset-env', isESM ? { modules: false } : {}],
4646
[
4747
'@emotion/babel-preset-css-prop',
4848
{

cypress/e2e/editorial_workflow_spec_test_backend.js

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -207,17 +207,16 @@ describe('Test Backend Editorial Workflow', () => {
207207
login();
208208

209209
inSidebar(() => cy.contains('a', 'Pages').click());
210-
inSidebar(() => cy.contains('a', 'Directory'));
210+
inSidebar(() => cy.contains('a', /^Directory$/));
211211
inGrid(() => cy.contains('a', 'Root Page'));
212-
inGrid(() => cy.contains('a', 'Directory'));
213212

214-
inSidebar(() => cy.contains('a', 'Directory').click());
213+
inSidebar(() => cy.contains('a', /^Directory$/).click());
215214

216-
inGrid(() => cy.contains('a', 'Sub Directory'));
217-
inGrid(() => cy.contains('a', 'Another Sub Directory'));
215+
inSidebar(() => cy.contains('a', /^Sub Directory$/));
216+
inSidebar(() => cy.contains('a', 'Another Sub Directory'));
218217

219-
inSidebar(() => cy.contains('a', 'Sub Directory').click());
220-
inGrid(() => cy.contains('a', 'Nested Directory'));
218+
inSidebar(() => cy.contains('a', /^Sub Directory$/).click());
219+
inSidebar(() => cy.contains('a', 'Nested Directory'));
221220
cy.url().should(
222221
'eq',
223222
'http://localhost:8080/#/collections/pages/filter/directory/sub-directory',
@@ -233,21 +232,17 @@ describe('Test Backend Editorial Workflow', () => {
233232
login();
234233

235234
inSidebar(() => cy.contains('a', 'Pages').click());
236-
inSidebar(() => cy.contains('a', 'Directory').click());
237-
inGrid(() => cy.contains('a', 'Another Sub Directory').click());
238-
239-
cy.url().should(
240-
'eq',
241-
'http://localhost:8080/#/collections/pages/entries/directory/another-sub-directory/index',
242-
);
235+
inSidebar(() => cy.contains('a', /^Directory$/).click());
236+
inSidebar(() => cy.contains('a', 'Another Sub Directory').click());
237+
inGrid(() => cy.contains('a', 'Another Sub Directory'));
243238
});
244239

245240
it(`can create a new entry with custom path`, () => {
246241
login();
247242

248243
inSidebar(() => cy.contains('a', 'Pages').click());
249-
inSidebar(() => cy.contains('a', 'Directory').click());
250-
inSidebar(() => cy.contains('a', 'Sub Directory').click());
244+
inSidebar(() => cy.contains('a', /^Directory$/).click());
245+
inSidebar(() => cy.contains('a', /^Sub Directory$/).click());
251246
cy.contains('a', 'New Page').click();
252247

253248
cy.get('[id^="path-field"]').should('have.value', 'directory/sub-directory');
@@ -262,18 +257,18 @@ describe('Test Backend Editorial Workflow', () => {
262257
publishEntryInEditor(publishTypes.publishNow);
263258
exitEditor();
264259

265-
inGrid(() => cy.contains('a', 'New Path Title'));
266-
inSidebar(() => cy.contains('a', 'Directory').click());
267-
inSidebar(() => cy.contains('a', 'Directory').click());
260+
inSidebar(() => cy.contains('a', 'New Path Title'));
261+
inSidebar(() => cy.contains('a', /^Directory$/).click());
262+
inSidebar(() => cy.contains('a', /^Directory$/).click());
268263
inGrid(() => cy.contains('a', 'New Path Title').should('not.exist'));
269264
});
270265

271266
it(`can't create an entry with an existing path`, () => {
272267
login();
273268

274269
inSidebar(() => cy.contains('a', 'Pages').click());
275-
inSidebar(() => cy.contains('a', 'Directory').click());
276-
inSidebar(() => cy.contains('a', 'Sub Directory').click());
270+
inSidebar(() => cy.contains('a', /^Directory$/).click());
271+
inSidebar(() => cy.contains('a', /^Sub Directory$/).click());
277272

278273
cy.contains('a', 'New Page').click();
279274
cy.get('[id^="title-field"]').type('New Path Title');
@@ -292,7 +287,8 @@ describe('Test Backend Editorial Workflow', () => {
292287
login();
293288

294289
inSidebar(() => cy.contains('a', 'Pages').click());
295-
inGrid(() => cy.contains('a', 'Directory').click());
290+
inSidebar(() => cy.contains('a', /^Directory$/).click());
291+
inGrid(() => cy.contains('a', /^Directory$/).click());
296292

297293
cy.get('[id^="path-field"]').should('have.value', 'directory');
298294
cy.get('[id^="path-field"]').clear();
@@ -310,7 +306,7 @@ describe('Test Backend Editorial Workflow', () => {
310306

311307
inSidebar(() => cy.contains('a', 'New Directory').click());
312308

313-
inGrid(() => cy.contains('a', 'Sub Directory'));
314-
inGrid(() => cy.contains('a', 'Another Sub Directory'));
309+
inSidebar(() => cy.contains('a', /^Sub Directory$/));
310+
inSidebar(() => cy.contains('a', 'Another Sub Directory'));
315311
});
316312
});

cypress/run.mjs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,40 @@ import execa from 'execa';
22
import { globby } from 'globby';
33

44
async function runCypress() {
5+
const args = ['run', '--browser', 'chrome', '--headless'];
6+
7+
const specs = await globby(['cypress/e2e/*spec*.js']);
8+
if (specs.length === 0) {
9+
console.log('No test files found in cypress/e2e/*spec*.js');
10+
process.exit(1);
11+
}
12+
513
if (process.env.IS_FORK === 'true') {
614
const machineIndex = parseInt(process.env.MACHINE_INDEX);
715
const machineCount = parseInt(process.env.MACHINE_COUNT);
8-
const specs = await globby(['cypress/integration/*spec*.js']);
916
const specsPerMachine = Math.floor(specs.length / machineCount);
1017
const start = (machineIndex - 1) * specsPerMachine;
1118
const machineSpecs =
1219
machineIndex === machineCount
1320
? specs.slice(start)
1421
: specs.slice(start, start + specsPerMachine);
1522

16-
await execa(
17-
'cypress',
18-
['run', '--browser', 'chrome', '--headless', '--spec', machineSpecs.join(',')],
19-
{ stdio: 'inherit', preferLocal: true },
20-
);
23+
args.push('--spec', machineSpecs.join(','));
2124
} else {
22-
await execa(
23-
'cypress',
24-
[
25-
'run',
26-
'--browser',
27-
'chrome',
28-
'--headless',
29-
'--record',
30-
'--parallel',
31-
'--ci-build-id',
32-
process.env.GITHUB_SHA,
33-
'--group',
34-
'GitHub CI',
35-
],
36-
{ stdio: 'inherit', preferLocal: true },
25+
args.push(
26+
'--record',
27+
'--parallel',
28+
'--ci-build-id',
29+
process.env.GITHUB_SHA,
30+
'--group',
31+
'GitHub CI',
32+
'--spec',
33+
specs.join(','),
3734
);
3835
}
36+
37+
console.log('Running Cypress with args:', args.join(' '));
38+
await execa('cypress', args, { stdio: 'inherit', preferLocal: true });
3939
}
4040

4141
runCypress();

cypress/support/e2e.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,9 @@ addMatchImageSnapshotCommand({
2626
Cypress.on('uncaught:exception', () => false);
2727

2828
import './commands';
29+
30+
afterEach(function () {
31+
if (this.currentTest.state === 'failed') {
32+
Cypress.runner.stop();
33+
}
34+
});

nx.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
{
22
"targetDefaults": {
33
"build:esm": {
4-
"cache": true
4+
"cache": true,
5+
"dependsOn": ["^build:esm"]
56
},
67
"build": {
7-
"cache": true
8+
"cache": true,
9+
"dependsOn": ["^build"]
810
}
911
},
1012
"namedInputs": {

package-lock.json

Lines changed: 8 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"build-preview": "npm run build && nx run decap-cms:build-preview --output-style=stream",
99
"type-check": "tsc --noEmit",
1010
"type-check:watch": "npm run type-check -- --watch",
11-
"clean": "rimraf \"packages/*/dist\" dev-test/dist \"packages/*/node_modules\"",
11+
"clean": "rimraf \"packages/*/dist\" dev-test/dist \"packages/*/node_modules\" \".nx/cache\"",
1212
"reset": "npm run clean",
1313
"test": "npm run lint && npm run type-check && npm run test:unit",
1414
"test:all": "npm run test && npm run test:e2e",

packages/decap-cms-app/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
# [3.5.0](https://github.com/decaporg/decap-cms/compare/decap-cms-app@3.4.0...decap-cms-app@3.5.0) (2025-01-15)
7+
8+
### Bug Fixes
9+
10+
- **build:** Fix ESM output ([#7357](https://github.com/decaporg/decap-cms/issues/7357)) ([#7358](https://github.com/decaporg/decap-cms/issues/7358)) ([6cd7cb3](https://github.com/decaporg/decap-cms/commit/6cd7cb3b41718e20b44acaae1e2ffd73129520c2))
11+
612
# [3.4.0](https://github.com/decaporg/decap-cms/compare/decap-cms-app@3.3.3...decap-cms-app@3.4.0) (2024-11-12)
713

814
**Note:** Version bump only for package decap-cms-app

0 commit comments

Comments
 (0)