Skip to content
Open
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a8e037b
refactor: migrate from npm to pnpm
Daniel-Mendes Oct 26, 2025
e760747
feat: migrate project setup from npm to pnpm
Daniel-Mendes Oct 26, 2025
23a130a
fix: pnpm version in CI
Daniel-Mendes Oct 26, 2025
c091e52
fix: fixed ci lint errors
Daniel-Mendes Oct 26, 2025
3c38584
refactor: remove unnecessary React imports across components and tests
Daniel-Mendes Oct 26, 2025
38b465b
refactor: refactor components to extend from React.Component
Daniel-Mendes Oct 26, 2025
c51fad4
feat: add common-tags to external package exports
Daniel-Mendes Oct 26, 2025
5c58e68
refactor: removed copy-text-to-clipboard
Daniel-Mendes Oct 26, 2025
1730324
refactor: push pnpm-lock.yaml
Daniel-Mendes Oct 26, 2025
a509286
fix: fixed remaining test:ci errors
Daniel-Mendes Oct 26, 2025
86a3af3
fix: fixed test:unit warning with new jsx transform
Daniel-Mendes Oct 26, 2025
3610cf3
fix: update babel config to include @emotion/babel-plugin and remove …
Daniel-Mendes Oct 26, 2025
3fff802
fix: jest updateSnapshot for svg
Daniel-Mendes Oct 26, 2025
b4d22e8
fix: fixed jest and cypress errors
Daniel-Mendes Oct 26, 2025
3688b98
Merge branch 'main' into pr/7645
yanthomasdev Jul 8, 2026
3e34039
fix: remove React imports
yanthomasdev Jul 8, 2026
77313fc
fix(lint): handle PlateJS import resolution
yanthomasdev Jul 8, 2026
c6398f8
fix(ci): make pnpm release path publishable
yanthomasdev Jul 8, 2026
0e4dbf0
fix: tests
yanthomasdev Jul 8, 2026
33cb623
chore: format
yanthomasdev Jul 8, 2026
94497cc
Merge branch 'main' into pr/7645
yanthomasdev Jul 13, 2026
3e960df
fix: tests
yanthomasdev Jul 13, 2026
933db05
chore: update pnpm to v11
yanthomasdev Jul 13, 2026
6a6b092
fix: add missing dependency
yanthomasdev Jul 13, 2026
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
14 changes: 14 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ module.exports = {
rules: {
'no-console': [0],
'react/prop-types': [0],
// With the new React JSX transform (jsx: "react-jsx"), React doesn't need to be in scope
'react/react-in-jsx-scope': 'off',
'react/jsx-uses-react': 'off',
'import/no-named-as-default': 0,
'import/order': [
'error',
Expand Down Expand Up @@ -78,6 +81,14 @@ module.exports = {
'import/core-modules': [...packages, 'decap-cms-app/dist/esm'],
},
overrides: [
{
files: ['packages/decap-cms-widget-richtext/src/**/*.js'],
rules: {
// PlateJS re-exports named APIs through package export subpaths that
// eslint-plugin-import does not reliably trace, even though Node resolves them.
'import/named': 'off',
},
},
{
files: ['*.ts', '*.tsx'],
parser: '@typescript-eslint/parser',
Expand Down Expand Up @@ -109,6 +120,9 @@ module.exports = {
'error',
{ functions: false, classes: true, variables: true },
],
// With the new React JSX transform (jsx: "react-jsx"), React doesn't need to be in scope
'react/react-in-jsx-scope': 'off',
'react/jsx-uses-react': 'off',
},
},
],
Expand Down
33 changes: 20 additions & 13 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,55 +40,63 @@ jobs:
if: ${{ needs.changes.outputs.cms == 'true' }}
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10.19.0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
check-latest: true
cache: 'npm'
cache: 'pnpm'
- name: log versions
run: node --version && npm --version
run: node --version && pnpm --version
- name: install dependencies (skip Cypress binary)
run: npm ci
run: pnpm install --frozen-lockfile
env:
CYPRESS_INSTALL_BINARY: 0
- name: run lint + types + unit tests
run: npm run test:ci
- name: run unit tests
run: pnpm run test:ci

e2e:
needs: changes
if: ${{ needs.changes.outputs.cms == 'true' }}
runs-on: depot-ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10.19.0
- name: Use Node.js 24.x
uses: actions/setup-node@v4
with:
node-version: 24.x
check-latest: true
cache: 'npm'
cache: 'pnpm'
- name: Cache Nx local cache
uses: actions/cache@v4
with:
path: .nx/cache
key: nx-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
key: nx-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
nx-${{ runner.os }}-
- name: Cache Cypress binary
uses: actions/cache@v4
with:
path: ~/.cache/Cypress
key: cypress-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
key: cypress-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
cypress-${{ runner.os }}-
- name: install dependencies
run: npm ci
run: pnpm install --frozen-lockfile
- name: build demo site
run: npm run build:demo
run: pnpm run build:demo
- name: test package integrity
run: npm run test:package-integrity
run: pnpm run test:package-integrity
- name: run e2e tests
run: npm run test:e2e:run-ci
run: pnpm run test:e2e:run-ci
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
NODE_OPTIONS: --max-old-space-size=4096
Expand All @@ -102,4 +110,3 @@ jobs:
path: |
cypress/screenshots
cypress/videos

19 changes: 13 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,36 @@ jobs:
with:
fetch-depth: 0 # Required for Lerna to detect changes

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10.19.0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '24'
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'

- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile

- name: Build packages
run: npm run build
run: pnpm run build

- name: Run tests
run: npm run test:ci
run: pnpm run test:ci

- name: Test package integrity
run: npm run test:package-integrity
run: pnpm run test:package-integrity

- name: Debug
run: |
echo "::group::Node & npm versions"
node -v
npm -v
pnpm -v
echo "::endgroup::"

echo "::group::npm config (redacted)"
Expand All @@ -65,9 +72,9 @@ jobs:
echo "::endgroup::"

echo "::group::Lerna packages"
npx lerna ls --json || true
pnpm exec lerna ls --json || true
echo "::endgroup::"

- name: Publish to npm
run: npm run lerna:publish -- --loglevel silly
run: pnpm run publish:packages -- --provenance
# No NODE_AUTH_TOKEN needed - uses OIDC automatically via trusted publishers
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ coverage/
storybook-static/
.nx
.claude/settings.local.json
pnpm-publish-summary.json
11 changes: 10 additions & 1 deletion .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
const {
dirname,
join
} = require("node:path");

module.exports = {
stories: [
'../packages/decap-cms-core/src/**/*.stories.js',
'../packages/decap-cms-ui-default/src/**/*.stories.js',
],
addons: ['@storybook/addon-actions', '@storybook/addon-links'],
addons: [getAbsolutePath("@storybook/addon-links")],
};

function getAbsolutePath(value) {
return dirname(require.resolve(join(value, "package.json")));
}
54 changes: 27 additions & 27 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ For details on contributing to documentation, see [Website Readme](https://githu

## Setup

> Install [Node.js (LTS)](https://nodejs.org/) on your system.
> Install [Node.js (LTS)](https://nodejs.org/) and [pnpm](https://pnpm.io/) on your system.

### Install dependencies

```sh
git clone https://github.com/decaporg/decap-cms
cd decap-cms
npm install
pnpm install
```

### Run locally

```sh
npm run start
pnpm run start
```

## Available scripts
Expand All @@ -30,71 +30,71 @@ npm run start
Removes all of the CMS package `dist` directories.

```sh
npm run clean
pnpm run clean
```

### reset

Runs the `clean` script and removes all the `node_modules` from the CMS packages.

```sh
npm run reset
pnpm run reset
```

### build

Runs the `clean` script and builds the CMS packages.

```sh
npm run build
pnpm run build
```

### build-preview

Runs the `build` and `build-preview` scripts in each package and serves the resulting build locally.

```sh
npm run build-preview
pnpm run build-preview
```

### test

Runs linting and Jest tests.

```sh
npm run test
pnpm run test
```

### test:all

Runs linting, Jest, and Cypress tests.

```sh
npm run test:all
pnpm run test:all
```

### test:e2e

Runs Cypress e2e tests.

```sh
npm run test:e2e
pnpm run test:e2e
```

### test:e2e:dev

Runs Cypress e2e tests on watch mode with an open instance of Chrome.

```sh
npm run test:e2e:dev
pnpm run test:e2e:dev
```

### format

Formats code and docs according to our style guidelines.

```sh
npm run format
pnpm run format
```

## Pull Requests
Expand All @@ -109,19 +109,19 @@ Decap CMS uses the [Forking Workflow](https://www.atlassian.com/git/tutorials/co
2. Create a branch from `main`. If you're addressing a specific issue, prefix your branch name with the issue number.
3. If you've added code that should be tested, add tests.
4. If you've changed APIs, update the documentation.
5. Run `npm run test` and ensure the test suite passes.
6. Use `npm run format` to format and lint your code.
5. Run `pnpm run test` and ensure the test suite passes.
6. Use `pnpm run format` to format and lint your code.
7. PR's must be rebased before merge (feel free to ask for help).
8. PR should be reviewed by two maintainers prior to merging.

## Debugging

`npm run start` spawns a development server and uses `dev-test/config.yml` and `dev-test/index.html` to serve the CMS.
`pnpm run start` spawns a development server and uses `dev-test/config.yml` and `dev-test/index.html` to serve the CMS.
In order to debug a specific issue follow the next steps:

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.

```js
```yaml
backend:
name: github
repo: owner-name/repo-name
Expand All @@ -145,9 +145,10 @@ backend:
</body>
</html>
```

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`.

3. Run `npm run start`
3. Run `pnpm run start`
4. Open `http://localhost:8080/` in the browser and you should have access to the CMS

### Debugging Git Gateway
Expand All @@ -157,11 +158,11 @@ When debugging the CMS with Git Gateway you must:
1. Have a Netlify site with [Git Gateway](https://docs.netlify.com/visitor-access/git-gateway/) and [Netlify Identity](https://docs.netlify.com/visitor-access/identity/) enabled. An easy way to create such a site is to use a [template](https://www.decapcms.org/docs/start-with-a-template/), for example the [Gatsby template](https://app.netlify.com/start/deploy?repository=https://github.com/decaporg/gatsby-starter-decap-cms&stack=cms)
2. Tell the CMS the URL of your Netlify site using a local storage item. To do so:

1. Open `http://localhost:8080/` in the browser
2. Open the Developer Console. Write the below command and press enter: `localStorage.setItem('netlifySiteURL', 'https://yourwebsiteurl.netlify.app/')`
3. To be sure, you can run this command as well: `localStorage.getItem('netlifySiteURL')`
4. Refresh the page
5. You should be able to log in via your Netlify Identity email/password
1. Open `http://localhost:8080/` in the browser
2. Open the Developer Console. Write the below command and press enter: `localStorage.setItem('netlifySiteURL', 'https://yourwebsiteurl.netlify.app/')`
3. To be sure, you can run this command as well: `localStorage.getItem('netlifySiteURL')`
4. Refresh the page
5. You should be able to log in via your Netlify Identity email/password

### Fine tune the way you run unit tests

Expand Down Expand Up @@ -210,12 +211,11 @@ Decap CMS uses NPM trusted publishers with OIDC for secure, automated package pu
1. **Prepare the release:**
```sh
# Ensure your local `main` branch is up to date
npm prune
npm install
npm run test
pnpm install --frozen-lockfile
pnpm run test

# Bump versions for changed packages
npx lerna version
pnpm exec lerna version

# This will:
# - Detect changed packages since last release
Expand Down Expand Up @@ -245,7 +245,7 @@ If automated publishing fails and you need to publish manually:
npm login

# Publish changed packages
npm run lerna:publish
pnpm run publish:packages
```

Note: Manual publishing still requires 2FA. Use recovery codes if you don't have access to your 2FA device.
Expand Down
5 changes: 5 additions & 0 deletions __mocks__/cleanStackMock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function cleanStack(stack) {
return stack;
}
module.exports = cleanStack;
module.exports.default = cleanStack;
1 change: 1 addition & 0 deletions __mocks__/fileMock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = 'test-file-stub';
Loading
Loading