@atomicsmash/cli 5.0.0-beta.1 → 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":"AAkBA,eAAO,MAAM,iBAAiB
|
|
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
|
@@ -19,12 +19,13 @@ export const blocksHelpMessage = `
|
|
|
19
19
|
A command to generate WordPress blocks from a src folder.
|
|
20
20
|
|
|
21
21
|
Options:
|
|
22
|
-
--in
|
|
23
|
-
--out
|
|
24
|
-
|
|
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.
|
|
25
26
|
|
|
26
27
|
Example usage:
|
|
27
|
-
$ smash-cli blocks --watch --in src --out build
|
|
28
|
+
$ smash-cli blocks --watch --in src --out build --tsConfigPath tsconfig.json
|
|
28
29
|
`;
|
|
29
30
|
export default function blocks(args) {
|
|
30
31
|
if (hasHelpFlag(args)) {
|
|
@@ -39,96 +40,108 @@ export default function blocks(args) {
|
|
|
39
40
|
if (!outFlag || outFlag.startsWith("--")) {
|
|
40
41
|
throw new Error("You need to provide a value for the --out flag.");
|
|
41
42
|
}
|
|
43
|
+
const tsConfigFlag = args[args.findIndex((arg) => arg === "--tsConfigPath") + 1];
|
|
42
44
|
const srcFolder = resolvePath(inFlag);
|
|
43
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
|
+
];
|
|
44
127
|
const compiler = webpack({
|
|
45
128
|
...defaultConfig,
|
|
46
129
|
entry: () => getAllBlocksJSEntryPoints(srcFolder),
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
new DependencyExtractionWebpackPlugin({
|
|
50
|
-
combineAssets: true,
|
|
51
|
-
}),
|
|
52
|
-
new CopyWebpackPlugin({
|
|
53
|
-
patterns: [
|
|
54
|
-
{
|
|
55
|
-
from: `**/block.json`,
|
|
56
|
-
context: `blocks/`,
|
|
57
|
-
noErrorOnMissing: true,
|
|
58
|
-
},
|
|
59
|
-
],
|
|
60
|
-
}),
|
|
61
|
-
{
|
|
62
|
-
apply: (compiler) => {
|
|
63
|
-
compiler.hooks.afterEmit.tapPromise("Build CSS and copy to test area", async () => {
|
|
64
|
-
const plugins = [autoprefixer];
|
|
65
|
-
if (isProduction) {
|
|
66
|
-
plugins.push(cssnano({ preset: "default" }));
|
|
67
|
-
}
|
|
68
|
-
await glob
|
|
69
|
-
.promise(`${srcFolder}/**/*.css`)
|
|
70
|
-
.then(async (matches) => {
|
|
71
|
-
for (const match of matches) {
|
|
72
|
-
const fileName = match.split("/").pop();
|
|
73
|
-
if (!fileName) {
|
|
74
|
-
console.error(`Failed to get filename of ${match}`);
|
|
75
|
-
continue;
|
|
76
|
-
}
|
|
77
|
-
const css = readFileSync(match);
|
|
78
|
-
await postcss(plugins)
|
|
79
|
-
.process(css, {
|
|
80
|
-
from: match,
|
|
81
|
-
to: match.replace(srcFolder, distFolder),
|
|
82
|
-
})
|
|
83
|
-
.then((result) => {
|
|
84
|
-
writeFileSync(match.replace(srcFolder, distFolder), result.css);
|
|
85
|
-
if (result.map) {
|
|
86
|
-
writeFileSync(`${match.replace(srcFolder, distFolder)}.map`, result.map.toString());
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
})
|
|
91
|
-
.then(async () => {
|
|
92
|
-
if (!isProduction) {
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
return glob
|
|
96
|
-
.promise(`${distFolder}/**/*.css`)
|
|
97
|
-
.then((matches) => {
|
|
98
|
-
for (const match of matches) {
|
|
99
|
-
const fileBuffer = readFileSync(match);
|
|
100
|
-
const contentHash = crypto.createHash("shake256", {
|
|
101
|
-
outputLength: 10,
|
|
102
|
-
});
|
|
103
|
-
contentHash.update(fileBuffer);
|
|
104
|
-
const fileMatchArray = match.split("/");
|
|
105
|
-
const newFileName = fileMatchArray
|
|
106
|
-
.pop()
|
|
107
|
-
?.replace(".css", `.${contentHash.digest("hex")}.css`);
|
|
108
|
-
if (!newFileName || newFileName === "") {
|
|
109
|
-
throw new Error("Error getting CSS file name.");
|
|
110
|
-
}
|
|
111
|
-
renameSync(match, `${fileMatchArray.join("/")}/${newFileName}`);
|
|
112
|
-
}
|
|
113
|
-
return;
|
|
114
|
-
});
|
|
115
|
-
})
|
|
116
|
-
.catch((error) => {
|
|
117
|
-
console.error(error);
|
|
118
|
-
throw error;
|
|
119
|
-
});
|
|
120
|
-
});
|
|
121
|
-
},
|
|
122
|
-
},
|
|
123
|
-
],
|
|
130
|
+
context: srcFolder,
|
|
131
|
+
plugins: plugins,
|
|
124
132
|
output: {
|
|
125
133
|
path: distFolder,
|
|
126
134
|
clean: true,
|
|
127
135
|
},
|
|
128
136
|
resolve: {
|
|
129
|
-
plugins: [
|
|
137
|
+
plugins: [
|
|
138
|
+
new TsconfigPathsPlugin({
|
|
139
|
+
configFile: tsConfigFlag ?? srcFolder,
|
|
140
|
+
}),
|
|
141
|
+
],
|
|
130
142
|
extensions: [".ts", ".js", ".tsx", ".jsx"],
|
|
131
143
|
},
|
|
144
|
+
mode: isProduction ? "production" : "development",
|
|
132
145
|
});
|
|
133
146
|
if (args.find((value) => value === "--watch")) {
|
|
134
147
|
const watching = compiler.watch({
|
|
@@ -137,15 +150,19 @@ export default function blocks(args) {
|
|
|
137
150
|
poll: undefined,
|
|
138
151
|
}, (error, stats) => {
|
|
139
152
|
if (error) {
|
|
140
|
-
console.error(error);
|
|
153
|
+
console.error(error.stack ?? error);
|
|
141
154
|
process.exitCode = 1;
|
|
142
155
|
watching.close((closeError) => {
|
|
143
156
|
console.error(closeError);
|
|
144
157
|
});
|
|
145
158
|
}
|
|
146
|
-
if (stats
|
|
147
|
-
|
|
148
|
-
|
|
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);
|
|
149
166
|
}
|
|
150
167
|
}
|
|
151
168
|
});
|
|
@@ -161,8 +178,16 @@ export default function blocks(args) {
|
|
|
161
178
|
console.error(error);
|
|
162
179
|
process.exitCode = 1;
|
|
163
180
|
}
|
|
164
|
-
if (stats
|
|
165
|
-
|
|
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
|
+
}
|
|
166
191
|
}
|
|
167
192
|
compiler.close((closeError) => {
|
|
168
193
|
if (closeError) {
|
|
@@ -187,6 +212,9 @@ async function getAllBlocksJSEntryPoints(srcFolder) {
|
|
|
187
212
|
console.log(`Failed to process ${fileNameAndExtension}, continuing anyway.`);
|
|
188
213
|
continue;
|
|
189
214
|
}
|
|
215
|
+
if (!["ts", "js", "tsx", "jsx"].includes(extension)) {
|
|
216
|
+
continue;
|
|
217
|
+
}
|
|
190
218
|
entryPoints[toCamelCase(entryName)] = {
|
|
191
219
|
import: `${srcFolder}/${fileNameAndExtension}`,
|
|
192
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,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,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,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,iCAAiC,MA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