@infomaximum/package-cli 1.16.1 → 1.18.0-rc1
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 +7 -0
- package/dist/configs/webpack/{buildPa/321/201kage.js → buildPackage.js} +2 -2
- package/dist/configs/webpack/common.js +12 -1
- package/dist/configs/webpack/sections/plugins/modifyManifestWidget.js +9 -0
- package/dist/const.js +2 -0
- package/dist/paths.js +2 -1
- package/dist/scripts/widget/build.js +1 -1
- package/package.json +2 -2
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.17.0](https://github.com/Infomaximum/package-cli/compare/v1.16.1...v1.17.0) (2024-02-16)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* добавлен постфикс имени виджета при выполнении сборки пакета для разработки ([f05a35f](https://github.com/Infomaximum/package-cli/commit/f05a35f45a1776f905e2bd7405f9bc06a244e838))
|
|
11
|
+
|
|
5
12
|
### [1.16.1](https://github.com/Infomaximum/package-cli/compare/v1.16.0...v1.16.1) (2024-02-14)
|
|
6
13
|
|
|
7
14
|
|
|
@@ -5,7 +5,7 @@ import CopyWebpackPlugin from "copy-webpack-plugin";
|
|
|
5
5
|
import path from "path";
|
|
6
6
|
import { JsonModifyWebpackPlugin } from "@infomaximum/json-modify-webpack-plugin";
|
|
7
7
|
import { isExist, systemRequire } from "../../utils.js";
|
|
8
|
-
import { BUILD_ARCHIVE_EXT, MANIFEST_REG_EXP, WIDGET_ARCHIVE_FULL_NAME, } from "../../const.js";
|
|
8
|
+
import { BUILD_ARCHIVE_EXT, DEV_POSTFIX, MANIFEST_REG_EXP, WIDGET_ARCHIVE_FULL_NAME, } from "../../const.js";
|
|
9
9
|
import { assertSimple } from "@infomaximum/assert";
|
|
10
10
|
const packageFilename = "main.js";
|
|
11
11
|
export const getPackageConfig = (mode, PATHS, isBuildDevMode) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -13,7 +13,7 @@ export const getPackageConfig = (mode, PATHS, isBuildDevMode) => __awaiter(void
|
|
|
13
13
|
const manifestPackageName = systemRequire(PATHS.packageManifest).name;
|
|
14
14
|
let widgetPackageName = `${manifestPackageName}_${widgetVersion}`;
|
|
15
15
|
if (isBuildDevMode)
|
|
16
|
-
widgetPackageName +=
|
|
16
|
+
widgetPackageName += DEV_POSTFIX;
|
|
17
17
|
const widgetArchivePath = path.resolve(PATHS.appBuild, WIDGET_ARCHIVE_FULL_NAME);
|
|
18
18
|
assertSimple(yield isExist(PATHS.packageManifest), `File ${PATHS.packageManifest} not found`);
|
|
19
19
|
assertSimple(yield isExist(widgetArchivePath), `File ${widgetArchivePath} not found`);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin";
|
|
2
2
|
import { TsconfigPathsPlugin } from "tsconfig-paths-webpack-plugin";
|
|
3
|
+
import CopyWebpackPlugin from "copy-webpack-plugin";
|
|
3
4
|
import webpack, {} from "webpack";
|
|
4
5
|
import { systemRequire } from "../../utils.js";
|
|
5
|
-
import { MANIFEST_REG_EXP } from "../../const.js";
|
|
6
|
+
import { WIDGET_RESOURCES_PATH_NAME, MANIFEST_REG_EXP } from "../../const.js";
|
|
6
7
|
import { cssLoaders } from "./sections/loaders/cssLoaders.js";
|
|
7
8
|
const { ProgressPlugin } = webpack;
|
|
8
9
|
const isProduction = (mode) => mode === "production";
|
|
@@ -28,6 +29,16 @@ export const getCommonWidgetConfig = (mode, PATHS) => {
|
|
|
28
29
|
},
|
|
29
30
|
},
|
|
30
31
|
}),
|
|
32
|
+
new CopyWebpackPlugin({
|
|
33
|
+
patterns: [
|
|
34
|
+
{
|
|
35
|
+
from: PATHS.resourcesWidget,
|
|
36
|
+
toType: "dir",
|
|
37
|
+
to: WIDGET_RESOURCES_PATH_NAME,
|
|
38
|
+
noErrorOnMissing: true,
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
}),
|
|
31
42
|
].filter(Boolean),
|
|
32
43
|
module: {
|
|
33
44
|
rules: [
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { JsonModifyWebpackPlugin } from "@infomaximum/json-modify-webpack-plugin";
|
|
2
|
+
import { DEV_POSTFIX } from "../../../../const.js";
|
|
2
3
|
export const getModifyManifestWidgetPlugin = ({ host, port }) => {
|
|
3
4
|
return new JsonModifyWebpackPlugin({
|
|
4
5
|
matchers: [
|
|
@@ -6,6 +7,14 @@ export const getModifyManifestWidgetPlugin = ({ host, port }) => {
|
|
|
6
7
|
matcher: /^manifest.json$/,
|
|
7
8
|
action: (currentJsonContent) => {
|
|
8
9
|
currentJsonContent.entry = `http://${host}:${port}/${currentJsonContent.entry}`;
|
|
10
|
+
if ((currentJsonContent === null || currentJsonContent === void 0 ? void 0 : currentJsonContent.name) &&
|
|
11
|
+
typeof currentJsonContent.name === "object") {
|
|
12
|
+
Object.keys(currentJsonContent.name).forEach((lang) => {
|
|
13
|
+
Object.assign(currentJsonContent.name, {
|
|
14
|
+
[lang]: currentJsonContent.name[lang] + DEV_POSTFIX,
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
}
|
|
9
18
|
return currentJsonContent;
|
|
10
19
|
},
|
|
11
20
|
},
|
package/dist/const.js
CHANGED
|
@@ -7,3 +7,5 @@ export const DEFAULT_HOST = "localhost";
|
|
|
7
7
|
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
|
+
export const DEV_POSTFIX = "__DEV";
|
|
11
|
+
export const WIDGET_RESOURCES_PATH_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 } from "./const.js";
|
|
5
|
+
import { MANIFEST_JSON_FILE_NAME, WIDGET_RESOURCES_PATH_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,6 +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
38
|
get moduleIndex() {
|
|
38
39
|
return generateIndexPath(cwd, entryPath);
|
|
39
40
|
},
|
|
@@ -2,7 +2,7 @@ import { __awaiter } from "tslib";
|
|
|
2
2
|
import webpack, {} from "webpack";
|
|
3
3
|
import { generatePaths } from "../../paths.js";
|
|
4
4
|
import { getCommonWidgetConfig } from "../../configs/webpack/common.js";
|
|
5
|
-
import { getPackageConfig } from "../../configs/webpack/
|
|
5
|
+
import { getPackageConfig } from "../../configs/webpack/buildPackage.js";
|
|
6
6
|
import { checkLatestLibsVersion } from "../../utils.js";
|
|
7
7
|
import { merge } from "webpack-merge";
|
|
8
8
|
import { getModifyManifestWidgetPlugin } from "../../configs/webpack/sections/plugins/modifyManifestWidget.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infomaximum/package-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.18.0-rc1",
|
|
4
4
|
"exports": "./dist/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@babel/core": "^7.23.6",
|
|
26
26
|
"@babel/plugin-transform-runtime": "^7.23.6",
|
|
27
27
|
"@infomaximum/assert": "1.1.2",
|
|
28
|
-
"@infomaximum/json-modify-webpack-plugin": "^1.0.
|
|
28
|
+
"@infomaximum/json-modify-webpack-plugin": "^1.0.2",
|
|
29
29
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.11",
|
|
30
30
|
"@svgr/webpack": "^8.1.0",
|
|
31
31
|
"autoprefixer": "^10.4.16",
|