@infomaximum/package-cli 1.18.0-rc2 → 1.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 CHANGED
@@ -2,6 +2,13 @@
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
+ ## [1.18.0](https://github.com/Infomaximum/package-cli/compare/v1.17.0...v1.18.0) (2024-02-21)
6
+
7
+
8
+ ### Features
9
+
10
+ * переименована библиотека @infomaximum/custom-widget -> @infomaximum/widget-sdk ([d86378c](https://github.com/Infomaximum/package-cli/commit/d86378c0ad2aff4c8d9b03099b3be30c19d0b9a1))
11
+
5
12
  ## [1.17.0](https://github.com/Infomaximum/package-cli/compare/v1.16.1...v1.17.0) (2024-02-16)
6
13
 
7
14
 
@@ -3,7 +3,7 @@ import { TsconfigPathsPlugin } from "tsconfig-paths-webpack-plugin";
3
3
  import CopyWebpackPlugin from "copy-webpack-plugin";
4
4
  import webpack, {} from "webpack";
5
5
  import { systemRequire } from "../../utils.js";
6
- import { WIDGET_RESOURCES_PATH_NAME, MANIFEST_REG_EXP } from "../../const.js";
6
+ import { WIDGET_RESOURCES_DIR_NAME, MANIFEST_REG_EXP } from "../../const.js";
7
7
  import { cssLoaders } from "./sections/loaders/cssLoaders.js";
8
8
  const { ProgressPlugin } = webpack;
9
9
  const isProduction = (mode) => mode === "production";
@@ -34,7 +34,7 @@ export const getCommonWidgetConfig = (mode, PATHS) => {
34
34
  {
35
35
  from: PATHS.resourcesWidget,
36
36
  toType: "dir",
37
- to: WIDGET_RESOURCES_PATH_NAME,
37
+ to: WIDGET_RESOURCES_DIR_NAME,
38
38
  noErrorOnMissing: true,
39
39
  },
40
40
  ],
@@ -1,11 +1,11 @@
1
1
  import ZipPlugin from "zip-webpack-plugin";
2
- import { BUILD_ARCHIVE_EXT, MANIFEST_JSON_FILE_NAME, WIDGET_ARCHIVE_NAME, WIDGET_RESOURCES_PATH_NAME, } from "../../../../const.js";
2
+ import { BUILD_ARCHIVE_EXT, MANIFEST_JSON_FILE_NAME, WIDGET_ARCHIVE_NAME, WIDGET_RESOURCES_DIR_NAME, } from "../../../../const.js";
3
3
  export const getZipWidgetPlugin = (isOnlyManifest) => {
4
4
  return new ZipPlugin({
5
5
  filename: WIDGET_ARCHIVE_NAME,
6
6
  extension: BUILD_ARCHIVE_EXT,
7
7
  include: isOnlyManifest
8
- ? [MANIFEST_JSON_FILE_NAME, WIDGET_RESOURCES_PATH_NAME]
8
+ ? [MANIFEST_JSON_FILE_NAME, WIDGET_RESOURCES_DIR_NAME]
9
9
  : undefined,
10
10
  });
11
11
  };
package/dist/const.js CHANGED
@@ -1,4 +1,4 @@
1
- export const CUSTOM_WIDGET_LIB_NAME = "@infomaximum/custom-widget";
1
+ export const WIDGET_SDK_LIB_NAME = "@infomaximum/widget-sdk";
2
2
  export const CUSTOM_PACKAGE_CLI_LIB_NAME = "@infomaximum/package-cli";
3
3
  export const WIDGET_ARCHIVE_NAME = "widget";
4
4
  export const BUILD_ARCHIVE_EXT = "zip";
@@ -8,4 +8,4 @@ export const DEFAULT_PORT = "5555";
8
8
  export const MANIFEST_JSON_FILE_NAME = "manifest.json";
9
9
  export const MANIFEST_REG_EXP = new RegExp(`${MANIFEST_JSON_FILE_NAME}$`, "i");
10
10
  export const DEV_POSTFIX = "__DEV";
11
- export const WIDGET_RESOURCES_PATH_NAME = "_resources";
11
+ export const WIDGET_RESOURCES_DIR_NAME = "_resources";
package/dist/paths.js CHANGED
@@ -2,7 +2,7 @@ import fs from "node:fs";
2
2
  import path from "node:path";
3
3
  import { systemRequire } from "./utils.js";
4
4
  import chalk from "chalk";
5
- import { MANIFEST_JSON_FILE_NAME, WIDGET_RESOURCES_PATH_NAME, } from "./const.js";
5
+ import { MANIFEST_JSON_FILE_NAME, WIDGET_RESOURCES_DIR_NAME } from "./const.js";
6
6
  const appDirectory = fs.realpathSync(process.cwd());
7
7
  const _resolveApp = (cwd = appDirectory) => (relativePath) => path.resolve(cwd, relativePath);
8
8
  const moduleFileExtensions = [
@@ -34,7 +34,7 @@ export const generatePaths = (args) => {
34
34
  return {
35
35
  appPath: resolveApp("."),
36
36
  appBuild: resolveApp("build"),
37
- resourcesWidget: resolveApp(WIDGET_RESOURCES_PATH_NAME),
37
+ resourcesWidget: resolveApp(WIDGET_RESOURCES_DIR_NAME),
38
38
  get moduleIndex() {
39
39
  return generateIndexPath(cwd, entryPath);
40
40
  },
@@ -9,7 +9,7 @@ import { WIDGET_INDEX_TEMPLATE } from "../../../templates/widget/src/widgetIndex
9
9
  import { APP_D_TS_TEMPLATE } from "../../../templates/widget/src/widgetAppDTs.js";
10
10
  import { WIDGET_INDEX_CSS_TEMPLATE } from "../../../templates/widget/src/widgetIndexCSS.js";
11
11
  import { WIDGET_PACKAGE_JSON_TEMPLATE } from "../../../templates/widget/widgetPackageJson.js";
12
- import { CUSTOM_PACKAGE_CLI_LIB_NAME, CUSTOM_WIDGET_LIB_NAME, MANIFEST_JSON_FILE_NAME, } from "../../../const.js";
12
+ import { CUSTOM_PACKAGE_CLI_LIB_NAME, WIDGET_SDK_LIB_NAME, MANIFEST_JSON_FILE_NAME, } from "../../../const.js";
13
13
  import { WIDGET_SETTINGS_TEMPLATE } from "../../../templates/widget/src/definition/settings.js";
14
14
  import { WIDGET_PANEL_TEMPLATE } from "../../../templates/widget/src/definition/panel.js";
15
15
  import { GET_CHANGELOG_MD, GET_DOC_MD, } from "../../../templates/package/additionalFiles.js";
@@ -30,7 +30,7 @@ const addInitActions = (basePath, plop) => {
30
30
  });
31
31
  });
32
32
  };
33
- const actions = ({ customWidgetVersion, packageCliVersion }) => {
33
+ const actions = ({ widgetSDKVersion, packageCliVersion }) => {
34
34
  const packageIconName = "Widget";
35
35
  return [
36
36
  {
@@ -128,17 +128,17 @@ const actions = ({ customWidgetVersion, packageCliVersion }) => {
128
128
  type: "add",
129
129
  path: "package.json",
130
130
  template: WIDGET_PACKAGE_JSON_TEMPLATE,
131
- data: { customWidgetVersion, packageCliVersion },
131
+ data: { widgetSDKVersion, packageCliVersion },
132
132
  },
133
133
  ];
134
134
  };
135
135
  const getInitWidgetActions = (basePath, plop) => __awaiter(void 0, void 0, void 0, function* () {
136
136
  addInitActions(basePath, plop);
137
- const [packageCliVersion, customWidgetVersion] = yield Promise.all([
137
+ const [packageCliVersion, widgetSDKVersion] = yield Promise.all([
138
138
  getLatestVersionOfLibrary(CUSTOM_PACKAGE_CLI_LIB_NAME),
139
- getLatestVersionOfLibrary(CUSTOM_WIDGET_LIB_NAME),
139
+ getLatestVersionOfLibrary(WIDGET_SDK_LIB_NAME),
140
140
  ]);
141
141
  return (data) => actions(Object.assign(Object.assign({}, data), { packageCliVersion,
142
- customWidgetVersion }));
142
+ widgetSDKVersion }));
143
143
  });
144
144
  export { getInitWidgetActions };
@@ -1,8 +1,9 @@
1
1
  import { randomUUID } from "node:crypto";
2
2
  import { capitalizeHelperName } from "../../scripts/widget/init/helpers.js";
3
+ import { CUSTOM_PACKAGE_CLI_LIB_NAME } from "../../const.js";
3
4
  export const PACKAGE_MANIFEST_TEMPLATE = `\
4
5
  {
5
- "$schema": "../node_modules/@infomaximum/package-cli/schemas/packageManifestSchema.json",
6
+ "$schema": "../node_modules/${CUSTOM_PACKAGE_CLI_LIB_NAME}/schemas/packageManifestSchema.json",
6
7
  "manifest_version": "1",
7
8
  "author": "{{author}}",
8
9
  "guid": "${randomUUID()}",
@@ -1,3 +1,4 @@
1
+ import { WIDGET_SDK_LIB_NAME } from "../../../../const.js";
1
2
  export const WIDGET_DEFINITION_TEMPLATE = `\
2
3
  import type {
3
4
  IDefinition,
@@ -7,7 +8,7 @@ import type {
7
8
  IWidgetDimension,
8
9
  IWidgetDimensionHierarchy,
9
10
  IWidgetMeasure,
10
- } from "@infomaximum/custom-widget";
11
+ } from "${WIDGET_SDK_LIB_NAME}";
11
12
  import { fillSettings, type WidgetSettings } from "definition/settings";
12
13
  import { createPanelDescription } from "definition/panel";
13
14
 
@@ -1,8 +1,9 @@
1
+ import { WIDGET_SDK_LIB_NAME } from "../../../../const.js";
1
2
  export const WIDGET_PANEL_TEMPLATE = `\
2
3
  import {
3
4
  type IPanelDescriptionCreator,
4
5
  type IGroupSettings,
5
- } from "@infomaximum/custom-widget";
6
+ } from "${WIDGET_SDK_LIB_NAME}";
6
7
  import type { WidgetSettings } from "definition/settings";
7
8
 
8
9
  export const createPanelDescription: IPanelDescriptionCreator<
@@ -1,8 +1,9 @@
1
+ import { WIDGET_SDK_LIB_NAME } from "../../../../const.js";
1
2
  export const WIDGET_SETTINGS_TEMPLATE = `\
2
3
  import type {
3
4
  IBaseWidgetSettings,
4
5
  IFillSettings,
5
- } from "@infomaximum/custom-widget";
6
+ } from "${WIDGET_SDK_LIB_NAME}";
6
7
 
7
8
  export interface WidgetSettings extends IBaseWidgetSettings {}
8
9
 
@@ -1,7 +1,8 @@
1
+ import { WIDGET_SDK_LIB_NAME } from "../../../const.js";
1
2
  export const APP_D_TS_TEMPLATE = `\
2
3
  /* eslint-disable @typescript-eslint/triple-slash-reference */
3
4
  /// <reference types="@infomaximum/global-types" />
4
- /// <reference types="@infomaximum/custom-widget" />
5
+ /// <reference types="${WIDGET_SDK_LIB_NAME}" />
5
6
 
6
7
  declare module "*.gif" {
7
8
  const src: string;
@@ -1,4 +1,4 @@
1
- import { MANIFEST_JSON_FILE_NAME } from "../../../const.js";
1
+ import { MANIFEST_JSON_FILE_NAME, WIDGET_SDK_LIB_NAME, } from "../../../const.js";
2
2
  import { capitalizeHelperName } from "../../../scripts/widget/init/helpers.js";
3
3
  export const WIDGET_INDEX_TEMPLATE = `\
4
4
  import React from "react";
@@ -7,7 +7,7 @@ import "./index.css";
7
7
  import {
8
8
  type IWidget,
9
9
  type ICustomWidgetProps,
10
- } from "@infomaximum/custom-widget";
10
+ } from "${WIDGET_SDK_LIB_NAME}";
11
11
  import manifest from "../${MANIFEST_JSON_FILE_NAME}";
