@digigov/cli-build 2.0.0-36b707c1 → 2.0.0-385c7994
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/.prettierrc.cjs +1 -0
- package/.rush/temp/shrinkwrap-deps.json +427 -28
- package/common.js +20 -0
- package/copy-files.js +73 -92
- package/eslint.config.js +3 -0
- package/generate-registry.js +215 -0
- package/index.js +169 -100
- package/package.json +26 -29
- package/transform-imports-plugin.js +263 -0
- package/tsconfig.base.json +21 -61
- package/tsconfig.json +4 -41
- package/babel.common.js +0 -119
- package/babel.config.js +0 -1
- package/tsconfig.common.json +0 -27
package/tsconfig.base.json
CHANGED
|
@@ -1,64 +1,24 @@
|
|
|
1
1
|
{
|
|
2
|
-
"extends": "./tsconfig.common.json",
|
|
3
2
|
"compilerOptions": {
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"@digigov/form-dilosi-integration/": ["./form-dilosi-integration/src"],
|
|
26
|
-
"@digigov/form-dilosi-integration": ["./form-dilosi-integration/src"],
|
|
27
|
-
"@digigov/nextjs/*": ["./nextjs/src/*"],
|
|
28
|
-
"@digigov/nextjs/": ["./nextjs/src"],
|
|
29
|
-
"@digigov/nextjs": ["./nextjs/src"],
|
|
30
|
-
"@digigov/react-core/*": ["../libs-ui/react-core/src/*"],
|
|
31
|
-
"@digigov/react-core/": ["../libs-ui/react-core/src"],
|
|
32
|
-
"@digigov/react-core": ["../libs-ui/react-core/src"],
|
|
33
|
-
"@digigov/react-icons/*": ["../libs-ui/react-icons/src/*"],
|
|
34
|
-
"@digigov/react-icons/": ["../libs-ui/react-icons/src"],
|
|
35
|
-
"@digigov/react-icons": ["../libs-ui/react-icons/src"],
|
|
36
|
-
"@digigov/react-experimental/*": ["../libs-ui/react-experimental/src/*"],
|
|
37
|
-
"@digigov/react-experimental/": ["../libs-ui/react-experimental/src"],
|
|
38
|
-
"@digigov/react-experimental": ["../libs-ui/react-experimental/src"],
|
|
39
|
-
"@digigov/storybook/*": ["../examples/storybook/stories/*"]
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
"include": [
|
|
43
|
-
"../../libs/auth/src/**/*.tsx",
|
|
44
|
-
"../../libs/auth/src/*.tsx",
|
|
45
|
-
"../../libs/benchmark/src/**/*.tsx",
|
|
46
|
-
"../../libs/benchmark/src/*.tsx",
|
|
47
|
-
"../../libs/text-search/src/**/*.tsx",
|
|
48
|
-
"../../libs/text-search/src/*.tsx",
|
|
49
|
-
"../../libs/text-search/src/**/*.ts",
|
|
50
|
-
"../../libs/text-search/src/*.ts",
|
|
51
|
-
"../../libs/form/src/**/*.(tsx|ts)",
|
|
52
|
-
"../../libs/form/src/*.(tsx|ts)",
|
|
53
|
-
"../../libs/form-dilosi-integration/src/**/*.(tsx|ts)",
|
|
54
|
-
"../../libs/form-dilosi-integration/src/*.(tsx|ts)",
|
|
55
|
-
"../../libs/ui-dilosi-integration/src/**/*.(tsx|ts)",
|
|
56
|
-
"../../libs/ui-dilosi-integration/src/*.(tsx|ts)",
|
|
57
|
-
"../../libs/ui/src/**/*.(tsx|ts)",
|
|
58
|
-
"../../libs/ui/src/*.(tsx|ts)",
|
|
59
|
-
"../../libs/auth/src/**/*.tsx",
|
|
60
|
-
"../../libs/auth/src/*.tsx",
|
|
61
|
-
"../../libs/nextjs/**/*.tsx",
|
|
62
|
-
"../../libs/nextjs/*.tsx"
|
|
63
|
-
]
|
|
3
|
+
"module": "ESNext",
|
|
4
|
+
"target": "es5",
|
|
5
|
+
"lib": ["es6", "dom", "es2019"],
|
|
6
|
+
"sourceMap": true,
|
|
7
|
+
"allowJs": true,
|
|
8
|
+
"jsx": "react",
|
|
9
|
+
"declaration": true,
|
|
10
|
+
"moduleResolution": "bundler",
|
|
11
|
+
"forceConsistentCasingInFileNames": true,
|
|
12
|
+
"noImplicitReturns": true,
|
|
13
|
+
"noImplicitThis": true,
|
|
14
|
+
"noImplicitAny": false,
|
|
15
|
+
"strictNullChecks": true,
|
|
16
|
+
"noUnusedLocals": true,
|
|
17
|
+
"noUnusedParameters": true,
|
|
18
|
+
"allowSyntheticDefaultImports": true,
|
|
19
|
+
"skipDefaultLibCheck": true,
|
|
20
|
+
"skipLibCheck": true,
|
|
21
|
+
"resolveJsonModule": true,
|
|
22
|
+
"isolatedModules": true
|
|
23
|
+
}
|
|
64
24
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1,45 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"extends": "
|
|
2
|
+
"extends": "@digigov/cli/tsconfig.cli",
|
|
3
3
|
"compilerOptions": {
|
|
4
|
-
"types": [
|
|
5
|
-
"node"
|
|
6
|
-
],
|
|
7
|
-
"outDir": "dist",
|
|
8
|
-
"paths": {
|
|
9
|
-
"@digigov/babel-ts-to-proptypes": [
|
|
10
|
-
"node_modules/@digigov/babel-ts-to-proptypes/src"
|
|
11
|
-
],
|
|
12
|
-
"@digigov/babel-ts-to-proptypes/": [
|
|
13
|
-
"node_modules/@digigov/babel-ts-to-proptypes/src/"
|
|
14
|
-
],
|
|
15
|
-
"@digigov/babel-ts-to-proptypes/*": [
|
|
16
|
-
"node_modules/@digigov/babel-ts-to-proptypes/src/*"
|
|
17
|
-
],
|
|
18
|
-
"@digigov/cli": [
|
|
19
|
-
"node_modules/@digigov/cli/src"
|
|
20
|
-
],
|
|
21
|
-
"@digigov/cli/": [
|
|
22
|
-
"node_modules/@digigov/cli/src/"
|
|
23
|
-
],
|
|
24
|
-
"@digigov/cli/*": [
|
|
25
|
-
"node_modules/@digigov/cli/src/*"
|
|
26
|
-
],
|
|
27
|
-
"@digigov/cli-build": [
|
|
28
|
-
"./src"
|
|
29
|
-
],
|
|
30
|
-
"@digigov/cli-build/": [
|
|
31
|
-
"./src/"
|
|
32
|
-
],
|
|
33
|
-
"@digigov/cli-build/*": [
|
|
34
|
-
"./src/*"
|
|
35
|
-
]
|
|
36
|
-
},
|
|
37
|
-
"baseUrl": "./"
|
|
4
|
+
"types": ["vitest/globals"]
|
|
38
5
|
},
|
|
39
|
-
"include": [
|
|
40
|
-
|
|
41
|
-
],
|
|
42
|
-
"exclude": [
|
|
43
|
-
"node_modules"
|
|
44
|
-
]
|
|
6
|
+
"include": ["./*.js", "__tests__"],
|
|
7
|
+
"exclude": ["eslint.config.js", ".prettierrc.cjs"]
|
|
45
8
|
}
|
package/babel.common.js
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
// Mostly shared from
|
|
2
|
-
// https://github.com/mui-org/material-ui/blob/master/babel.config.js
|
|
3
|
-
const lib = require("@digigov/cli/lib");
|
|
4
|
-
|
|
5
|
-
function makeBabelConfig(dir, opts = { docs: false, proptypes: false }) {
|
|
6
|
-
const project = lib.resolveProject(dir);
|
|
7
|
-
const aliases = !project.externalLockFile ? lib.aliases(null, true) : {};
|
|
8
|
-
|
|
9
|
-
const BABEL_ENV = process.env.BABEL_ENV || "esm";
|
|
10
|
-
const BABEL_PUBLISH = process.env.BABEL_PUBLISH || false;
|
|
11
|
-
const NODE_ENV = process.env.NODE_ENV;
|
|
12
|
-
const IS_COMMONJS = BABEL_ENV === "cjs" || NODE_ENV === "test";
|
|
13
|
-
|
|
14
|
-
const PRESETS = [
|
|
15
|
-
[
|
|
16
|
-
require.resolve("@babel/preset-env"),
|
|
17
|
-
{
|
|
18
|
-
modules: IS_COMMONJS ? "commonjs" : false,
|
|
19
|
-
},
|
|
20
|
-
],
|
|
21
|
-
require.resolve("@babel/preset-react"),
|
|
22
|
-
];
|
|
23
|
-
|
|
24
|
-
if (project.isTs) {
|
|
25
|
-
PRESETS.push(require.resolve("@babel/preset-typescript"));
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const PLUGINS_COMMON = [
|
|
29
|
-
require.resolve("babel-plugin-optimize-clsx"),
|
|
30
|
-
[
|
|
31
|
-
require.resolve("@babel/plugin-proposal-class-properties"),
|
|
32
|
-
{ loose: true },
|
|
33
|
-
],
|
|
34
|
-
[
|
|
35
|
-
require.resolve("@babel/plugin-proposal-object-rest-spread"),
|
|
36
|
-
{ loose: true },
|
|
37
|
-
],
|
|
38
|
-
// any package needs to declare 7.4.4 as a runtime dependency. default is ^7.0.0
|
|
39
|
-
[require.resolve("@babel/plugin-transform-runtime"), { version: "^7.4.4" }],
|
|
40
|
-
// for IE 11 support
|
|
41
|
-
require.resolve("@babel/plugin-transform-object-assign"),
|
|
42
|
-
require.resolve("babel-plugin-transform-react-constant-elements"),
|
|
43
|
-
];
|
|
44
|
-
|
|
45
|
-
const PLUGINS_PUBLISH = [
|
|
46
|
-
require.resolve("babel-plugin-transform-dev-warning"),
|
|
47
|
-
[
|
|
48
|
-
require.resolve("babel-plugin-react-remove-properties"),
|
|
49
|
-
{ properties: ["data-testid"] },
|
|
50
|
-
],
|
|
51
|
-
[
|
|
52
|
-
require.resolve("babel-plugin-transform-react-remove-prop-types"),
|
|
53
|
-
{
|
|
54
|
-
mode: "unsafe-wrap",
|
|
55
|
-
},
|
|
56
|
-
],
|
|
57
|
-
];
|
|
58
|
-
|
|
59
|
-
const PLUGINS = PLUGINS_COMMON;
|
|
60
|
-
|
|
61
|
-
// Apps images are handled using `next-images` plugin. For libraries there is no
|
|
62
|
-
// explicit way to provide assets to the App using the library. While not
|
|
63
|
-
// considered a very good practice, one way to provide images via libraries is
|
|
64
|
-
// to embed the image data into the library code.
|
|
65
|
-
if (project.isLib || project.isApp) {
|
|
66
|
-
PLUGINS.push(require.resolve("babel-plugin-inline-import-data-uri"));
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
if (BABEL_PUBLISH) {
|
|
70
|
-
PLUGINS.push(...PLUGINS_PUBLISH);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
if (!opts.docs) {
|
|
74
|
-
let resolverAlias = {};
|
|
75
|
-
if (NODE_ENV === "test") resolverAlias = aliases;
|
|
76
|
-
if (BABEL_ENV === "cjs") {
|
|
77
|
-
resolverAlias = Object.keys(aliases).reduce((acc, key) => {
|
|
78
|
-
if (key !== project.name) {
|
|
79
|
-
acc[`^${key}/(.+)`] = `${key}/cjs/\\1`;
|
|
80
|
-
}
|
|
81
|
-
return acc;
|
|
82
|
-
}, {});
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
const RESOLVER = [
|
|
86
|
-
require.resolve("babel-plugin-module-resolver"),
|
|
87
|
-
{
|
|
88
|
-
alias: resolverAlias,
|
|
89
|
-
extensions: [".js", ".jsx", ".ts", ".tsx", ".json"],
|
|
90
|
-
loglevel: "silent",
|
|
91
|
-
},
|
|
92
|
-
];
|
|
93
|
-
PLUGINS.push(RESOLVER);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
if (project.isApp) {
|
|
97
|
-
PRESETS.push(require.resolve("next/babel"));
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
const CONFIG = {
|
|
101
|
-
presets: PRESETS,
|
|
102
|
-
plugins: PLUGINS,
|
|
103
|
-
ignore: [/@babel[\\|/]runtime/],
|
|
104
|
-
env: {
|
|
105
|
-
coverage: {
|
|
106
|
-
plugins: [require.resolve("babel-plugin-istanbul")],
|
|
107
|
-
},
|
|
108
|
-
test: {
|
|
109
|
-
sourceMaps: "both",
|
|
110
|
-
plugins: [],
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
};
|
|
114
|
-
return CONFIG;
|
|
115
|
-
}
|
|
116
|
-
module.exports = {
|
|
117
|
-
makeBabelConfig,
|
|
118
|
-
config: makeBabelConfig(),
|
|
119
|
-
};
|
package/babel.config.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('./babel.common').config
|
package/tsconfig.common.json
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"module": "ESNext",
|
|
4
|
-
"target": "es5",
|
|
5
|
-
"lib": [
|
|
6
|
-
"es6",
|
|
7
|
-
"dom",
|
|
8
|
-
"es2019"
|
|
9
|
-
],
|
|
10
|
-
"sourceMap": true,
|
|
11
|
-
"allowJs": true,
|
|
12
|
-
"jsx": "react",
|
|
13
|
-
"declaration": true,
|
|
14
|
-
"moduleResolution": "node",
|
|
15
|
-
"forceConsistentCasingInFileNames": true,
|
|
16
|
-
"noImplicitReturns": true,
|
|
17
|
-
"noImplicitThis": true,
|
|
18
|
-
"noImplicitAny": false,
|
|
19
|
-
"strictNullChecks": true,
|
|
20
|
-
"noUnusedLocals": true,
|
|
21
|
-
"noUnusedParameters": true,
|
|
22
|
-
"allowSyntheticDefaultImports": true,
|
|
23
|
-
"skipDefaultLibCheck": true,
|
|
24
|
-
"skipLibCheck": true,
|
|
25
|
-
"resolveJsonModule": true
|
|
26
|
-
}
|
|
27
|
-
}
|