@infomaximum/package-cli 2.24.0-1 → 2.24.0
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/CHANGELOG.md +2 -10
- package/dist/index.d.ts +0 -1
- package/dist/integration/scripts/init.d.ts +0 -5
- package/dist/integration/scripts/init.js +10 -5
- package/dist/integration/templates/integrationConfigs.d.ts +3 -2
- package/dist/integration/templates/integrationConfigs.js +134 -19
- package/dist/integration/templates/integrationIndex.d.ts +1 -1
- package/dist/integration/templates/integrationIndex.js +2 -2
- package/dist/integration/templates/integrationPackageJson.d.ts +1 -1
- package/dist/integration/templates/integrationPackageJson.js +7 -1
- package/dist/widget/commands.js +0 -2
- package/dist/widget/configs/file.d.ts +0 -2
- package/dist/widget/configs/webpack/common.d.ts +1 -1
- package/dist/widget/configs/webpack/common.js +6 -4
- package/dist/widget/configs/webpack/sections/plugins/minimizer.d.ts +1 -1
- package/dist/widget/scripts/init/actions.js +1 -1
- package/dist/widget/templates/src/widgetIndex.d.ts +1 -1
- package/dist/widget/templates/src/widgetIndex.js +1 -3
- package/dist/widget/templates/widgetPackageJson.d.ts +1 -1
- package/dist/widget/templates/widgetPackageJson.js +5 -10
- package/dist/widget/templates/widgetRCConfig.js +11 -15
- package/dist/widget/widgetPaths.d.ts +1 -2
- package/package.json +3 -6
- package/schemas/widgetConfigSchema.json +0 -5
- package/dist/widget/commands/build_script.d.ts +0 -7
- package/dist/widget/commands/build_script.js +0 -12
- package/dist/widget/scripts/build_script.d.ts +0 -3
- package/dist/widget/scripts/build_script.js +0 -39
package/CHANGELOG.md
CHANGED
|
@@ -2,20 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
-
## [2.24.0
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
### Bug Fixes
|
|
9
|
-
|
|
10
|
-
* убрано копирование ресурсов при сборке скрипта ([9084cab](https://github.com/Infomaximum/package-cli/commit/9084cab37462fadf4ad15169ea7d701a18698199))
|
|
11
|
-
|
|
12
|
-
## [2.24.0-0](https://github.com/Infomaximum/package-cli/compare/v2.23.1...v2.24.0-0) (2025-06-20)
|
|
5
|
+
## [2.24.0](https://github.com/Infomaximum/package-cli/compare/v2.23.1...v2.24.0) (2025-09-23)
|
|
13
6
|
|
|
14
7
|
|
|
15
8
|
### Features
|
|
16
9
|
|
|
17
|
-
*
|
|
18
|
-
* добавлена поддержка externals ([897eb0c](https://github.com/Infomaximum/package-cli/commit/897eb0cba2b3921f47c6d10d02de860b50d4c151))
|
|
10
|
+
* updated eslint config and add commitlint rules ([c3b94d8](https://github.com/Infomaximum/package-cli/commit/c3b94d8ed29a27b3146e758a212ef44d4f9ef9d1))
|
|
19
11
|
|
|
20
12
|
### [2.23.1](https://github.com/Infomaximum/package-cli/compare/v2.23.0...v2.23.1) (2025-06-02)
|
|
21
13
|
|
package/dist/index.d.ts
CHANGED
|
@@ -12,11 +12,6 @@ declare const getInitIntegrationActions: () => Promise<(data: Answers) => ({
|
|
|
12
12
|
path: string;
|
|
13
13
|
template: string;
|
|
14
14
|
data?: undefined;
|
|
15
|
-
} | {
|
|
16
|
-
type: "add";
|
|
17
|
-
path: string;
|
|
18
|
-
template: undefined;
|
|
19
|
-
data?: undefined;
|
|
20
15
|
} | {
|
|
21
16
|
type: "add";
|
|
22
17
|
path: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __awaiter } from "tslib";
|
|
2
|
-
import { INTEGRATION_BABEL_CONFIG, INTEGRATION_ENV_EXAMPLE_CONFIG, INTEGRATION_ESLINTRC, INTEGRATION_GITIGNORE, INTEGRATION_HUSKY_COMMITMSG, INTEGRATION_HUSKY_PRECOMMIT, INTEGRATION_RC_CONFIG, INTEGRATION_TSCONFIG_JSON, INTEGRATION_VITEST_CONFIG, INTEGRATION_VSCODE_EXTENSIONS, INTEGRATION_VSCODE_LAUNCH, INTEGRATION_VSCODE_SETTINGS, } from "../templates/integrationConfigs.js";
|
|
2
|
+
import { INTEGRATION_BABEL_CONFIG, INTEGRATION_COMMITLINT_CONFIG, INTEGRATION_ENV_EXAMPLE_CONFIG, INTEGRATION_ESLINTRC, INTEGRATION_GITIGNORE, INTEGRATION_HUSKY_COMMITMSG, INTEGRATION_HUSKY_PRECOMMIT, INTEGRATION_RC_CONFIG, INTEGRATION_TSCONFIG_JSON, INTEGRATION_VITEST_CONFIG, INTEGRATION_VSCODE_EXTENSIONS, INTEGRATION_VSCODE_LAUNCH, INTEGRATION_VSCODE_SETTINGS, } from "../templates/integrationConfigs.js";
|
|
3
3
|
import { getPackageActions } from "../../package/scripts/actions.js";
|
|
4
4
|
import { INTEGRATION_INDEX_TEMPLATE } from "../templates/integrationIndex.js";
|
|
5
5
|
import { INTEGRATION_PACKAGE_JSON_TEMPLATE } from "../templates/integrationPackageJson.js";
|
|
@@ -16,22 +16,22 @@ const actions = ({ packageCliVersion, integrationSdkVersion }) => {
|
|
|
16
16
|
{
|
|
17
17
|
type: "add",
|
|
18
18
|
path: "src/types/common.d.ts",
|
|
19
|
-
template:
|
|
19
|
+
template: "",
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
type: "add",
|
|
23
23
|
path: "src/utils/index.ts",
|
|
24
|
-
template: ""
|
|
24
|
+
template: "",
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
type: "add",
|
|
28
28
|
path: "src/modules/template.ts",
|
|
29
|
-
template: ""
|
|
29
|
+
template: "",
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
type: "add",
|
|
33
33
|
path: "src/connections/base.ts",
|
|
34
|
-
template: ""
|
|
34
|
+
template: "",
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
type: "add",
|
|
@@ -74,6 +74,11 @@ const actions = ({ packageCliVersion, integrationSdkVersion }) => {
|
|
|
74
74
|
template: INTEGRATION_PACKAGE_JSON_TEMPLATE,
|
|
75
75
|
data: { packageCliVersion, integrationSdkVersion },
|
|
76
76
|
},
|
|
77
|
+
{
|
|
78
|
+
type: "add",
|
|
79
|
+
path: ".commitlintrc.json",
|
|
80
|
+
template: INTEGRATION_COMMITLINT_CONFIG,
|
|
81
|
+
},
|
|
77
82
|
{
|
|
78
83
|
type: "add",
|
|
79
84
|
path: ".vscode/launch.json",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const INTEGRATION_TSCONFIG_JSON = "{\n \"compilerOptions\": {\n \"target\": \"ES2024\",\n \"lib\": [\"ES2024\",\"DOM\"],\n \"types\": [\"@infomaximum/integration-sdk\"],\n \"module\": \"Preserve\",\n \"esModuleInterop\": true,\n \"forceConsistentCasingInFileNames\": true,\n \"strict\": true,\n \"skipLibCheck\": true,\n \"isolatedModules\": false\n },\n \"include\": [\"src\"]\n}\n";
|
|
2
|
-
export declare const INTEGRATION_GITIGNORE = "# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/dist\n\n#documentation\n/docs\n\n
|
|
2
|
+
export declare const INTEGRATION_GITIGNORE = "# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/dist\n\n#documentation\n/docs\n\n\n# misc\n.DS_Store\n.env\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n\n/build\n.ultra.cache.json\n*.tsbuildinfo\n.node-xmlhttprequest-content-*\n.node-xmlhttprequest-sync-*\n";
|
|
3
3
|
export declare const INTEGRATION_BABEL_CONFIG = "module.exports = {\n sourceType: \"unambiguous\",\n presets: [],\n plugins: [\"@babel/plugin-transform-block-scoping\"],\n};\n";
|
|
4
|
-
export declare const INTEGRATION_ESLINTRC = "
|
|
4
|
+
export declare const INTEGRATION_ESLINTRC = "import eslint from \"@eslint/js\";\nimport { defineConfig } from \"eslint/config\";\nimport tseslint from \"typescript-eslint\";\nimport fp from \"eslint-plugin-fp\";\nimport sonarPlugin from \"eslint-plugin-sonarjs\";\nexport default defineConfig(\n eslint.configs.recommended,\n tseslint.configs.recommended,\n tseslint.configs.strict,\n tseslint.configs.stylistic,\n\n [\n {\n ignores: [\n \"**/dist/**\",\n \"**/build/**\",\n \"**/node_modules/**\",\n \"**/*.config.js\",\n \"**/*.config.cjs\",\n \"**/*.config.mjs\",\n ],\n files: [\"**/*.ts\", \"**/*.tsx\"],\n languageOptions: {\n ecmaVersion: \"latest\",\n sourceType: \"module\",\n parserOptions: {\n project: \"./tsconfig.json\",\n },\n },\n plugins: {\n \"@typescript-eslint\": tseslint.plugin,\n fp,\n sonarjs: sonarPlugin,\n },\n rules: {\n \"@typescript-eslint/no-unused-vars\": [\n \"error\",\n {\n argsIgnorePattern: \"^_\",\n varsIgnorePattern: \"^_\",\n },\n ],\n \"@typescript-eslint/no-explicit-any\": \"warn\",\n \"@typescript-eslint/consistent-type-definitions\": [\n \"error\",\n \"interface\",\n ],\n \"@typescript-eslint/explicit-function-return-type\": [\n \"error\",\n {\n allowExpressions: true,\n allowTypedFunctionExpressions: true,\n },\n ],\n \"@typescript-eslint/naming-convention\": [\n \"error\",\n {\n selector: [\"variable\", \"function\"],\n format: [\"camelCase\"],\n leadingUnderscore: \"allow\",\n trailingUnderscore: \"forbid\",\n },\n\n {\n selector: [\"typeLike\", \"class\"],\n format: [\"PascalCase\"],\n },\n {\n selector: \"interface\",\n format: [\"PascalCase\"],\n custom: {\n regex: \"^I[A-Z]\",\n match: true,\n },\n },\n {\n selector: \"typeAlias\",\n format: [\"PascalCase\"],\n custom: {\n regex: \"^T[A-Z]\",\n match: true,\n },\n },\n {\n selector: \"enum\",\n format: [\"PascalCase\"],\n custom: {\n regex: \"^E[A-Z]\",\n match: true,\n },\n },\n {\n selector: \"enumMember\",\n format: [\"PascalCase\"],\n },\n {\n selector: \"method\",\n format: [\"camelCase\"],\n },\n {\n selector: \"parameter\",\n format: [\"camelCase\"],\n leadingUnderscore: \"allow\",\n },\n ],\n \"@typescript-eslint/prefer-for-of\": \"error\",\n \"prefer-const\": \"error\",\n \"no-var\": \"error\",\n \"prefer-arrow-callback\": \"error\",\n\n eqeqeq: [\"error\", \"always\"],\n yoda: \"error\",\n \"no-lonely-if\": \"error\",\n curly: \"error\",\n // \u041E\u0433\u0440\u0430\u0447\u0438\u0447\u0435\u043D\u0438\u0435 \u043D\u0430 \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0441\u0442\u0440\u043E\u043A \u0432 \u0444\u0443\u043D\u043A\u0446\u0438\u0438, \u0447\u0442\u043E\u0431\u044B \u043F\u043E\u043E\u0449\u0440\u044F\u0442\u044C \u0431\u043E\u043B\u0435\u0435 \u043C\u0435\u043B\u043A\u0438\u0435, \u0431\u043E\u043B\u0435\u0435 \u0443\u043F\u0440\u0430\u0432\u043B\u044F\u0435\u043C\u044B\u0435 \u0444\u0443\u043D\u043A\u0446\u0438\u0438.\n \"max-lines-per-function\": [\n \"error\",\n { max: 100, skipComments: true, skipBlankLines: true },\n ],\n \"max-depth\": [\"error\", { max: 3 }],\n\n \"no-param-reassign\": [\"error\", { props: true }],\n //sonarjs \u043F\u0440\u0430\u0432\u0438\u043B\u0430\n \"sonarjs/cognitive-complexity\": [\"error\", 10],\n \"sonarjs/no-identical-expressions\": \"error\",\n \"sonarjs/no-ignored-return\": \"error\",\n \"sonarjs/no-redundant-boolean\": \"error\",\n },\n },\n ]\n);\n";
|
|
5
5
|
export declare const INTEGRATION_VITEST_CONFIG = "import { defineConfig } from 'vitest/config';\n\nexport default defineConfig({\n test: {\n coverage: {\n provider:'v8',\n exclude: [\n '**/*.config.*',\n 'src/index.ts',\n ],\n },\n },\n});\n";
|
|
6
6
|
export declare const INTEGRATION_RC_CONFIG = "//@ts-check\n\nrequire(\"dotenv\").config();\n\nconst query = `\nmutation UpdateIntegration($id: Long!, $js_code: String) {\n automation {\n integration {\n update(id: $id, js_code: $js_code) {\n id\n }\n }\n }\n}`;\n\n/**\n * @type {import(\"@infomaximum/package-cli\").IntegrationRCConfig}\n */\nconst config = {\n entry: \"src/index.ts\",\n fetcher: (integrationCode) => {\n return {\n graphqlUrl: process.env.GRAPHQL_URL,\n apiKey: process.env.API_KEY,\n query,\n variables: {\n id: process.env.INTEGRATION_ID,\n js_code: integrationCode,\n },\n };\n },\n\n debugging: {\n seriesIterations: 3,\n commonAuthData: {\n BASE_URL: process.env.WEBHOOK_URL\n },\n blocks: {},\n connections: {},\n },\n};\n\nmodule.exports = config;\n";
|
|
7
7
|
export declare const INTEGRATION_ENV_EXAMPLE_CONFIG = "INTEGRATION_ID=0\nGRAPHQL_URL=https://example.com/graphql\nAPI_KEY=123456789qwertyuiop\nWEBHOOK_URL=https://example.com/webhook\n";
|
|
@@ -10,3 +10,4 @@ export declare const INTEGRATION_VSCODE_SETTINGS = "{\n \"typescript.tsdk\": \"
|
|
|
10
10
|
export declare const INTEGRATION_VSCODE_EXTENSIONS = "{\n \"recommendations\": [\"Jokerok.integration-debugger\"]\n}\n";
|
|
11
11
|
export declare const INTEGRATION_HUSKY_PRECOMMIT = "yarn lint\n";
|
|
12
12
|
export declare const INTEGRATION_HUSKY_COMMITMSG = "yarn commitlint --edit $1\n";
|
|
13
|
+
export declare const INTEGRATION_COMMITLINT_CONFIG = "{\n \"extends\": [\"@commitlint/config-conventional\"]\n}\n";
|
|
@@ -31,8 +31,6 @@ export const INTEGRATION_GITIGNORE = `\
|
|
|
31
31
|
#documentation
|
|
32
32
|
/docs
|
|
33
33
|
|
|
34
|
-
#package
|
|
35
|
-
/package
|
|
36
34
|
|
|
37
35
|
# misc
|
|
38
36
|
.DS_Store
|
|
@@ -60,24 +58,136 @@ module.exports = {
|
|
|
60
58
|
};
|
|
61
59
|
`;
|
|
62
60
|
export const INTEGRATION_ESLINTRC = `\
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
61
|
+
import eslint from "@eslint/js";
|
|
62
|
+
import { defineConfig } from "eslint/config";
|
|
63
|
+
import tseslint from "typescript-eslint";
|
|
64
|
+
import fp from "eslint-plugin-fp";
|
|
65
|
+
import sonarPlugin from "eslint-plugin-sonarjs";
|
|
66
|
+
export default defineConfig(
|
|
67
|
+
eslint.configs.recommended,
|
|
68
|
+
tseslint.configs.recommended,
|
|
69
|
+
tseslint.configs.strict,
|
|
70
|
+
tseslint.configs.stylistic,
|
|
71
|
+
|
|
72
|
+
[
|
|
73
|
+
{
|
|
74
|
+
ignores: [
|
|
75
|
+
"**/dist/**",
|
|
76
|
+
"**/build/**",
|
|
77
|
+
"**/node_modules/**",
|
|
78
|
+
"**/*.config.js",
|
|
79
|
+
"**/*.config.cjs",
|
|
80
|
+
"**/*.config.mjs",
|
|
81
|
+
],
|
|
82
|
+
files: ["**/*.ts", "**/*.tsx"],
|
|
83
|
+
languageOptions: {
|
|
84
|
+
ecmaVersion: "latest",
|
|
85
|
+
sourceType: "module",
|
|
86
|
+
parserOptions: {
|
|
87
|
+
project: "./tsconfig.json",
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
plugins: {
|
|
91
|
+
"@typescript-eslint": tseslint.plugin,
|
|
92
|
+
fp,
|
|
93
|
+
sonarjs: sonarPlugin,
|
|
94
|
+
},
|
|
95
|
+
rules: {
|
|
96
|
+
"@typescript-eslint/no-unused-vars": [
|
|
97
|
+
"error",
|
|
98
|
+
{
|
|
99
|
+
argsIgnorePattern: "^_",
|
|
100
|
+
varsIgnorePattern: "^_",
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
"@typescript-eslint/no-explicit-any": "warn",
|
|
104
|
+
"@typescript-eslint/consistent-type-definitions": [
|
|
105
|
+
"error",
|
|
106
|
+
"interface",
|
|
107
|
+
],
|
|
108
|
+
"@typescript-eslint/explicit-function-return-type": [
|
|
109
|
+
"error",
|
|
110
|
+
{
|
|
111
|
+
allowExpressions: true,
|
|
112
|
+
allowTypedFunctionExpressions: true,
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
"@typescript-eslint/naming-convention": [
|
|
116
|
+
"error",
|
|
117
|
+
{
|
|
118
|
+
selector: ["variable", "function"],
|
|
119
|
+
format: ["camelCase"],
|
|
120
|
+
leadingUnderscore: "allow",
|
|
121
|
+
trailingUnderscore: "forbid",
|
|
122
|
+
},
|
|
123
|
+
|
|
124
|
+
{
|
|
125
|
+
selector: ["typeLike", "class"],
|
|
126
|
+
format: ["PascalCase"],
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
selector: "interface",
|
|
130
|
+
format: ["PascalCase"],
|
|
131
|
+
custom: {
|
|
132
|
+
regex: "^I[A-Z]",
|
|
133
|
+
match: true,
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
selector: "typeAlias",
|
|
138
|
+
format: ["PascalCase"],
|
|
139
|
+
custom: {
|
|
140
|
+
regex: "^T[A-Z]",
|
|
141
|
+
match: true,
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
selector: "enum",
|
|
146
|
+
format: ["PascalCase"],
|
|
147
|
+
custom: {
|
|
148
|
+
regex: "^E[A-Z]",
|
|
149
|
+
match: true,
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
selector: "enumMember",
|
|
154
|
+
format: ["PascalCase"],
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
selector: "method",
|
|
158
|
+
format: ["camelCase"],
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
selector: "parameter",
|
|
162
|
+
format: ["camelCase"],
|
|
163
|
+
leadingUnderscore: "allow",
|
|
164
|
+
},
|
|
165
|
+
],
|
|
166
|
+
"@typescript-eslint/prefer-for-of": "error",
|
|
167
|
+
"prefer-const": "error",
|
|
168
|
+
"no-var": "error",
|
|
169
|
+
"prefer-arrow-callback": "error",
|
|
170
|
+
|
|
171
|
+
eqeqeq: ["error", "always"],
|
|
172
|
+
yoda: "error",
|
|
173
|
+
"no-lonely-if": "error",
|
|
174
|
+
curly: "error",
|
|
175
|
+
// Ограчичение на количество строк в функции, чтобы поощрять более мелкие, более управляемые функции.
|
|
176
|
+
"max-lines-per-function": [
|
|
177
|
+
"error",
|
|
178
|
+
{ max: 100, skipComments: true, skipBlankLines: true },
|
|
179
|
+
],
|
|
180
|
+
"max-depth": ["error", { max: 3 }],
|
|
181
|
+
|
|
182
|
+
"no-param-reassign": ["error", { props: true }],
|
|
183
|
+
//sonarjs правила
|
|
184
|
+
"sonarjs/cognitive-complexity": ["error", 10],
|
|
185
|
+
"sonarjs/no-identical-expressions": "error",
|
|
186
|
+
"sonarjs/no-ignored-return": "error",
|
|
187
|
+
"sonarjs/no-redundant-boolean": "error",
|
|
188
|
+
},
|
|
79
189
|
},
|
|
80
|
-
|
|
190
|
+
]
|
|
81
191
|
);
|
|
82
192
|
`;
|
|
83
193
|
export const INTEGRATION_VITEST_CONFIG = `\
|
|
@@ -193,3 +303,8 @@ yarn lint
|
|
|
193
303
|
export const INTEGRATION_HUSKY_COMMITMSG = `\
|
|
194
304
|
yarn commitlint --edit $1
|
|
195
305
|
`;
|
|
306
|
+
export const INTEGRATION_COMMITLINT_CONFIG = `\
|
|
307
|
+
{
|
|
308
|
+
"extends": ["@commitlint/config-conventional"]
|
|
309
|
+
}
|
|
310
|
+
`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const INTEGRATION_INDEX_TEMPLATE = "
|
|
1
|
+
export declare const INTEGRATION_INDEX_TEMPLATE = "app = {\n schema: 2,\n version:\"0.0.1\",\n label:\"Integration_template\",\n description:\"\",\n blocks: {},\n connections: {},\n};\n";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const INTEGRATION_PACKAGE_JSON_TEMPLATE = "{\n \"name\": \"template_integration\",\n \"version\": \"1.0.0\",\n \"main\": \"src/index.ts\",\n \"scripts\": {\n \"build\": \"im-package-cli integration build\",\n \"build:script\": \"im-package-cli integration build --type=script --beautify\",\n \"dev\": \"im-package-cli integration build --watch --beautify\",\n \"serve\": \"im-package-cli integration build --watch --fetchToServer --beautify\",\n \"lint\": \"tsc --noEmit && eslint src/ --ext .ts,.tsx --quiet\",\n \"test\": \"vitest --run\",\n \"test:coverage\": \"vitest --run --coverage\",\n \"test:ui\": \"vitest --ui\",\n \"debug\": \"node --import tsx ./node_modules/.bin/im-package-cli integration debug\",\n \"prepare\": \"husky\"\n },\n \"devDependencies\": {\n \"@babel/plugin-transform-block-scoping\": \"^7.25.9\",\n \"@eslint/js\": \"^9.23.0\",\n \"@infomaximum/integration-sdk\": \"^{{integrationSdkVersion}}\",\n \"@infomaximum/package-cli\": \"^{{packageCliVersion}}\",\n \"@types/node\": \"^0\",\n \"dotenv\": \"^16.4.7\",\n \"eslint\": \"^9.23.0\",\n \"globals\": \"^15.14.0\",\n \"tsx\": \"^4.19.3\",\n \"typescript\": \"^5.8.2\",\n \"typescript-eslint\": \"^8.29.0\",\n \"vitest\": \"^3.0.4\",\n \"@vitest/coverage-v8\": \"3.0.7\",\n \"@vitest/ui\": \"3.0.7\",\n \"husky\": \"^9.1.7\"\n }\n}\n";
|
|
1
|
+
export declare const INTEGRATION_PACKAGE_JSON_TEMPLATE = "{\n \"name\": \"template_integration\",\n \"version\": \"1.0.0\",\n \"main\": \"src/index.ts\",\n \"scripts\": {\n \"build\": \"im-package-cli integration build\",\n \"build:script\": \"im-package-cli integration build --type=script --beautify\",\n \"dev\": \"im-package-cli integration build --watch --beautify\",\n \"serve\": \"im-package-cli integration build --watch --fetchToServer --beautify\",\n \"lint\": \"tsc --noEmit && eslint src/ --ext .ts,.tsx --quiet\",\n \"test\": \"vitest --run\",\n \"test:coverage\": \"vitest --run --coverage\",\n \"test:ui\": \"vitest --ui\",\n \"debug\": \"node --import tsx ./node_modules/.bin/im-package-cli integration debug\",\n \"prepare\": \"husky\"\n },\n \"devDependencies\": {\n \"@babel/plugin-transform-block-scoping\": \"^7.25.9\",\n \"@eslint/js\": \"^9.23.0\",\n \"@infomaximum/integration-sdk\": \"^{{integrationSdkVersion}}\",\n \"@infomaximum/package-cli\": \"^{{packageCliVersion}}\",\n \"@types/node\": \"^0\",\n \"dotenv\": \"^16.4.7\",\n \"eslint\": \"^9.23.0\",\n \"globals\": \"^15.14.0\",\n \"tsx\": \"^4.19.3\",\n \"typescript\": \"^5.8.2\",\n \"typescript-eslint\": \"^8.29.0\",\n \"vitest\": \"^3.0.4\",\n \"@vitest/coverage-v8\": \"3.0.7\",\n \"@vitest/ui\": \"3.0.7\",\n \"husky\": \"^9.1.7\",\n \"eslint-plugin-fp\": \"^2.3.0\",\n \"eslint-plugin-sonarjs\": \"^3.0.5\",\n \"@commitlint/cli\": \"^19.8.1\",\n \"@commitlint/config-conventional\": \"^19.8.1\",\n \"@infomaximum/config\": \"^2.7.0\",\n \"commitlint\": \"^19.8.1\"\n }\n}\n";
|
|
@@ -32,7 +32,13 @@ export const INTEGRATION_PACKAGE_JSON_TEMPLATE = `\
|
|
|
32
32
|
"vitest": "^3.0.4",
|
|
33
33
|
"@vitest/coverage-v8": "3.0.7",
|
|
34
34
|
"@vitest/ui": "3.0.7",
|
|
35
|
-
"husky": "^9.1.7"
|
|
35
|
+
"husky": "^9.1.7",
|
|
36
|
+
"eslint-plugin-fp": "^2.3.0",
|
|
37
|
+
"eslint-plugin-sonarjs": "^3.0.5",
|
|
38
|
+
"@commitlint/cli": "^19.8.1",
|
|
39
|
+
"@commitlint/config-conventional": "^19.8.1",
|
|
40
|
+
"@infomaximum/config": "^2.7.0",
|
|
41
|
+
"commitlint": "^19.8.1"
|
|
36
42
|
}
|
|
37
43
|
}
|
|
38
44
|
`;
|
package/dist/widget/commands.js
CHANGED
|
@@ -2,12 +2,10 @@ import { registerWidgetBuildCommand } from "./commands/build.js";
|
|
|
2
2
|
import { registerWidgetStartCommand } from "./commands/start.js";
|
|
3
3
|
import { registerWidgetInitCommand } from "./commands/init.js";
|
|
4
4
|
import { registerWidgetReleaseCommand } from "./commands/release.js";
|
|
5
|
-
import { registerWidgetBuildScriptCommand } from "./commands/build_script.js";
|
|
6
5
|
export const registerWidgetCommands = (cli) => {
|
|
7
6
|
const widgetCommand = cli.command("widget");
|
|
8
7
|
registerWidgetBuildCommand(widgetCommand);
|
|
9
8
|
registerWidgetStartCommand(widgetCommand);
|
|
10
9
|
registerWidgetInitCommand(widgetCommand);
|
|
11
10
|
registerWidgetReleaseCommand(widgetCommand);
|
|
12
|
-
registerWidgetBuildScriptCommand(widgetCommand);
|
|
13
11
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { SystemWidgetExternals } from "@infomaximum/widget-sdk";
|
|
2
1
|
export type WidgetRCConfig = {
|
|
3
2
|
entry: string;
|
|
4
3
|
widgetManifest: string;
|
|
@@ -8,6 +7,5 @@ export type WidgetRCConfig = {
|
|
|
8
7
|
buildDir: string;
|
|
9
8
|
port: number;
|
|
10
9
|
host: string;
|
|
11
|
-
externals?: Partial<SystemWidgetExternals>;
|
|
12
10
|
};
|
|
13
11
|
export declare const getConfigFromFile: () => WidgetRCConfig | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type Configuration } from "webpack";
|
|
2
2
|
import type { Mode } from "../../../paths.js";
|
|
3
3
|
import type { WidgetPaths } from "../../widgetPaths.js";
|
|
4
|
-
export declare const getCommonWidgetConfig: (mode: Mode, PATHS: WidgetPaths
|
|
4
|
+
export declare const getCommonWidgetConfig: (mode: Mode, PATHS: WidgetPaths) => Configuration;
|
|
@@ -9,7 +9,7 @@ import { WIDGET_OUTPUT_FILE_NAME, WIDGET_OUTPUT_FULL_FILE_NAME, } from "../../co
|
|
|
9
9
|
const { ProgressPlugin } = webpack;
|
|
10
10
|
const isProduction = (mode) => mode === "production";
|
|
11
11
|
const isDevelopment = (mode) => mode === "development";
|
|
12
|
-
export const getCommonWidgetConfig = (mode, PATHS
|
|
12
|
+
export const getCommonWidgetConfig = (mode, PATHS) => {
|
|
13
13
|
const manifestEntry = systemRequire(PATHS.widgetManifestJsonPath).entry;
|
|
14
14
|
const filename = isProduction(mode)
|
|
15
15
|
? `${WIDGET_OUTPUT_FILE_NAME}.[contenthash].js`
|
|
@@ -34,8 +34,7 @@ export const getCommonWidgetConfig = (mode, PATHS, isCopyResources = true) => {
|
|
|
34
34
|
},
|
|
35
35
|
},
|
|
36
36
|
}),
|
|
37
|
-
|
|
38
|
-
PATHS.widgetResourcesPath &&
|
|
37
|
+
PATHS.widgetResourcesPath &&
|
|
39
38
|
PATHS.widgetResourcesDirName &&
|
|
40
39
|
new CopyWebpackPlugin({
|
|
41
40
|
patterns: [
|
|
@@ -116,9 +115,12 @@ export const getCommonWidgetConfig = (mode, PATHS, isCopyResources = true) => {
|
|
|
116
115
|
resourceQuery: /url/,
|
|
117
116
|
parser: {
|
|
118
117
|
dataUrlCondition: {
|
|
119
|
-
maxSize:
|
|
118
|
+
maxSize: 64 * 1024,
|
|
120
119
|
},
|
|
121
120
|
},
|
|
121
|
+
generator: {
|
|
122
|
+
filename: "build/static/[hash][ext][query]",
|
|
123
|
+
},
|
|
122
124
|
},
|
|
123
125
|
{
|
|
124
126
|
type: "asset/source",
|
|
@@ -3,7 +3,7 @@ import TerserWebpackPlugin from "terser-webpack-plugin";
|
|
|
3
3
|
export declare const getMinimizer: () => {
|
|
4
4
|
optimization: {
|
|
5
5
|
minimize: boolean;
|
|
6
|
-
splitChunks:
|
|
6
|
+
splitChunks: boolean;
|
|
7
7
|
minimizer: (TerserWebpackPlugin<import("terser").MinifyOptions> | CssMinimizerPlugin<CssMinimizerPlugin.CssNanoOptionsExtended>)[];
|
|
8
8
|
};
|
|
9
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const WIDGET_INDEX_TEMPLATE = "import React from \"react\";\nimport ReactDOM from \"react-dom/client\";\nimport \"./index.css\";\nimport {\n type IWidget,\n type ICustomWidgetProps,\n} from \"@infomaximum/widget-sdk\";\nimport manifest from \"../manifest.json\";\nimport { type WidgetSettings } from \"./definition/settings\";\nimport { Definition } from \"./definition/definition\";\n\nclass CustomWidget implements IWidget<WidgetSettings> {\n public static definition = new Definition();\n\n private root: ReactDOM.Root | null = null;\n\n public initialize(container: HTMLElement) {\n this.root = ReactDOM.createRoot(container);\n }\n\n public update(\n container: HTMLElement,\n props: ICustomWidgetProps<WidgetSettings>\n ) {\n this.render(props);\n }\n\n public mount(\n container: HTMLElement,\n props: ICustomWidgetProps<WidgetSettings>\n ) {\n this.render(props);\n }\n\n public unmount() {\n this.root?.unmount();\n }\n\n private render(props: ICustomWidgetProps<WidgetSettings>) {\n this.root?.render(\n <React.StrictMode>\n <div>{{ capitalize packageName}}</div>\n </React.StrictMode>\n );\n }\n}\n\nwindow.im.widget.defineWidget(manifest.uuid, CustomWidget
|
|
1
|
+
export declare const WIDGET_INDEX_TEMPLATE = "import React from \"react\";\nimport ReactDOM from \"react-dom/client\";\nimport \"./index.css\";\nimport {\n type IWidget,\n type ICustomWidgetProps,\n} from \"@infomaximum/widget-sdk\";\nimport manifest from \"../manifest.json\";\nimport { type WidgetSettings } from \"./definition/settings\";\nimport { Definition } from \"./definition/definition\";\n\nclass CustomWidget implements IWidget<WidgetSettings> {\n public static definition = new Definition();\n\n private root: ReactDOM.Root | null = null;\n\n public initialize(container: HTMLElement) {\n this.root = ReactDOM.createRoot(container);\n }\n\n public update(\n container: HTMLElement,\n props: ICustomWidgetProps<WidgetSettings>\n ) {\n this.render(props);\n }\n\n public mount(\n container: HTMLElement,\n props: ICustomWidgetProps<WidgetSettings>\n ) {\n this.render(props);\n }\n\n public unmount() {\n this.root?.unmount();\n }\n\n private render(props: ICustomWidgetProps<WidgetSettings>) {\n this.root?.render(\n <React.StrictMode>\n <div>{{ capitalize packageName}}</div>\n </React.StrictMode>\n );\n }\n}\n\nwindow.im.widget.defineWidget(manifest.uuid, CustomWidget);\n";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const WIDGET_PACKAGE_JSON_TEMPLATE = "{\n \"name\": \"template_widget\",\n \"version\": \"1.0.0\",\n \"
|
|
1
|
+
export declare const WIDGET_PACKAGE_JSON_TEMPLATE = "{\n \"name\": \"template_widget\",\n \"version\": \"1.0.0\",\n \"private\": true,\n \"main\": \"src/index.tsx\",\n \"scripts\": {\n \"build\": \"im-package-cli widget build\",\n \"build:dev\": \"im-package-cli widget build --dev\",\n \"start\": \"im-package-cli widget start\",\n \"lint\": \"tsc --noEmit && eslint src/ --ext .ts,.tsx --quiet\",\n \"test\": \"jest --passWithNoTests\",\n \"release\": \"im-package-cli widget release\",\n \"changelog\":\"im-package-cli widget release --dry-run\"\n },\n \"dependencies\": {\n \"@infomaximum/widget-sdk\": \"{{widgetSDKVersion}}\",\n \"react\": \"18.3.1\",\n \"react-dom\": \"18.3.1\"\n },\n \"devDependencies\": {\n \"@babel/core\": \"7.25.2\",\n \"@babel/preset-env\": \"7.25.4\",\n \"@babel/preset-react\": \"7.24.7\",\n \"@babel/preset-typescript\": \"7.24.7\",\n \"@infomaximum/package-cli\": \"^{{packageCliVersion}}\",\n \"@types/jest\": \"29.5.11\",\n \"@types/react\": \"18.3.4\",\n \"@types/react-dom\": \"18.3.0\",\n \"@typescript-eslint/eslint-plugin\": \"8.3.0\",\n \"@typescript-eslint/parser\": \"8.3.0\",\n \"eslint\": \"8.57.0\",\n \"eslint-plugin-react\": \"7.35.0\",\n \"eslint-plugin-react-hooks\": \"4.6.2\",\n \"jest\": \"29.7.0\",\n \"jest-canvas-mock\": \"2.5.2\",\n \"jest-environment-jsdom\": \"29.7.0\",\n \"jest-environment-jsdom-global\": \"4.0.0\",\n \"prettier\": \"3.1.1\",\n \"typescript\": \"5.5.4\"\n },\n \"browserslist\": [\n \"defaults and supports es6-module\"\n ]\n}\n";
|
|
@@ -1,24 +1,19 @@
|
|
|
1
|
-
import { CUSTOM_PACKAGE_CLI_LIB_NAME
|
|
2
|
-
import {
|
|
1
|
+
import { CUSTOM_PACKAGE_CLI_LIB_NAME } from "../../const.js";
|
|
2
|
+
import { WIDGET_SDK_LIB_NAME } from "../const.js";
|
|
3
3
|
export const WIDGET_PACKAGE_JSON_TEMPLATE = `\
|
|
4
4
|
{
|
|
5
5
|
"name": "template_widget",
|
|
6
6
|
"version": "1.0.0",
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"build",
|
|
10
|
-
"manifest.json"
|
|
11
|
-
],
|
|
7
|
+
"private": true,
|
|
8
|
+
"main": "src/index.tsx",
|
|
12
9
|
"scripts": {
|
|
13
10
|
"build": "im-package-cli widget build",
|
|
14
|
-
"build:script": "im-package-cli widget build-script",
|
|
15
11
|
"build:dev": "im-package-cli widget build --dev",
|
|
16
12
|
"start": "im-package-cli widget start",
|
|
17
13
|
"lint": "tsc --noEmit && eslint src/ --ext .ts,.tsx --quiet",
|
|
18
14
|
"test": "jest --passWithNoTests",
|
|
19
15
|
"release": "im-package-cli widget release",
|
|
20
|
-
"changelog":"im-package-cli widget release --dry-run"
|
|
21
|
-
"prepublishOnly": "npm run build:script"
|
|
16
|
+
"changelog":"im-package-cli widget release --dry-run"
|
|
22
17
|
},
|
|
23
18
|
"dependencies": {
|
|
24
19
|
"${WIDGET_SDK_LIB_NAME}": "{{widgetSDKVersion}}",
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
import { CUSTOM_PACKAGE_CLI_LIB_NAME, DEFAULT_BUILD_DIR_NAME, MANIFEST_JSON_FILE_NAME, } from "../../const.js";
|
|
2
2
|
import { WIDGET_DEFAULT_HOST, WIDGET_DEFAULT_PORT } from "../const.js";
|
|
3
3
|
export const WIDGET_RC_CONFIG = `\
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
host: "${WIDGET_DEFAULT_HOST}",
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
module.exports = config;
|
|
4
|
+
{
|
|
5
|
+
"$schema": "node_modules/${CUSTOM_PACKAGE_CLI_LIB_NAME}/schemas/widgetConfigSchema.json",
|
|
6
|
+
"entry": "src/index.tsx",
|
|
7
|
+
"widgetManifest": "${MANIFEST_JSON_FILE_NAME}",
|
|
8
|
+
"packageDir": "package",
|
|
9
|
+
"packageManifest": "package/${MANIFEST_JSON_FILE_NAME}",
|
|
10
|
+
"assetsDir": "_resources",
|
|
11
|
+
"buildDir": "${DEFAULT_BUILD_DIR_NAME}",
|
|
12
|
+
"port": ${+WIDGET_DEFAULT_PORT},
|
|
13
|
+
"host": "${WIDGET_DEFAULT_HOST}"
|
|
14
|
+
}
|
|
19
15
|
`;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { MergedBuildOptions } from "./commands/build.js";
|
|
2
2
|
import type { MergedStartOptions } from "./commands/start.js";
|
|
3
|
-
import type { MergedBuildScriptOptions } from "./commands/build_script.js";
|
|
4
3
|
export type WidgetPaths = ReturnType<typeof generateWidgetPaths>;
|
|
5
|
-
type Options = MergedBuildOptions | MergedStartOptions
|
|
4
|
+
type Options = MergedBuildOptions | MergedStartOptions;
|
|
6
5
|
export declare function generateWidgetPaths({ entry, assetsDir, widgetManifest, buildDir, }: Options): {
|
|
7
6
|
moduleIndex: string;
|
|
8
7
|
widgetManifestJsonPath: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infomaximum/package-cli",
|
|
3
|
-
"version": "2.24.0
|
|
3
|
+
"version": "2.24.0",
|
|
4
4
|
"exports": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -18,11 +18,9 @@
|
|
|
18
18
|
"dev": "tsc",
|
|
19
19
|
"dev:w": "npm run dev -- -w",
|
|
20
20
|
"build": "rimraf dist && npm run dev",
|
|
21
|
-
"release": "tsc --noEmit && standard-version",
|
|
22
|
-
"release:rc": "standard-version -p",
|
|
21
|
+
"release": "tsc --noEmit && standard-version && npm run build",
|
|
23
22
|
"lint": "tsc --noEmit",
|
|
24
|
-
"prettier": "prettier --find-config-path --write 'lib/**/*'"
|
|
25
|
-
"prepublishOnly": "npm run lint && npm run build"
|
|
23
|
+
"prettier": "prettier --find-config-path --write 'lib/**/*'"
|
|
26
24
|
},
|
|
27
25
|
"dependencies": {
|
|
28
26
|
"@babel/core": "^7.23.6",
|
|
@@ -73,7 +71,6 @@
|
|
|
73
71
|
},
|
|
74
72
|
"devDependencies": {
|
|
75
73
|
"@infomaximum/integration-sdk": "^2.3.0",
|
|
76
|
-
"@infomaximum/widget-sdk": "5.26.0-0",
|
|
77
74
|
"@types/babel__core": "^7.20.5",
|
|
78
75
|
"@types/fs-extra": "^11.0.4",
|
|
79
76
|
"@types/node": "^20.9.0",
|
|
@@ -39,11 +39,6 @@
|
|
|
39
39
|
"host": {
|
|
40
40
|
"type": "string",
|
|
41
41
|
"description": "хост по которому будет доступен сервер разработки"
|
|
42
|
-
},
|
|
43
|
-
"externals": {
|
|
44
|
-
"type": "object",
|
|
45
|
-
"additionalProperties": true,
|
|
46
|
-
"description": "исключает указанные зависимости из сборки, предполагая их наличие в окружении. Используется для уменьшения размера бандла. Актуально только при сборке скрипта. (https://webpack.js.org/configuration/externals/)"
|
|
47
42
|
}
|
|
48
43
|
},
|
|
49
44
|
"required": [
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Command } from "commander";
|
|
2
|
-
import { configMergeWithOptionsCommon, type InputCommonOptions } from "./common.js";
|
|
3
|
-
export type InputBuildScriptOptions = {
|
|
4
|
-
buildDir?: string;
|
|
5
|
-
} & InputCommonOptions;
|
|
6
|
-
export type MergedBuildScriptOptions = ReturnType<typeof configMergeWithOptionsCommon>;
|
|
7
|
-
export declare const registerWidgetBuildScriptCommand: (widgetCommand: Command) => void;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { getConfigFromFile } from "../configs/file.js";
|
|
2
|
-
import { configMergeWithOptionsCommon, registerCommonOption, } from "./common.js";
|
|
3
|
-
import { runBuildScript } from "../scripts/build_script.js";
|
|
4
|
-
export const registerWidgetBuildScriptCommand = (widgetCommand) => {
|
|
5
|
-
const widgetBuildScriptCommand = widgetCommand.command("build-script");
|
|
6
|
-
const config = getConfigFromFile();
|
|
7
|
-
registerCommonOption(widgetBuildScriptCommand);
|
|
8
|
-
widgetBuildScriptCommand
|
|
9
|
-
.description("Выполняет сборку js файла виджета для публикации")
|
|
10
|
-
.option("--build-dir <buildDirPath>", "путь до директории в которую будет собран пакет")
|
|
11
|
-
.action((options) => runBuildScript(configMergeWithOptionsCommon(config, options), config));
|
|
12
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { __awaiter } from "tslib";
|
|
2
|
-
import {} from "webpack";
|
|
3
|
-
import {} from "../../paths.js";
|
|
4
|
-
import { merge } from "webpack-merge";
|
|
5
|
-
import chalk from "chalk";
|
|
6
|
-
import { getCommonWidgetConfig } from "../configs/webpack/common.js";
|
|
7
|
-
import { getMinimizer } from "../configs/webpack/sections/plugins/minimizer.js";
|
|
8
|
-
import { generateWidgetPaths } from "../widgetPaths.js";
|
|
9
|
-
import { runWebpackBuild } from "../../utils.js";
|
|
10
|
-
import { WIDGET_OUTPUT_FULL_FILE_NAME } from "../const.js";
|
|
11
|
-
export const runBuildScript = (args, config) => __awaiter(void 0, void 0, void 0, function* () {
|
|
12
|
-
var _a;
|
|
13
|
-
const mode = "production";
|
|
14
|
-
const WIDGET_PATHS = generateWidgetPaths(args);
|
|
15
|
-
const sections = {
|
|
16
|
-
entry: WIDGET_PATHS.moduleIndex,
|
|
17
|
-
output: {
|
|
18
|
-
filename: WIDGET_OUTPUT_FULL_FILE_NAME,
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
const configSections = [
|
|
22
|
-
getCommonWidgetConfig(mode, WIDGET_PATHS, false),
|
|
23
|
-
{
|
|
24
|
-
externals: (_a = config === null || config === void 0 ? void 0 : config.externals) !== null && _a !== void 0 ? _a : {},
|
|
25
|
-
externalsType: "window",
|
|
26
|
-
},
|
|
27
|
-
sections,
|
|
28
|
-
getMinimizer(),
|
|
29
|
-
];
|
|
30
|
-
const widgetConfig = merge(configSections);
|
|
31
|
-
try {
|
|
32
|
-
yield runWebpackBuild(widgetConfig);
|
|
33
|
-
}
|
|
34
|
-
catch (error) {
|
|
35
|
-
console.error(chalk.red("\nFailed to compile.\n"));
|
|
36
|
-
console.error(chalk.red(error));
|
|
37
|
-
process.exit(1);
|
|
38
|
-
}
|
|
39
|
-
});
|