12
12
  import { type WidgetSettings } from "definition/settings";
13
13
  import { Definition } from "definition/definition";
@@ -1,8 +1,9 @@
1
1
  import { randomUUID } from "node:crypto";
2
2
  import { capitalizeHelperName } from "../../scripts/widget/init/helpers.js";
3
+ import { CUSTOM_PACKAGE_CLI_LIB_NAME } from "../../const.js";
3
4
  export const WIDGET_MANIFEST_TEMPLATE = `\
4
5
  {
5
- "$schema": "node_modules/@infomaximum/package-cli/schemas/widgetManifestSchema.json",
6
+ "$schema": "node_modules/${CUSTOM_PACKAGE_CLI_LIB_NAME}/schemas/widgetManifestSchema.json",
6
7
  "uuid": "${randomUUID()}",
7
8
  "entry": "index.js",
8
9
  "api_version": 1,
@@ -1,3 +1,4 @@
1
+ import { CUSTOM_PACKAGE_CLI_LIB_NAME, WIDGET_SDK_LIB_NAME, } from "../../const.js";
1
2
  export const WIDGET_PACKAGE_JSON_TEMPLATE = `\
2
3
  {
3
4
  "name": "template_widget",
@@ -12,7 +13,7 @@ export const WIDGET_PACKAGE_JSON_TEMPLATE = `\
12
13
  "test": "jest --passWithNoTests"
13
14
  },
14
15
  "dependencies": {
15
- "@infomaximum/custom-widget": "^{{customWidgetVersion}}",
16
+ "${WIDGET_SDK_LIB_NAME}": "{{widgetSDKVersion}}",
16
17
  "react": "18.2.0",
17
18
  "react-dom": "18.2.0"
18
19
  },
@@ -21,7 +22,7 @@ export const WIDGET_PACKAGE_JSON_TEMPLATE = `\
21
22
  "@babel/preset-env": "7.23.6",
22
23
  "@babel/preset-react": "7.23.3",
23
24
  "@babel/preset-typescript": "7.23.3",
24
- "@infomaximum/package-cli": "^{{packageCliVersion}}",
25
+ "${CUSTOM_PACKAGE_CLI_LIB_NAME}": "^{{packageCliVersion}}",
25
26
  "@types/jest": "29.5.11",
26
27
  "@types/react": "18.2.43",
27
28
  "@types/react-dom": "18.2.17",
package/dist/utils.js CHANGED
@@ -6,7 +6,7 @@ import util from "node:util";
6
6
  import Module from "node:module";
7
7
  import semver from "semver";
8
8
  import chalk from "chalk";
9
- import { CUSTOM_PACKAGE_CLI_LIB_NAME, CUSTOM_WIDGET_LIB_NAME, } from "./const.js";
9
+ import { CUSTOM_PACKAGE_CLI_LIB_NAME, WIDGET_SDK_LIB_NAME } from "./const.js";
10
10
  const execPromise = util.promisify(exec);
11
11
  export const isExist = (entityPath) => __awaiter(void 0, void 0, void 0, function* () {
12
12
  try {
@@ -85,7 +85,7 @@ export function checkLatestLibsVersion() {
85
85
  return __awaiter(this, void 0, void 0, function* () {
86
86
  try {
87
87
  yield Promise.allSettled([
88
- checkLatestVersion(CUSTOM_WIDGET_LIB_NAME),
88
+ checkLatestVersion(WIDGET_SDK_LIB_NAME),
89
89
  checkLatestVersion(CUSTOM_PACKAGE_CLI_LIB_NAME),
90
90
  ]);
91
91
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infomaximum/package-cli",
3
- "version": "1.18.0-rc2",
3
+ "version": "1.19.0",
4
4
  "exports": "./dist/index.js",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",