@infomaximum/package-cli 2.22.0-1 → 2.22.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 +11 -0
- package/dist/arguments.js +1 -2
- package/dist/integration/scripts/init.js +3 -6
- package/dist/integration/templates/integrationConfigs.d.ts +2 -2
- package/dist/integration/templates/integrationConfigs.js +7 -1
- package/dist/integration/templates/integrationIndex.d.ts +1 -1
- package/dist/integration/templates/integrationIndex.js +0 -3
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +1 -0
- package/dist/widget/scripts/init/actions.js +4 -6
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
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.22.0](https://github.com/Infomaximum/package-cli/compare/v2.22.0-2...v2.22.0) (2025-03-28)
|
|
6
|
+
|
|
7
|
+
## [2.22.0-2](https://github.com/Infomaximum/package-cli/compare/v2.22.0-1...v2.22.0-2) (2025-03-28)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* инициализация package-cli с той версией которая и создаёт проект ([fed9d2b](https://github.com/Infomaximum/package-cli/commit/fed9d2bfcc6e3ab66a647e44804b3069aae0511f))
|
|
13
|
+
* используемые библиотеки с типами ([9da35be](https://github.com/Infomaximum/package-cli/commit/9da35be63b0f8e8eb7554585df85f4c7e04131b9))
|
|
14
|
+
* template ([a1cb787](https://github.com/Infomaximum/package-cli/commit/a1cb787b43505e8d922f6b625873d9ab6cf983a9))
|
|
15
|
+
|
|
5
16
|
## [2.22.0-1](https://github.com/Infomaximum/package-cli/compare/v2.22.0-0...v2.22.0-1) (2025-03-27)
|
|
6
17
|
|
|
7
18
|
|
package/dist/arguments.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { packageJson } from "./utils.js";
|
|
2
2
|
import { registerWidgetCommands } from "./widget/index.js";
|
|
3
3
|
import { registerIntegrationCommands } from "./integration/index.js";
|
|
4
|
-
const packageJson = systemRequire("../package.json");
|
|
5
4
|
export const registerCommands = (cli) => {
|
|
6
5
|
cli.helpOption("-h", "отображает помощь по командам");
|
|
7
6
|
cli.name("im-package-cli");
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { __awaiter } from "tslib";
|
|
2
|
-
import { CUSTOM_PACKAGE_CLI_LIB_NAME } from "../../const.js";
|
|
3
2
|
import { INTEGRATION_BABEL_CONFIG, INTEGRATION_ENV_EXAMPLE_CONFIG, INTEGRATION_ESLINTRC, INTEGRATION_GITIGNORE, INTEGRATION_RC_CONFIG, INTEGRATION_TSCONFIG_JSON, INTEGRATION_VITEST_CONFIG, INTEGRATION_VSCODE_EXTENSIONS, INTEGRATION_VSCODE_LAUNCH, INTEGRATION_VSCODE_SETTINGS, } from "../templates/integrationConfigs.js";
|
|
4
3
|
import { getPackageActions } from "../../package/scripts/actions.js";
|
|
5
4
|
import { INTEGRATION_INDEX_TEMPLATE } from "../templates/integrationIndex.js";
|
|
6
5
|
import { INTEGRATION_PACKAGE_JSON_TEMPLATE } from "../templates/integrationPackageJson.js";
|
|
7
|
-
import { getLatestVersionOfLibrary } from "../../utils.js";
|
|
6
|
+
import { getLatestVersionOfLibrary, packageJson } from "../../utils.js";
|
|
8
7
|
import { INTEGRATION_CONFIG_RC_FILE_NAME, INTEGRATION_CONFIG_RC_EXT, INTEGRATION_SDK_LIB_NAME, } from "../const.js";
|
|
9
8
|
const actions = ({ packageCliVersion, integrationSdkVersion }) => {
|
|
10
9
|
return [
|
|
@@ -73,11 +72,9 @@ const actions = ({ packageCliVersion, integrationSdkVersion }) => {
|
|
|
73
72
|
];
|
|
74
73
|
};
|
|
75
74
|
const getInitIntegrationActions = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
76
|
-
const [
|
|
77
|
-
getLatestVersionOfLibrary(CUSTOM_PACKAGE_CLI_LIB_NAME),
|
|
75
|
+
const [integrationSdkVersion] = yield Promise.all([
|
|
78
76
|
getLatestVersionOfLibrary(INTEGRATION_SDK_LIB_NAME),
|
|
79
77
|
]);
|
|
80
|
-
return (data) => actions(Object.assign(Object.assign({}, data), { packageCliVersion,
|
|
81
|
-
integrationSdkVersion }));
|
|
78
|
+
return (data) => actions(Object.assign(Object.assign({}, data), { packageCliVersion: packageJson.version, integrationSdkVersion }));
|
|
82
79
|
});
|
|
83
80
|
export { getInitIntegrationActions };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const INTEGRATION_TSCONFIG_JSON = "{\n \"compilerOptions\": {\n \"target\": \"ES2015\",\n \"module\": \"Preserve\",\n \"esModuleInterop\": true,\n \"forceConsistentCasingInFileNames\": true,\n \"strict\": true,\n \"skipLibCheck\": true,\n \"isolatedModules\": false\n },\n \"include\": [\"src\"]\n}\n";
|
|
1
|
+
export declare const INTEGRATION_TSCONFIG_JSON = "{\n \"compilerOptions\": {\n \"target\": \"ES2015\",\n \"lib\": [\"ES2015\"],\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
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.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
4
|
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,5 +6,5 @@ export declare const INTEGRATION_VITEST_CONFIG = "import { defineConfig } from '
|
|
|
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 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\n";
|
|
8
8
|
export declare const INTEGRATION_VSCODE_LAUNCH = "{\n \"version\": \"0.2.0\",\n \"configurations\": [\n {\n \"type\": \"node\",\n \"request\": \"launch\",\n \"name\": \"Debug Integration\",\n \"skipFiles\": [\"<node_internals>/**\"],\n\n \"runtimeExecutable\": \"tsx\",\n \"runtimeArgs\": [\"--preserve-symlinks\"],\n \"args\": [\n \"${workspaceFolder}/node_modules/@infomaximum/package-cli/dist/index.js\",\n \"integration\",\n \"debug\"\n ],\n \"sourceMaps\": true,\n \"resolveSourceMapLocations\": [\n \"${workspaceFolder}/**\",\n \"!**/node_modules/**\"\n ],\n \"smartStep\": true,\n \"internalConsoleOptions\": \"openOnSessionStart\"\n }\n ]\n}\n";
|
|
9
|
-
export declare const INTEGRATION_VSCODE_SETTINGS = "{\n \"typescript.tsdk\": \"node_modules/typescript/lib\",\n \"integration-debugger.isEnabled\": true,\n \"integration-debugger.debugConfigurationName\": \"Debug Integration\",\n \"integration-debugger.functionNames\": [\"executePagination\"]\n}\n";
|
|
9
|
+
export declare const INTEGRATION_VSCODE_SETTINGS = "{\n \"typescript.tsdk\": \"node_modules/typescript/lib\",\n \"integration-debugger.isEnabled\": true,\n \"integration-debugger.debugConfigurationName\": \"Debug Integration\",\n \"integration-debugger.functionNames\": {\n \"single\": [\"executePagination\", \"execute\"],\n \"series\": [\"executePagination\"]\n }\n}\n";
|
|
10
10
|
export declare const INTEGRATION_VSCODE_EXTENSIONS = "{\n \"recommendations\": [\"Jokerok.integration-debugger\"]\n}\n";
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { CUSTOM_PACKAGE_CLI_LIB_NAME } from "../../const.js";
|
|
2
|
+
import { INTEGRATION_SDK_LIB_NAME } from "../const.js";
|
|
2
3
|
export const INTEGRATION_TSCONFIG_JSON = `\
|
|
3
4
|
{
|
|
4
5
|
"compilerOptions": {
|
|
5
6
|
"target": "ES2015",
|
|
7
|
+
"lib": ["ES2015"],
|
|
8
|
+
"types": ["${INTEGRATION_SDK_LIB_NAME}"],
|
|
6
9
|
"module": "Preserve",
|
|
7
10
|
"esModuleInterop": true,
|
|
8
11
|
"forceConsistentCasingInFileNames": true,
|
|
@@ -167,7 +170,10 @@ export const INTEGRATION_VSCODE_SETTINGS = `\
|
|
|
167
170
|
"typescript.tsdk": "node_modules/typescript/lib",
|
|
168
171
|
"integration-debugger.isEnabled": true,
|
|
169
172
|
"integration-debugger.debugConfigurationName": "Debug Integration",
|
|
170
|
-
"integration-debugger.functionNames":
|
|
173
|
+
"integration-debugger.functionNames": {
|
|
174
|
+
"single": ["executePagination", "execute"],
|
|
175
|
+
"series": ["executePagination"]
|
|
176
|
+
}
|
|
171
177
|
}
|
|
172
178
|
`;
|
|
173
179
|
export const INTEGRATION_VSCODE_EXTENSIONS = `\
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const INTEGRATION_INDEX_TEMPLATE = "
|
|
1
|
+
export declare const INTEGRATION_INDEX_TEMPLATE = "integration = {\n schema: 1,\n meta: {\n key: \"integrationKey\",\n name: \"\",\n description: \"\",\n },\n blocks: [],\n connections: [],\n};\n";
|
package/dist/utils.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ type Dependency = {
|
|
|
6
6
|
version: string;
|
|
7
7
|
};
|
|
8
8
|
export declare const systemRequire: NodeRequire;
|
|
9
|
+
export declare const packageJson: any;
|
|
9
10
|
export declare function capitalizeFirstLetter(str?: string): string;
|
|
10
11
|
export declare function safeWriteFile(pathToFile: string, contents: any, options: WriteFileOptions): Promise<void>;
|
|
11
12
|
export declare function getLatestVersionOfLibrary(libraryName: string): Promise<string>;
|
package/dist/utils.js
CHANGED
|
@@ -17,6 +17,7 @@ export const isExist = (entityPath) => __awaiter(void 0, void 0, void 0, functio
|
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
export const systemRequire = Module.createRequire(import.meta.url);
|
|
20
|
+
export const packageJson = systemRequire("../package.json");
|
|
20
21
|
export function capitalizeFirstLetter(str = "") {
|
|
21
22
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
22
23
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __awaiter } from "tslib";
|
|
2
|
-
import { getLatestVersionOfLibrary } from "../../../utils.js";
|
|
2
|
+
import { getLatestVersionOfLibrary, packageJson } from "../../../utils.js";
|
|
3
3
|
import { PACKAGE_MANIFEST_TEMPLATE } from "../../../package/templates/packageManifest.js";
|
|
4
4
|
import { PACKAGE_ICON_TEMPLATE } from "../../../package/templates/packageIcon.js";
|
|
5
|
-
import {
|
|
5
|
+
import { MANIFEST_JSON_FILE_NAME } from "../../../const.js";
|
|
6
6
|
import { GET_CHANGELOG_MD, GET_DOC_MD, } from "../../../package/templates/additionalFiles.js";
|
|
7
7
|
import { WIDGET_MANIFEST_TEMPLATE } from "../../templates/widgetManifest.js";
|
|
8
8
|
import { WIDGET_INDEX_TEMPLATE } from "../../templates/src/widgetIndex.js";
|
|
@@ -123,11 +123,9 @@ const actions = ({ widgetSDKVersion, packageCliVersion }) => {
|
|
|
123
123
|
];
|
|
124
124
|
};
|
|
125
125
|
const getInitWidgetActions = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
126
|
-
const [
|
|
127
|
-
getLatestVersionOfLibrary(CUSTOM_PACKAGE_CLI_LIB_NAME),
|
|
126
|
+
const [widgetSDKVersion] = yield Promise.all([
|
|
128
127
|
getLatestVersionOfLibrary(WIDGET_SDK_LIB_NAME),
|
|
129
128
|
]);
|
|
130
|
-
return (data) => actions(Object.assign(Object.assign({}, data), { packageCliVersion
|
|
131
|
-
widgetSDKVersion }));
|
|
129
|
+
return (data) => actions(Object.assign(Object.assign({}, data), { widgetSDKVersion, packageCliVersion: packageJson.version }));
|
|
132
130
|
});
|
|
133
131
|
export { getInitWidgetActions };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infomaximum/package-cli",
|
|
3
|
-
"version": "2.22.0
|
|
3
|
+
"version": "2.22.0",
|
|
4
4
|
"exports": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@babel/core": "^7.23.6",
|
|
27
27
|
"@babel/plugin-transform-runtime": "^7.23.6",
|
|
28
28
|
"@infomaximum/assert": "^1.1.3",
|
|
29
|
-
"@infomaximum/integration-debugger": "^1.5.
|
|
29
|
+
"@infomaximum/integration-debugger": "^1.5.1",
|
|
30
30
|
"@infomaximum/json-modify-webpack-plugin": "^1.1.0",
|
|
31
31
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.11",
|
|
32
32
|
"@saneksa/babel-plugin-function-transform": "^1.0.0",
|