Skip to content

fix(#7375): fix dependency issues #7394

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
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
20 changes: 17 additions & 3 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,32 @@ const isESM = process.env.NODE_ENV === 'esm';

console.log('Build Package:', path.basename(process.cwd()));

const defaultPlugins = [
// Always enabled plugins
const basePlugins = [
'lodash',
[
'babel-plugin-transform-builtin-extend',
{
globals: ['Error'],
},
],
'babel-plugin-inline-json-import',
];

// Legacy transforms for non-ESM builds
// REVISIT: We probably don't need any of these since we use preset-env
const legacyPlugins = [
'transform-export-extensions',
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-proposal-export-default-from',
'@babel/plugin-proposal-nullish-coalescing-operator',
'@babel/plugin-proposal-optional-chaining',
'@babel/plugin-syntax-dynamic-import',
'babel-plugin-inline-json-import',
];

const defaultPlugins = [...basePlugins, ...(isESM ? [] : legacyPlugins)];

const svgo = {
plugins: [
{
Expand All @@ -42,7 +50,7 @@ const svgo = {
function presets() {
return [
'@babel/preset-react',
['@babel/preset-env', isESM ? { modules: false } : {}],
...(!isESM ? [['@babel/preset-env', {}]] : []),
[
'@emotion/babel-preset-css-prop',
{
Expand Down Expand Up @@ -70,6 +78,12 @@ function plugins() {
svgo,
},
],
[
'inline-import',
{
extensions: ['.css'],
},
],
];
}

Expand Down
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module.exports = {
'decap-cms-lib-widgets': '<rootDir>/packages/decap-cms-lib-widgets/src/index.ts',
'decap-cms-widget-object': '<rootDir>/packages/decap-cms-widget-object/src/index.js',
'\\.(css|less)$': '<rootDir>/__mocks__/styleMock.js',
'^#home-directory$': 'clean-stack/home-directory.js',
},
snapshotSerializers: ['@emotion/jest/serializer'],
transformIgnorePatterns: [
Expand Down
59 changes: 47 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
"babel-jest": "^27.5.1",
"babel-loader": "^8.0.5",
"babel-plugin-emotion": "^10.0.9",
"babel-plugin-inline-import": "^3.0.0",
"babel-plugin-inline-json-import": "^0.3.2",
"babel-plugin-inline-react-svg": "^2.0.0",
"babel-plugin-lodash": "^3.3.4",
Expand Down
4 changes: 2 additions & 2 deletions packages/decap-cms-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"ajv": "8.12.0",
"ajv-errors": "^3.0.0",
"ajv-keywords": "^5.0.0",
"clean-stack": "^4.1.0",
"clean-stack": "^5.2.0",
"copy-text-to-clipboard": "^3.0.0",
"dayjs": "^1.11.10",
"deepmerge": "^4.2.2",
Expand All @@ -56,7 +56,7 @@
"react-polyglot": "^0.7.0",
"react-redux": "^7.2.0",
"react-router-dom": "^5.2.0",
"react-scroll-sync": "^0.9.0",
"react-scroll-sync": "^0.11.2",
"react-split-pane": "^0.1.85",
"react-toastify": "^9.1.1",
"react-topbar-progress-indicator": "^4.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/decap-cms-widget-markdown/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"slate": "^0.91.1",
"slate-base64-serializer": "^0.2.107",
"slate-history": "^0.93.0",
"slate-hyperscript": "^0.77.0",
"slate-plain-serializer": "^0.7.1",
"slate-react": "^0.91.2",
"slate-soft-break": "^0.9.0",
Expand All @@ -57,7 +58,6 @@
},
"devDependencies": {
"commonmark": "^0.30.0",
"commonmark-spec": "^0.30.0",
"slate-hyperscript": "^0.77.0"
"commonmark-spec": "^0.30.0"
}
}