@infomaximum/package-cli 2.17.2 → 2.19.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 +14 -0
- package/dist/integration/configs/webpack/common.js +16 -6
- package/dist/integration/scripts/actions.js +1 -11
- package/dist/integration/templates/integrationConfigs.d.ts +2 -4
- package/dist/integration/templates/integrationConfigs.js +3 -20
- package/dist/integration/templates/integrationPackageJson.d.ts +1 -1
- package/dist/integration/templates/integrationPackageJson.js +0 -3
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
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.19.0](https://github.com/Infomaximum/package-cli/compare/v2.18.0...v2.19.0) (2025-03-08)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* использован ts-loader вместо babel-loader ([98a8a47](https://github.com/Infomaximum/package-cli/commit/98a8a4716fcea8e44b5440bcb53c3903367f7ea0))
|
|
11
|
+
|
|
12
|
+
## [2.18.0](https://github.com/Infomaximum/package-cli/compare/v2.17.2...v2.18.0) (2025-03-08)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* id интеграции перенесен в переменную окружения ([fbfe5c8](https://github.com/Infomaximum/package-cli/commit/fbfe5c82e702c13241be8499bdf6b8b323ce099f))
|
|
18
|
+
|
|
5
19
|
### [2.17.2](https://github.com/Infomaximum/package-cli/compare/v2.17.1...v2.17.2) (2025-03-07)
|
|
6
20
|
|
|
7
21
|
### [2.17.1](https://github.com/Infomaximum/package-cli/compare/v2.17.0...v2.17.1) (2025-03-07)
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import TerserPlugin from "terser-webpack-plugin";
|
|
2
2
|
import { systemRequire } from "../../../utils.js";
|
|
3
|
+
import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin";
|
|
3
4
|
export const getCommonIntegrationConfig = (mode, PATHS) => {
|
|
4
5
|
return {
|
|
5
6
|
mode,
|
|
6
|
-
target: "
|
|
7
|
+
target: "es5",
|
|
7
8
|
entry: PATHS.moduleIndex,
|
|
8
9
|
output: {
|
|
9
10
|
filename: PATHS.outputFile,
|
|
@@ -24,16 +25,25 @@ export const getCommonIntegrationConfig = (mode, PATHS) => {
|
|
|
24
25
|
{
|
|
25
26
|
test: /\.(js|ts|jsx|tsx)$/i,
|
|
26
27
|
exclude: ["/node_modules/"],
|
|
27
|
-
loader: systemRequire.resolve("
|
|
28
|
+
loader: systemRequire.resolve("ts-loader"),
|
|
28
29
|
options: {
|
|
29
|
-
|
|
30
|
-
systemRequire.resolve("babel-plugin-inline-json-import"),
|
|
31
|
-
systemRequire.resolve("@babel/plugin-transform-runtime"),
|
|
32
|
-
].filter(Boolean),
|
|
30
|
+
transpileOnly: true,
|
|
33
31
|
},
|
|
34
32
|
},
|
|
35
33
|
],
|
|
36
34
|
},
|
|
35
|
+
plugins: [
|
|
36
|
+
new ForkTsCheckerWebpackPlugin({
|
|
37
|
+
async: true,
|
|
38
|
+
typescript: {
|
|
39
|
+
memoryLimit: 2048,
|
|
40
|
+
diagnosticOptions: {
|
|
41
|
+
semantic: true,
|
|
42
|
+
syntactic: true,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
}),
|
|
46
|
+
],
|
|
37
47
|
optimization: {
|
|
38
48
|
minimize: true,
|
|
39
49
|
concatenateModules: true,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __awaiter } from "tslib";
|
|
2
2
|
import { CUSTOM_PACKAGE_CLI_LIB_NAME } from "../../const.js";
|
|
3
|
-
import {
|
|
3
|
+
import { INTEGRATION_ENV_EXAMPLE_CONFIG, INTEGRATION_ESLINTRC, INTEGRATION_GITIGNORE, INTEGRATION_RC_CONFIG, INTEGRATION_TSCONFIG_JSON, INTEGRATION_VITEST_CONFIG, } from "../templates/integrationConfigs.js";
|
|
4
4
|
import { getPackageActions } from "../../package/scripts/actions.js";
|
|
5
5
|
import { INTEGRATION_INDEX_TEMPLATE } from "../templates/integrationIndex.js";
|
|
6
6
|
import { INTEGRATION_PACKAGE_JSON_TEMPLATE } from "../templates/integrationPackageJson.js";
|
|
@@ -19,16 +19,6 @@ const actions = ({ packageCliVersion, integrationSdkVersion }) => {
|
|
|
19
19
|
path: "tsconfig.json",
|
|
20
20
|
template: INTEGRATION_TSCONFIG_JSON,
|
|
21
21
|
},
|
|
22
|
-
{
|
|
23
|
-
type: "add",
|
|
24
|
-
path: "babel.config.js",
|
|
25
|
-
template: INTEGRATION_BABEL_CONFIG,
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
type: "add",
|
|
29
|
-
path: ".browserslistrc",
|
|
30
|
-
template: INTEGRATION_BROWSERLIST_CONFIG,
|
|
31
|
-
},
|
|
32
22
|
{
|
|
33
23
|
type: "add",
|
|
34
24
|
path: ".gitignore",
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
export declare const INTEGRATION_TSCONFIG_JSON = "{\n \"compilerOptions\": {\n \"target\": \"ES5\",\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_BABEL_CONFIG = "module.exports = {\n sourceType: \"unambiguous\",\n presets: [\n [\n \"@babel/preset-env\",\n {\n useBuiltIns: \"usage\",\n corejs: \"3.41\",\n },\n ],\n \"@babel/preset-typescript\",\n ],\n};\n";
|
|
3
|
-
export declare const INTEGRATION_BROWSERLIST_CONFIG = "node >=14\n";
|
|
4
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# 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";
|
|
5
3
|
export declare const INTEGRATION_ESLINTRC = "import js from \"@eslint/js\";\nimport globals from \"globals\";\nimport tseslint from \"typescript-eslint\";\n\nexport default tseslint.config(\n { ignores: [\"dist\", \"build\"] },\n {\n extends: [js.configs.recommended, ...tseslint.configs.recommended],\n files: [\"**/*.{ts,tsx}\"],\n languageOptions: {\n ecmaVersion: 2020,\n globals: globals.browser,\n },\n plugins: {},\n rules: {},\n }\n);\n";
|
|
6
4
|
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";
|
|
7
|
-
export declare const INTEGRATION_RC_CONFIG = "require(\"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 */\nmodule.exports = {\n fetcher: (integrationCode) => {\n return {\n graphqlUrl: process.env.GRAPHQL_URL,\n apiKey: process.env.API_KEY,\n query,\n variables: {\n id:
|
|
8
|
-
export declare const INTEGRATION_ENV_EXAMPLE_CONFIG = "
|
|
5
|
+
export declare const INTEGRATION_RC_CONFIG = "require(\"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 */\nmodule.exports = {\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";
|
|
6
|
+
export declare const INTEGRATION_ENV_EXAMPLE_CONFIG = "INTEGRATION_ID=0\nGRAPHQL_URL=https://example.com/graphql\nAPI_KEY=123456789qwertyuiop\n";
|
|
@@ -12,24 +12,6 @@ export const INTEGRATION_TSCONFIG_JSON = `\
|
|
|
12
12
|
"include": ["src"]
|
|
13
13
|
}
|
|
14
14
|
`;
|
|
15
|
-
export const INTEGRATION_BABEL_CONFIG = `\
|
|
16
|
-
module.exports = {
|
|
17
|
-
sourceType: "unambiguous",
|
|
18
|
-
presets: [
|
|
19
|
-
[
|
|
20
|
-
"@babel/preset-env",
|
|
21
|
-
{
|
|
22
|
-
useBuiltIns: "usage",
|
|
23
|
-
corejs: "3.41",
|
|
24
|
-
},
|
|
25
|
-
],
|
|
26
|
-
"@babel/preset-typescript",
|
|
27
|
-
],
|
|
28
|
-
};
|
|
29
|
-
`;
|
|
30
|
-
export const INTEGRATION_BROWSERLIST_CONFIG = `\
|
|
31
|
-
node >=14
|
|
32
|
-
`;
|
|
33
15
|
export const INTEGRATION_GITIGNORE = `\
|
|
34
16
|
# dependencies
|
|
35
17
|
/node_modules
|
|
@@ -119,7 +101,7 @@ module.exports = {
|
|
|
119
101
|
apiKey: process.env.API_KEY,
|
|
120
102
|
query,
|
|
121
103
|
variables: {
|
|
122
|
-
id:
|
|
104
|
+
id: process.env.INTEGRATION_ID,
|
|
123
105
|
js_code: integrationCode,
|
|
124
106
|
},
|
|
125
107
|
};
|
|
@@ -127,6 +109,7 @@ module.exports = {
|
|
|
127
109
|
};
|
|
128
110
|
`;
|
|
129
111
|
export const INTEGRATION_ENV_EXAMPLE_CONFIG = `\
|
|
130
|
-
|
|
112
|
+
INTEGRATION_ID=0
|
|
131
113
|
GRAPHQL_URL=https://example.com/graphql
|
|
114
|
+
API_KEY=123456789qwertyuiop
|
|
132
115
|
`;
|
|
@@ -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\",\n \"dev\": \"im-package-cli integration build --watch\",\n \"serve\": \"im-package-cli integration build --watch --fetchToServer\",\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 },\n \"devDependencies\": {\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\",\n \"dev\": \"im-package-cli integration build --watch\",\n \"serve\": \"im-package-cli integration build --watch --fetchToServer\",\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 },\n \"devDependencies\": {\n \"@eslint/js\": \"^9.19.0\",\n \"@infomaximum/integration-sdk\": \"^{{integrationSdkVersion}}\",\n \"@infomaximum/package-cli\": \"^{{packageCliVersion}}\",\n \"@types/node\": \"^0\",\n \"core-js\": \"^3.41.0\",\n \"dotenv\": \"^16.4.7\",\n \"eslint\": \"^9.19.0\",\n \"globals\": \"^15.14.0\",\n \"typescript\": \"^5.7.2\",\n \"typescript-eslint\": \"^8.22.0\",\n \"vitest\": \"^3.0.4\",\n \"@vitest/coverage-v8\": \"3.0.7\",\n \"@vitest/ui\": \"3.0.7\"\n }\n}\n";
|
|
@@ -16,9 +16,6 @@ export const INTEGRATION_PACKAGE_JSON_TEMPLATE = `\
|
|
|
16
16
|
"test:ui": "vitest --ui"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@babel/core": "^7.26.9",
|
|
20
|
-
"@babel/preset-env": "^7.26.9",
|
|
21
|
-
"@babel/preset-typescript": "^7.26.0",
|
|
22
19
|
"@eslint/js": "^9.19.0",
|
|
23
20
|
"${INTEGRATION_SDK_LIB_NAME}": "^{{integrationSdkVersion}}",
|
|
24
21
|
"${CUSTOM_PACKAGE_CLI_LIB_NAME}": "^{{packageCliVersion}}",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infomaximum/package-cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.19.0",
|
|
4
4
|
"exports": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -61,6 +61,7 @@
|
|
|
61
61
|
"stringify-package": "^1.0.1",
|
|
62
62
|
"style-loader": "^3.3.3",
|
|
63
63
|
"terser-webpack-plugin": "^5.3.9",
|
|
64
|
+
"ts-loader": "^9.5.2",
|
|
64
65
|
"tsconfig-paths-webpack-plugin": "^4.1.0",
|
|
65
66
|
"webpack": "^5.94.0",
|
|
66
67
|
"webpack-dev-server": "^4.15.1",
|