@atomicsmash/cli 5.0.0-beta.0 → 5.0.0-beta.2
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,3 +1,3 @@
|
|
|
1
|
-
export declare const blocksHelpMessage = "\n Atomic Smash CLI - Blocks command.\n\n A command to generate WordPress blocks from a src folder.\n\n Options:\n --in
|
|
1
|
+
export declare const blocksHelpMessage = "\n Atomic Smash CLI - Blocks command.\n\n A command to generate WordPress blocks from a src folder.\n\n Options:\n --in The directory where the WP blocks can be found. Relative to cwd.\n --out The directory where the WP blocks will be output. Relative to cwd.\n --tsConfigPath (optional) The directory where the tsconfig file can be found. Relative to cwd. Defaults to the in folder.\n --watch (optional) Watch the blocks in folder for changes and compile.\n\n Example usage:\n $ smash-cli blocks --watch --in src --out build --tsConfigPath tsconfig.json\n";
|
|
2
2
|
export default function blocks(args: string[]): void;
|
|
3
3
|
//# sourceMappingURL=blocks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blocks.d.ts","sourceRoot":"","sources":["../../src/commands/blocks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"blocks.d.ts","sourceRoot":"","sources":["../../src/commands/blocks.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,iBAAiB,kmBAa7B,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,QA0L5C"}
|
package/dist/commands/blocks.js
CHANGED
|
@@ -5,6 +5,7 @@ import { resolve as resolvePath } from "node:path";
|
|
|
5
5
|
import DependencyExtractionWebpackPlugin from "@wordpress/dependency-extraction-webpack-plugin";
|
|
6
6
|
import defaultConfig from "@wordpress/scripts/config/webpack.config.js";
|
|
7
7
|
import autoprefixer from "autoprefixer";
|
|
8
|
+
import CopyWebpackPlugin from "copy-webpack-plugin";
|
|
8
9
|
import cssnano from "cssnano";
|
|
9
10
|
import glob from "glob-promise";
|
|
10
11
|
import postcss from "postcss";
|
|
@@ -18,12 +19,13 @@ export const blocksHelpMessage = `
|
|
|
18
19
|
A command to generate WordPress blocks from a src folder.
|
|
19
20
|
|
|
20
21
|
Options:
|
|
21
|
-
--in
|
|
22
|
-
--out
|
|
23
|
-
|
|
22
|
+
--in The directory where the WP blocks can be found. Relative to cwd.
|
|
23
|
+
--out The directory where the WP blocks will be output. Relative to cwd.
|
|
24
|
+
--tsConfigPath (optional) The directory where the tsconfig file can be found. Relative to cwd. Defaults to the in folder.
|
|
25
|
+
--watch (optional) Watch the blocks in folder for changes and compile.
|
|
24
26
|
|
|
25
27
|
Example usage:
|
|
26
|
-
$ smash-cli blocks --watch --in src --out build
|
|
28
|
+
$ smash-cli blocks --watch --in src --out build --tsConfigPath tsconfig.json
|
|
27
29
|
`;
|
|
28
30
|
export default function blocks(args) {
|
|
29
31
|
if (hasHelpFlag(args)) {
|
|
@@ -38,87 +40,108 @@ export default function blocks(args) {
|
|
|
38
40
|
if (!outFlag || outFlag.startsWith("--")) {
|
|
39
41
|
throw new Error("You need to provide a value for the --out flag.");
|
|
40
42
|
}
|
|
43
|
+
const tsConfigFlag = args[args.findIndex((arg) => arg === "--tsConfigPath") + 1];
|
|
41
44
|
const srcFolder = resolvePath(inFlag);
|
|
42
45
|
const distFolder = resolvePath(outFlag);
|
|
46
|
+
const postCSSPlugins = [autoprefixer];
|
|
47
|
+
if (isProduction) {
|
|
48
|
+
postCSSPlugins.push(cssnano({ preset: "default" }));
|
|
49
|
+
}
|
|
50
|
+
async function processCSSFiles(globMatches) {
|
|
51
|
+
for (const match of globMatches) {
|
|
52
|
+
const fileName = match.split("/").pop();
|
|
53
|
+
if (!fileName) {
|
|
54
|
+
console.error(`Failed to get filename of ${match}`);
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
const css = readFileSync(match);
|
|
58
|
+
await postcss(postCSSPlugins)
|
|
59
|
+
.process(css, {
|
|
60
|
+
from: match,
|
|
61
|
+
to: match.replace(srcFolder, distFolder),
|
|
62
|
+
})
|
|
63
|
+
.then((result) => {
|
|
64
|
+
writeFileSync(match.replace(srcFolder, distFolder), result.css);
|
|
65
|
+
if (result.map) {
|
|
66
|
+
writeFileSync(`${match.replace(srcFolder, distFolder)}.map`, result.map.toString());
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
async function fingerprintCSSFilesIfProduction() {
|
|
72
|
+
if (!isProduction) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
return glob.promise(`${distFolder}/**/*.css`).then((matches) => {
|
|
76
|
+
for (const match of matches) {
|
|
77
|
+
const fileBuffer = readFileSync(match);
|
|
78
|
+
const contentHash = crypto.createHash("shake256", {
|
|
79
|
+
outputLength: 10,
|
|
80
|
+
});
|
|
81
|
+
contentHash.update(fileBuffer);
|
|
82
|
+
const fileMatchArray = match.split("/");
|
|
83
|
+
const newFileName = fileMatchArray
|
|
84
|
+
.pop()
|
|
85
|
+
?.replace(".css", `.${contentHash.digest("hex")}.css`);
|
|
86
|
+
if (!newFileName || newFileName === "") {
|
|
87
|
+
throw new Error("Error getting CSS file name.");
|
|
88
|
+
}
|
|
89
|
+
renameSync(match, `${fileMatchArray.join("/")}/${newFileName}`);
|
|
90
|
+
}
|
|
91
|
+
return;
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
const plugins = [
|
|
95
|
+
...(defaultConfig.plugins?.filter((plugin) => {
|
|
96
|
+
return ![
|
|
97
|
+
"DependencyExtractionWebpackPlugin",
|
|
98
|
+
"CopyPlugin", // CopyWebpackPlugin
|
|
99
|
+
].includes(plugin?.constructor.name ?? "");
|
|
100
|
+
}) ?? []),
|
|
101
|
+
new DependencyExtractionWebpackPlugin({
|
|
102
|
+
combineAssets: true,
|
|
103
|
+
}),
|
|
104
|
+
new CopyWebpackPlugin({
|
|
105
|
+
patterns: [
|
|
106
|
+
{
|
|
107
|
+
from: `**/block.json`,
|
|
108
|
+
noErrorOnMissing: true,
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
}),
|
|
112
|
+
{
|
|
113
|
+
apply: (compiler) => {
|
|
114
|
+
compiler.hooks.afterEmit.tapPromise("Build CSS and copy to test area", async () => {
|
|
115
|
+
await glob
|
|
116
|
+
.promise(`${srcFolder}/**/*.css`)
|
|
117
|
+
.then(processCSSFiles)
|
|
118
|
+
.then(fingerprintCSSFilesIfProduction)
|
|
119
|
+
.catch((error) => {
|
|
120
|
+
console.error(error);
|
|
121
|
+
throw error;
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
];
|
|
43
127
|
const compiler = webpack({
|
|
44
128
|
...defaultConfig,
|
|
45
129
|
entry: () => getAllBlocksJSEntryPoints(srcFolder),
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
new DependencyExtractionWebpackPlugin({
|
|
49
|
-
combineAssets: true,
|
|
50
|
-
}),
|
|
51
|
-
{
|
|
52
|
-
apply: (compiler) => {
|
|
53
|
-
compiler.hooks.afterEmit.tapPromise("Build CSS and copy to test area", async () => {
|
|
54
|
-
const plugins = [autoprefixer];
|
|
55
|
-
if (isProduction) {
|
|
56
|
-
plugins.push(cssnano({ preset: "default" }));
|
|
57
|
-
}
|
|
58
|
-
await glob
|
|
59
|
-
.promise(`${srcFolder}/**/*.css`)
|
|
60
|
-
.then(async (matches) => {
|
|
61
|
-
for (const match of matches) {
|
|
62
|
-
const fileName = match.split("/").pop();
|
|
63
|
-
if (!fileName) {
|
|
64
|
-
console.error(`Failed to get filename of ${match}`);
|
|
65
|
-
continue;
|
|
66
|
-
}
|
|
67
|
-
const css = readFileSync(match);
|
|
68
|
-
await postcss(plugins)
|
|
69
|
-
.process(css, {
|
|
70
|
-
from: match,
|
|
71
|
-
to: match.replace(srcFolder, distFolder),
|
|
72
|
-
})
|
|
73
|
-
.then((result) => {
|
|
74
|
-
writeFileSync(match.replace(srcFolder, distFolder), result.css);
|
|
75
|
-
if (result.map) {
|
|
76
|
-
writeFileSync(`${match.replace(srcFolder, distFolder)}.map`, result.map.toString());
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
})
|
|
81
|
-
.then(async () => {
|
|
82
|
-
if (!isProduction) {
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
return glob
|
|
86
|
-
.promise(`${distFolder}/**/*.css`)
|
|
87
|
-
.then((matches) => {
|
|
88
|
-
for (const match of matches) {
|
|
89
|
-
const fileBuffer = readFileSync(match);
|
|
90
|
-
const contentHash = crypto.createHash("shake256", {
|
|
91
|
-
outputLength: 10,
|
|
92
|
-
});
|
|
93
|
-
contentHash.update(fileBuffer);
|
|
94
|
-
const fileMatchArray = match.split("/");
|
|
95
|
-
const newFileName = fileMatchArray
|
|
96
|
-
.pop()
|
|
97
|
-
?.replace(".css", `.${contentHash.digest("hex")}.css`);
|
|
98
|
-
if (!newFileName || newFileName === "") {
|
|
99
|
-
throw new Error("Error getting CSS file name.");
|
|
100
|
-
}
|
|
101
|
-
renameSync(match, `${fileMatchArray.join("/")}/${newFileName}`);
|
|
102
|
-
}
|
|
103
|
-
return;
|
|
104
|
-
});
|
|
105
|
-
})
|
|
106
|
-
.catch((error) => {
|
|
107
|
-
console.error(error);
|
|
108
|
-
throw error;
|
|
109
|
-
});
|
|
110
|
-
});
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
],
|
|
130
|
+
context: srcFolder,
|
|
131
|
+
plugins: plugins,
|
|
114
132
|
output: {
|
|
115
133
|
path: distFolder,
|
|
116
134
|
clean: true,
|
|
117
135
|
},
|
|
118
136
|
resolve: {
|
|
119
|
-
plugins: [
|
|
137
|
+
plugins: [
|
|
138
|
+
new TsconfigPathsPlugin({
|
|
139
|
+
configFile: tsConfigFlag ?? srcFolder,
|
|
140
|
+
}),
|
|
141
|
+
],
|
|
120
142
|
extensions: [".ts", ".js", ".tsx", ".jsx"],
|
|
121
143
|
},
|
|
144
|
+
mode: isProduction ? "production" : "development",
|
|
122
145
|
});
|
|
123
146
|
if (args.find((value) => value === "--watch")) {
|
|
124
147
|
const watching = compiler.watch({
|
|
@@ -127,15 +150,19 @@ export default function blocks(args) {
|
|
|
127
150
|
poll: undefined,
|
|
128
151
|
}, (error, stats) => {
|
|
129
152
|
if (error) {
|
|
130
|
-
console.error(error);
|
|
153
|
+
console.error(error.stack ?? error);
|
|
131
154
|
process.exitCode = 1;
|
|
132
155
|
watching.close((closeError) => {
|
|
133
156
|
console.error(closeError);
|
|
134
157
|
});
|
|
135
158
|
}
|
|
136
|
-
if (stats
|
|
137
|
-
|
|
138
|
-
|
|
159
|
+
else if (stats) {
|
|
160
|
+
const info = stats.toJson();
|
|
161
|
+
if (stats.hasErrors()) {
|
|
162
|
+
console.error(info.errors);
|
|
163
|
+
}
|
|
164
|
+
if (stats.hasWarnings()) {
|
|
165
|
+
console.warn(info.warnings);
|
|
139
166
|
}
|
|
140
167
|
}
|
|
141
168
|
});
|
|
@@ -151,8 +178,16 @@ export default function blocks(args) {
|
|
|
151
178
|
console.error(error);
|
|
152
179
|
process.exitCode = 1;
|
|
153
180
|
}
|
|
154
|
-
if (stats
|
|
155
|
-
|
|
181
|
+
else if (stats) {
|
|
182
|
+
const info = stats.toJson();
|
|
183
|
+
if (stats.hasErrors()) {
|
|
184
|
+
console.error(info.errors);
|
|
185
|
+
process.exitCode = 1;
|
|
186
|
+
}
|
|
187
|
+
if (stats.hasWarnings()) {
|
|
188
|
+
console.warn(info.warnings);
|
|
189
|
+
process.exitCode = 2;
|
|
190
|
+
}
|
|
156
191
|
}
|
|
157
192
|
compiler.close((closeError) => {
|
|
158
193
|
if (closeError) {
|
|
@@ -177,6 +212,9 @@ async function getAllBlocksJSEntryPoints(srcFolder) {
|
|
|
177
212
|
console.log(`Failed to process ${fileNameAndExtension}, continuing anyway.`);
|
|
178
213
|
continue;
|
|
179
214
|
}
|
|
215
|
+
if (!["ts", "js", "tsx", "jsx"].includes(extension)) {
|
|
216
|
+
continue;
|
|
217
|
+
}
|
|
180
218
|
entryPoints[toCamelCase(entryName)] = {
|
|
181
219
|
import: `${srcFolder}/${fileNameAndExtension}`,
|
|
182
220
|
filename: `${entryName}${isProduction ? `.[contenthash]` : ""}.js`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blocks.js","sourceRoot":"","sources":["../../src/commands/blocks.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,iCAAiC,MAAM,iDAAiD,CAAC;AAChG,OAAO,aAAa,MAAM,6CAA6C,CAAC;AACxE,OAAO,YAAY,MAAM,cAAc,CAAC;AACxC,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,IAAI,MAAM,cAAc,CAAC;AAChC,OAAO,OAA2B,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,CAAC;AAE3D,MAAM,CAAC,MAAM,iBAAiB,GAAG
|
|
1
|
+
{"version":3,"file":"blocks.js","sourceRoot":"","sources":["../../src/commands/blocks.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,O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,CAAC;IACF,CAAC;IACD,sCAAsC;IACtC,OAAO,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC;IAC7B,OAAO,WAAW,CAAC;AACpB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atomicsmash/cli",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.2",
|
|
4
4
|
"description": "A collection of CLI tools by Atomic Smash.",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"homepage": "https://www.atomicsmash.co.uk/",
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"@wordpress/dependency-extraction-webpack-plugin": "^4.20.0",
|
|
44
44
|
"@wordpress/scripts": "^26.19.0",
|
|
45
45
|
"autoprefixer": "^10.4.14",
|
|
46
|
+
"copy-webpack-plugin": "^12.0.2",
|
|
46
47
|
"cssnano": "^6.0.2",
|
|
47
48
|
"glob": "^10.3.10",
|
|
48
49
|
"glob-promise": "^6.0.3",
|