@douyinfe/semi-foundation 2.90.1 → 2.90.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,14 +1,30 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-foundation",
3
- "version": "2.90.1",
3
+ "version": "2.90.3",
4
4
  "description": "",
5
5
  "scripts": {
6
+ "clean": "rimraf lib",
6
7
  "build:lib": "node ./scripts/compileLib.js",
7
- "prepublishOnly": "npm run build:lib"
8
+ "prepublishOnly": "npm run clean && npm run build:lib"
9
+ },
10
+ "files": [
11
+ "lib/*",
12
+ "**/*.ts",
13
+ "**/*.scss",
14
+ "!**/node_modules/**",
15
+ "!**/*.test.ts",
16
+ "!**/*.spec.ts"
17
+ ],
18
+ "typesVersions": {
19
+ "*": {
20
+ "*": [
21
+ "lib/es/*"
22
+ ]
23
+ }
8
24
  },
9
25
  "dependencies": {
10
- "@douyinfe/semi-animation": "2.90.1",
11
- "@douyinfe/semi-json-viewer-core": "2.90.1",
26
+ "@douyinfe/semi-animation": "2.90.3",
27
+ "@douyinfe/semi-json-viewer-core": "2.90.3",
12
28
  "@mdx-js/mdx": "^3.0.1",
13
29
  "async-validator": "^3.5.0",
14
30
  "classnames": "^2.2.6",
@@ -29,7 +45,7 @@
29
45
  "*.scss",
30
46
  "*.css"
31
47
  ],
32
- "gitHead": "1c5ad59769306a150d7fd6b442965094392477e9",
48
+ "gitHead": "a01b57e49fd8c09acc819fdccec6dbbdf7a3047a",
33
49
  "devDependencies": {
34
50
  "@babel/plugin-transform-runtime": "^7.15.8",
35
51
  "@babel/preset-env": "^7.15.8",
@@ -45,6 +61,7 @@
45
61
  "gulp-sass": "^5.0.0",
46
62
  "gulp-typescript": "^6.0.0-alpha.1",
47
63
  "merge2": "^1.4.1",
64
+ "rimraf": "^3.0.2",
48
65
  "through2": "^4.0.2"
49
66
  }
50
67
  }
