Browse Source

chore: Migrate CJS to ESM (#42062)

* chore: Migrate CJS to ESM

* fix

* fix
pull/42067/head
lijianan 2 years ago
committed by GitHub
parent
commit
6301ddf764
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      .github/workflows/test.yml
  2. 3
      package.json
  3. 14
      scripts/check-demo.js

3
.github/workflows/test.yml

@ -96,9 +96,6 @@ jobs:
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
- name: check demo
run: node ./scripts/check-demo.js
needs: setup
################################ Dist ################################

3
package.json

@ -294,8 +294,7 @@
"typescript": "~5.0.2",
"vanilla-jsoneditor": "^0.17.1",
"webpack-bundle-analyzer": "^4.1.0",
"xhr-mock": "^2.4.1",
"yaml-front-matter": "^4.0.0"
"xhr-mock": "^2.4.1"
},
"peerDependencies": {
"react": ">=16.9.0",

14
scripts/check-demo.js

@ -1,14 +0,0 @@
const path = require('path');
const yfm = require('yaml-front-matter');
const { globSync } = require('glob');
const fs = require('fs');
const demoFiles = globSync(path.join(process.cwd(), 'components/**/demo/*.md'));
// eslint-disable-next-line no-restricted-syntax
for (const url of demoFiles) {
const demoContent = fs.readFileSync(url);
const meta = yfm.loadFront(demoContent);
if (meta.only) {
throw Error(`there is a 'only': ${url}`);
}
}
Loading…
Cancel
Save