@infomaximum/package-cli 1.17.0 → 1.18.0-rc2

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.
@@ -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,9 +1,11 @@
1
1
  import ZipPlugin from "zip-webpack-plugin";
2
- import { BUILD_ARCHIVE_EXT, MANIFEST_JSON_FILE_NAME, WIDGET_ARCHIVE_NAME, } from "../../../../const.js";
2
+ import { BUILD_ARCHIVE_EXT, MANIFEST_JSON_FILE_NAME, WIDGET_ARCHIVE_NAME, WIDGET_RESOURCES_PATH_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
- include: isOnlyManifest ? [MANIFEST_JSON_FILE_NAME] : undefined,
7
+ include: isOnlyManifest
8
+ ? [MANIFEST_JSON_FILE_NAME, WIDGET_RESOURCES_PATH_NAME]
9
+ : undefined,
8
10
  });
9
11
  };
package/dist/const.js CHANGED
@@ -8,3 +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";
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/buildPaсkage.js";
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.17.0",
3
+ "version": "1.18.0-rc2",
4
4
  "exports": "./dist/index.js",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",