package/getBabelConfig.js DELETED
@@ -1,24 +0,0 @@
1
- module.exports = ({ isESM }) => {
2
- return {
3
- presets: [
4
- [
5
- '@babel/preset-env',
6
- {
7
- modules: isESM ? false : 'commonjs',
8
- targets: {
9
- browsers: [
10
- "> 0.5%",
11
- "last 2 versions",
12
- "Firefox ESR",
13
- "not dead",
14
- "not IE 11"
15
- ]
16
- }
17
- },
18
- ],
19
- ],
20
- plugins: [
21
- 'lodash',
22
- ]
23
- };
24
- };
package/gulpfile.js DELETED
@@ -1,107 +0,0 @@
1
- const path = require('path');
2
- const { Buffer } = require('buffer');
3
- const through2 = require('through2');
4
- const gulp = require('gulp');
5
- const merge2 = require('merge2');
6
- const gulpTS = require('gulp-typescript');
7
- const gulpBabel = require('gulp-babel');
8
- const sass = require('gulp-sass')(require('sass'));
9
- const del = require('del');
10
- const tsConfig = require('./tsconfig.json');
11
- const getBabelConfig = require('./getBabelConfig');
12
-
13
- gulp.task('cleanLib', function cleanLib() {
14
- return del(['lib/**/*']);
15
- });
16
-
17
- function compileTS(isESM) {
18
- const targetDir = isESM ? 'lib/es' : 'lib/cjs';
19
- const tsStream = gulp.src(['**/*.ts', '!node_modules/**/*.*'])
20
- .pipe(gulpTS(tsConfig.compilerOptions));
21
- const jsStream = tsStream.js
22
- .pipe(gulpBabel(getBabelConfig({ isESM })))
23
- .pipe(gulp.dest(targetDir));
24
- const dtsStream = tsStream.dts.pipe(gulp.dest(targetDir));
25
- return merge2([jsStream, dtsStream]);
26
- }
27
-
28
- gulp.task('compileTSForESM', function compileTSForESM() {
29
- return compileTS(true);
30
- });
31
-
32
- gulp.task('compileTSForCJS', function compileTSForCJS() {
33
- return compileTS(false);
34
- });
35
-
36
- const excludeScss = [
37
- '!**/button/splitButtonGroup.scss',
38
- '!**/steps/bacisSteps.scss',
39
- '!**/steps/fillSteps.scss',
40
- '!**/steps/navSteps.scss',
41
- '!**/table/operationPanel.scss',
42
- '!**/tooltip/arrow.scss',
43
- '!**/autoComplete/option.scss',
44
- '!**/select/option.scss',
45
- ];
46
- gulp.task('compileScss', function compileScss() {
47
- return gulp.src(['**/*.scss', '!node_modules/**/*.*', '!**/rtl.scss', '!**/variables.scss', "!**/animation.scss", ...excludeScss])
48
- .pipe(through2.obj(
49
- function (chunk, enc, cb) {
50
- const rootPath = path.join(__dirname, '../../');
51
- const scssVarStr = `@import "${rootPath}/packages/semi-theme-default/scss/index.scss";\n`;
52
- let scssRaw = chunk.contents.toString('utf-8');
53
- if (scssRaw.startsWith("@use")) {
54
- const scssRawSplit = scssRaw.split("\n");
55
- const codeStartIndex = scssRawSplit.findIndex(item => !item.startsWith("@use"));
56
- scssRawSplit.splice(codeStartIndex, 0, scssVarStr);
57
- scssRaw = scssRawSplit.join("\n");
58
- } else {
59
- scssRaw = `${scssVarStr}\n${scssRaw}`;
60
- }
61
- chunk.contents = Buffer.from(scssRaw, 'utf-8');
62
- cb(null, chunk);
63
- }
64
- ))
65
- .pipe(sass({
66
- charset: false
67
- }).on('error', sass.logError))
68
- .pipe(gulp.dest('lib/es'))
69
- .pipe(gulp.dest('lib/cjs'));
70
- });
71
-
72
- gulp.task('moveScss', function moveScss() {
73
- return gulp.src(['**/*.scss', '!node_modules/**/*.*'])
74
- .pipe(gulp.dest('lib/es'))
75
- .pipe(gulp.dest('lib/cjs'));
76
- });
77
-
78
- gulp.task('compileLib',
79
- gulp.series(
80
- [
81
- 'cleanLib', 'compileScss',
82
- 'moveScss',
83
- gulp.parallel('compileTSForESM', 'compileTSForCJS'),
84
- ]
85
- )
86
- );
87
-
88
- gulp.task('findDupCSSVariables', function findDupCSSVariables() {
89
- return gulp.src(['**/variable?.scss', '!node_modules/**/*.*'])
90
- .pipe(through2.obj((chunk, enc, cb) => {
91
- const fileStr = chunk.contents.toString(enc);
92
- const lines = fileStr.split('\n');
93
- const variables = new Set();
94
- for (let line of lines) {
95
- if (/\$[a-z]+(-[a-z0-9_]+)+/.test(line)) {
96
- const variable = line.split(':')[0];
97
- if (variables.has(variable)) {
98
- console.error(`❌ ${variable} dup`);
99
- } else {
100
- variables.add(variable);
101
- }
102
- }
103
- }
104
- cb();
105
- }));
106
- });
107
-
@@ -1,51 +0,0 @@
1
- const esbuild = require('esbuild');
2
- const path = require('path');
3
- const fs = require('fs');
4
-
5
-
6
-
7
-
8
- const compileWorker = async ()=>{
9
- const workerEntry = path.join(__dirname, "..", "core/src/worker/json.worker.ts");
10
-
11
- const result = await esbuild.build({
12
- entryPoints: [workerEntry],
13
- bundle: true,
14
- write: false,
15
- });
16
- return result.outputFiles[0].text;
17
- };
18
-
19
-
20
- const buildMain = async ()=>{
21
- const mainEntry = path.join(__dirname, "..", "core/src/index.ts");
22
-
23
- const result = await esbuild.build({
24
- entryPoints: [mainEntry],
25
- bundle: true,
26
- packages: 'external',
27
- write: false,
28
- format: 'esm'
29
- });
30
- return result.outputFiles[0].text;
31
-
32
- };
33
-
34
-
35
-
36
- const compile = async ()=>{
37
- const workerRaw = await compileWorker();
38
-
39
- const mainRaw = await buildMain();
40
-
41
- const finalRaw = mainRaw.replaceAll("%WORKER_RAW%", encodeURIComponent(workerRaw));
42
-
43
- const saveDir = path.join(__dirname, "..", "core/lib");
44
-
45
- if (!fs.existsSync(saveDir)) {
46
- fs.mkdirSync(saveDir);
47
- }
48
- fs.writeFileSync(path.join(saveDir, "index.js"), finalRaw, 'utf8');
49
- };
50
-
51
- compile();
@@ -1,13 +0,0 @@
1
- const gulp = require('gulp');
2
- require('../gulpfile');
3
-
4
- function compileLib() {
5
- const taskInstance = gulp.task('compileLib');
6
- if (taskInstance === undefined) {
7
- console.error('no task named compileLib registered');
8
- return;
9
- }
10
- taskInstance.apply(gulp);
11
- }
12
-
13
- compileLib();
package/tsconfig.json DELETED
@@ -1,25 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2015",
4
- "baseUrl": "./",
5
- "outDir": "lib",
6
- "sourceMap": true,
7
- "allowJs": true,
8
- "module": "es6",
9
- "lib": ["esnext", "dom"],
10
- "moduleResolution": "node",
11
- "noImplicitAny": false,
12
- "forceConsistentCasingInFileNames": true,
13
- "allowSyntheticDefaultImports": true,
14
- "experimentalDecorators": true,
15
- "noImplicitReturns": true,
16
- "noImplicitThis": false,
17
- "strictNullChecks": false,
18
- "esModuleInterop": true,
19
- "skipLibCheck": true,
20
- "declaration": true,
21
- "strict": true
22
- },
23
- "include": ["**/*.ts"],
24
- "exclude": ["node_modules"]
25
- }