piral-cli-webpack5 1.8.0-beta.7667 → 1.8.0-beta.7721
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/lib/enhancers/hmr-webpack-config-enhancer/HotModuleServerPlugin.d.ts +1 -1
- package/lib/enhancers/html5-entry-webpack-config-enhancer/helpers.d.ts +3 -2
- package/lib/enhancers/html5-entry-webpack-config-enhancer/helpers.js.map +1 -1
- package/lib/enhancers/html5-entry-webpack-config-enhancer/index.d.ts +1 -1
- package/lib/enhancers/pilet-webpack-config-enhancer/helpers.d.ts +2 -2
- package/lib/enhancers/pilet-webpack-config-enhancer/index.js +1 -1
- package/lib/plugins/SheetPlugin.d.ts +2 -1
- package/lib/plugins/SheetPlugin.js.map +1 -1
- package/lib/plugins/StylesLoader.js.map +1 -1
- package/lib/plugins/StylesPlugin.d.ts +2 -1
- package/lib/plugins/StylesPlugin.js.map +1 -1
- package/package.json +29 -30
- package/src/enhancers/hmr-webpack-config-enhancer/HotModuleServerPlugin.ts +1 -1
- package/src/enhancers/html5-entry-webpack-config-enhancer/helpers.ts +7 -6
- package/src/enhancers/html5-entry-webpack-config-enhancer/index.ts +1 -1
- package/src/enhancers/pilet-webpack-config-enhancer/helpers.ts +2 -2
- package/src/enhancers/pilet-webpack-config-enhancer/index.ts +1 -1
- package/src/plugins/SheetPlugin.ts +2 -2
- package/src/plugins/StylesLoader.ts +1 -1
- package/src/plugins/StylesPlugin.ts +2 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { CheerioAPI } from 'cheerio';
|
|
2
|
+
import type { Configuration, Entry } from 'webpack';
|
|
2
3
|
export declare function isLocal(path: string): boolean;
|
|
3
|
-
export declare function extractParts(content:
|
|
4
|
+
export declare function extractParts(content: CheerioAPI): string[];
|
|
4
5
|
export declare function getTemplates(entry: Entry): Array<string>;
|
|
5
6
|
export declare function replaceEntries(existingEntries: Array<string>, oldEntry: string, newEntries: Array<string>): void;
|
|
6
7
|
export declare function setEntries(config: Configuration, template: string, entries: [string, ...Array<string>]): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/enhancers/html5-entry-webpack-config-enhancer/helpers.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/enhancers/html5-entry-webpack-config-enhancer/helpers.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as HtmlWebpackPlugin from 'html-webpack-plugin';
|
|
2
|
-
import { Configuration } from 'webpack';
|
|
2
|
+
import type { Configuration } from 'webpack';
|
|
3
3
|
export interface Html5EntryWebpackPluginOptions extends Omit<HtmlWebpackPlugin.Options, 'templateContent'> {
|
|
4
4
|
}
|
|
5
5
|
export declare const html5EntryWebpackConfigEnhancer: (options: Html5EntryWebpackPluginOptions) => (compilerOptions: Configuration) => Configuration;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SharedDependency } from 'piral-cli';
|
|
2
|
-
import { Configuration } from 'webpack';
|
|
1
|
+
import type { SharedDependency } from 'piral-cli';
|
|
2
|
+
import type { Configuration } from 'webpack';
|
|
3
3
|
export declare function getVariables(name: string, version: string, env: string): Record<string, string>;
|
|
4
4
|
export declare function setEnvironment(variables: Record<string, string>): void;
|
|
5
5
|
export declare function getDefineVariables(variables: Record<string, string>): {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { Compiler } from 'webpack';
|
|
1
2
|
export default class SheetPlugin {
|
|
2
3
|
private cssName;
|
|
3
4
|
private entryName;
|
|
4
5
|
private loaderPath;
|
|
5
6
|
constructor(cssName: string, piletName: string, entryName: string);
|
|
6
|
-
apply(compiler:
|
|
7
|
+
apply(compiler: Compiler): void;
|
|
7
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SheetPlugin.js","sourceRoot":"","sources":["../../src/plugins/SheetPlugin.ts"],"names":[],"mappings":";;AAAA,+BAA+B;AAC/B,
|
|
1
|
+
{"version":3,"file":"SheetPlugin.js","sourceRoot":"","sources":["../../src/plugins/SheetPlugin.ts"],"names":[],"mappings":";;AAAA,+BAA+B;AAC/B,qCAAgD;AAChD,qDAA4C;AAE5C,MAAqB,WAAW;IAG9B,YAAoB,OAAe,EAAE,SAAiB,EAAU,SAAiB;QAA7D,YAAO,GAAP,OAAO,CAAQ;QAA6B,cAAS,GAAT,SAAS,CAAQ;QAC/E,IAAI,CAAC,UAAU,GAAG,IAAA,cAAO,EAAC,SAAS,EAAE,uBAAuB,OAAO,cAAc,SAAS,GAAG,CAAC,CAAC;IACjG,CAAC;IAED,KAAK,CAAC,QAAkB;QACtB,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC;QAEnC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;QAElF,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC,WAAwB,EAAE,EAAE;YACzE,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,iBAAiB,EAAE,CAAC;gBAC5C,WAAW,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,CACjC;oBACE,IAAI,EAAE,aAAa;oBACnB,KAAK,EAAE,qBAAW,CAAC,8BAA8B;iBAClD,EACD,CAAC,MAAM,EAAE,EAAE;oBACT,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;wBAC1B,MAAM,MAAM,GAAG,IAAI,2BAAS,CAAC,EAAE,CAAC,CAAC;wBACjC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;oBAC9C,CAAC;gBACH,CAAC,CACF,CAAC;YACJ,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA7BD,8BA6BC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StylesLoader.js","sourceRoot":"","sources":["../../src/plugins/StylesLoader.ts"],"names":[],"mappings":";;AAEA,+BAQC;AAVD,+CAA0C;AAE1C,SAAwB,YAAY;IAClC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,IAAA,yBAAU,EAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"StylesLoader.js","sourceRoot":"","sources":["../../src/plugins/StylesLoader.ts"],"names":[],"mappings":";;AAEA,+BAQC;AAVD,+CAA0C;AAE1C,SAAwB,YAAY;IAClC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,IAAA,yBAAU,EAAC,IAAI,CAA2B,CAAC;IACxE,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,CAAC;IACrD,OAAO;QACL,aAAa,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE;QACtC,0BAA0B,KAAK,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,GAAG,GAAG;QAClE,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,iBAAiB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;KAC/E,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StylesPlugin.js","sourceRoot":"","sources":["../../src/plugins/StylesPlugin.ts"],"names":[],"mappings":";;AAAA,+BAAsC;AACtC,
|
|
1
|
+
{"version":3,"file":"StylesPlugin.js","sourceRoot":"","sources":["../../src/plugins/StylesPlugin.ts"],"names":[],"mappings":";;AAAA,+BAAsC;AACtC,qCAAgD;AAChD,qDAA4C;AAE5C,MAAqB,YAAY;IAC/B,YAAoB,OAAe,EAAU,SAAiB;QAA1C,YAAO,GAAP,OAAO,CAAQ;QAAU,cAAS,GAAT,SAAS,CAAQ;IAAG,CAAC;IAElE,KAAK,CAAC,QAAkB;QACtB,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC;QAEnC,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,YAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QAC/F,MAAM,KAAK,GAAG,WAAW,IAAI,CAAC,OAAO,YAAY,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;QACtE,MAAM,OAAO,GAAG,IAAA,cAAO,EAAC,SAAS,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;QACrD,MAAM,cAAc,GAAG,IAAA,cAAO,EAAC,SAAS,EAAE,cAAc,CAAC,CAAC;QAC1D,MAAM,UAAU,GAAG,GAAG,cAAc,IAAI,KAAK,EAAE,CAAC;QAEhD,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QAErD,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,cAAc,EAAE,CAAC,WAAwB,EAAE,EAAE;YAC1E,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,iBAAiB,EAAE,CAAC;gBAC5C,WAAW,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,CACjC;oBACE,IAAI,EAAE,cAAc;oBACpB,KAAK,EAAE,qBAAW,CAAC,8BAA8B;iBAClD,EACD,CAAC,MAAM,EAAE,EAAE;oBACT,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;wBAC1B,MAAM,MAAM,GAAG,IAAI,2BAAS,CAAC,EAAE,CAAC,CAAC;wBACjC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;oBAC9C,CAAC;gBACH,CAAC,CACF,CAAC;YACJ,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA/BD,+BA+BC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piral-cli-webpack5",
|
|
3
|
-
"version": "1.8.0-beta.
|
|
3
|
+
"version": "1.8.0-beta.7721",
|
|
4
4
|
"description": "Provides debug and build capabilities for pilets and Piral instances using Webpack v5.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"piral-cli",
|
|
@@ -43,38 +43,37 @@
|
|
|
43
43
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@types/
|
|
47
|
-
"@types/
|
|
48
|
-
"@types/
|
|
49
|
-
"@types/node": "18.0.1",
|
|
46
|
+
"@types/loader-utils": "^2",
|
|
47
|
+
"@types/mini-css-extract-plugin": "^2",
|
|
48
|
+
"@types/node": "^18",
|
|
50
49
|
"@types/terser-webpack-plugin": "^5.2.0",
|
|
51
|
-
"@types/yargs": "^
|
|
52
|
-
"piral-cli": "1.8.0-beta.
|
|
53
|
-
"strip-ansi": "^6
|
|
50
|
+
"@types/yargs": "^17",
|
|
51
|
+
"piral-cli": "1.8.0-beta.7721",
|
|
52
|
+
"strip-ansi": "^6"
|
|
54
53
|
},
|
|
55
54
|
"dependencies": {
|
|
56
|
-
"@babel/core": "^7
|
|
57
|
-
"@babel/preset-env": "^7
|
|
58
|
-
"@babel/preset-react": "^7
|
|
55
|
+
"@babel/core": "^7",
|
|
56
|
+
"@babel/preset-env": "^7",
|
|
57
|
+
"@babel/preset-react": "^7",
|
|
59
58
|
"ansi-html-community": "0.0.8",
|
|
60
|
-
"babel-loader": "^9
|
|
61
|
-
"cheerio": "^1
|
|
62
|
-
"css-loader": "^
|
|
63
|
-
"css-minimizer-webpack-plugin": "^
|
|
64
|
-
"express": "^4
|
|
65
|
-
"html-entities": "^1
|
|
66
|
-
"html-webpack-plugin": "^5
|
|
67
|
-
"loader-utils": "^2
|
|
68
|
-
"mini-css-extract-plugin": "^2
|
|
69
|
-
"parcel-codegen-loader": "^
|
|
70
|
-
"sass": "^1.
|
|
71
|
-
"sass-loader": "^
|
|
72
|
-
"source-map-loader": "^4
|
|
73
|
-
"style-loader": "^
|
|
74
|
-
"systemjs-webpack-interop": "^2
|
|
75
|
-
"terser-webpack-plugin": "^5
|
|
76
|
-
"ts-loader": "^9
|
|
77
|
-
"webpack": "^5
|
|
59
|
+
"babel-loader": "^9",
|
|
60
|
+
"cheerio": "^1",
|
|
61
|
+
"css-loader": "^7",
|
|
62
|
+
"css-minimizer-webpack-plugin": "^7",
|
|
63
|
+
"express": "^4",
|
|
64
|
+
"html-entities": "^1",
|
|
65
|
+
"html-webpack-plugin": "^5",
|
|
66
|
+
"loader-utils": "^2",
|
|
67
|
+
"mini-css-extract-plugin": "^2",
|
|
68
|
+
"parcel-codegen-loader": "^2",
|
|
69
|
+
"sass": "^1.83.0",
|
|
70
|
+
"sass-loader": "^16",
|
|
71
|
+
"source-map-loader": "^4",
|
|
72
|
+
"style-loader": "^4",
|
|
73
|
+
"systemjs-webpack-interop": "^2",
|
|
74
|
+
"terser-webpack-plugin": "^5",
|
|
75
|
+
"ts-loader": "^9",
|
|
76
|
+
"webpack": "^5"
|
|
78
77
|
},
|
|
79
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "68a3bc176511f7a36b453f0addac97f3e5621e72"
|
|
80
79
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { CheerioAPI } from 'cheerio';
|
|
2
|
+
import type { Configuration, Entry } from 'webpack';
|
|
2
3
|
|
|
3
4
|
export function isLocal(path: string) {
|
|
4
5
|
if (path) {
|
|
@@ -18,15 +19,15 @@ export function isLocal(path: string) {
|
|
|
18
19
|
return false;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
|
-
export function extractParts(content:
|
|
22
|
+
export function extractParts(content: CheerioAPI) {
|
|
22
23
|
const sheets = content('link[href][rel=stylesheet]')
|
|
23
|
-
.filter((_, e
|
|
24
|
+
.filter((_, e) => isLocal(e.attribs.href))
|
|
24
25
|
.remove()
|
|
25
|
-
.toArray()
|
|
26
|
+
.toArray();
|
|
26
27
|
const scripts = content('script[src]')
|
|
27
|
-
.filter((_, e
|
|
28
|
+
.filter((_, e) => isLocal(e.attribs.src))
|
|
28
29
|
.remove()
|
|
29
|
-
.toArray()
|
|
30
|
+
.toArray();
|
|
30
31
|
const files: Array<string> = [];
|
|
31
32
|
|
|
32
33
|
for (const sheet of sheets) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { join } from 'path';
|
|
2
|
-
import { SharedDependency } from 'piral-cli';
|
|
3
|
-
import { Configuration } from 'webpack';
|
|
2
|
+
import type { SharedDependency } from 'piral-cli';
|
|
3
|
+
import type { Configuration } from 'webpack';
|
|
4
4
|
|
|
5
5
|
export function getVariables(name: string, version: string, env: string): Record<string, string> {
|
|
6
6
|
return {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { resolve } from 'path';
|
|
2
|
-
import { Compilation } from 'webpack';
|
|
2
|
+
import { Compilation, Compiler } from 'webpack';
|
|
3
3
|
import { RawSource } from 'webpack-sources';
|
|
4
4
|
|
|
5
5
|
export default class SheetPlugin {
|
|
@@ -9,7 +9,7 @@ export default class SheetPlugin {
|
|
|
9
9
|
this.loaderPath = resolve(__dirname, `SheetLoader?cssName=${cssName}&piletName=${piletName}!`);
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
apply(compiler) {
|
|
12
|
+
apply(compiler: Compiler) {
|
|
13
13
|
const { entry } = compiler.options;
|
|
14
14
|
|
|
15
15
|
entry[this.entryName].import = [this.loaderPath, ...entry[this.entryName].import];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getOptions } from 'loader-utils';
|
|
2
2
|
|
|
3
3
|
export default function stylesLoader() {
|
|
4
|
-
const { cssName, entries } = getOptions(this)
|
|
4
|
+
const { cssName, entries } = getOptions(this) as Record<string, string>;
|
|
5
5
|
const debug = process.env.NODE_ENV === 'development';
|
|
6
6
|
return [
|
|
7
7
|
`const u = ${JSON.stringify(cssName)}`,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { posix, resolve } from 'path';
|
|
2
|
-
import { Compilation } from 'webpack';
|
|
2
|
+
import { Compilation, Compiler } from 'webpack';
|
|
3
3
|
import { RawSource } from 'webpack-sources';
|
|
4
4
|
|
|
5
5
|
export default class StylesPlugin {
|
|
6
6
|
constructor(private cssName: string, private entryName: string) {}
|
|
7
7
|
|
|
8
|
-
apply(compiler) {
|
|
8
|
+
apply(compiler: Compiler) {
|
|
9
9
|
const { entry } = compiler.options;
|
|
10
10
|
|
|
11
11
|
const entries = entry[this.entryName].import.map((e: string) => e.split('\\').join(posix.sep));
|