@atomicsmash/compiler 3.0.0-beta.2 → 3.0.0
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/dist/config.d.ts +2 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +24 -48
- package/dist/index.d.ts +1 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/package.json +13 -17
package/dist/config.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SCSSAliases } from "@atomicsmash/smash-config";
|
|
1
2
|
import type { PathData } from "webpack";
|
|
2
3
|
import DependencyExtractionWebpackPlugin from "@wordpress/dependency-extraction-webpack-plugin";
|
|
3
4
|
import CopyPlugin from "copy-webpack-plugin";
|
|
@@ -9,7 +10,6 @@ import webpack from "webpack";
|
|
|
9
10
|
import { WebpackAssetsManifest } from "webpack-assets-manifest";
|
|
10
11
|
import { BundleAnalyzerPlugin } from "webpack-bundle-analyzer";
|
|
11
12
|
import { BlocksPlugin } from "./BlocksPlugin.js";
|
|
12
|
-
import { SCSSAliases } from "./index.js";
|
|
13
13
|
export declare function config(options: {
|
|
14
14
|
/**
|
|
15
15
|
* The directory where the source files can be found. Relative to cwd.
|
|
@@ -128,7 +128,7 @@ export declare function config(options: {
|
|
|
128
128
|
oneOf?: undefined;
|
|
129
129
|
})[];
|
|
130
130
|
};
|
|
131
|
-
plugins: (BlocksPlugin | DependencyExtractionWebpackPlugin | CopyPlugin |
|
|
131
|
+
plugins: (BlocksPlugin | DependencyExtractionWebpackPlugin | CopyPlugin | import("vue-loader").VueLoaderPlugin | WebpackAssetsManifest | SVGSpritemapPlugin | BundleAnalyzerPlugin | webpack.DefinePlugin)[];
|
|
132
132
|
optimization: {
|
|
133
133
|
minimizer: EsbuildPlugin[];
|
|
134
134
|
};
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources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;;;;;;;qCAeV,QAAQ;;;;;;;;;;sCA7PA,CAAC;;;;;;;;;;;;;;;;;;;;;;;GA4bnC"}
|
package/dist/config.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { sep as pathSeparator, extname, resolve as resolvePath, relative, join, } from "node:path";
|
|
2
2
|
import { pathToFileURL } from "node:url";
|
|
3
|
-
import { getSmashConfig } from "@atomicsmash/
|
|
3
|
+
import { getSmashConfig } from "@atomicsmash/smash-config";
|
|
4
4
|
import DependencyExtractionWebpackPlugin from "@wordpress/dependency-extraction-webpack-plugin";
|
|
5
5
|
import browserslistToEsbuild from "browserslist-to-esbuild";
|
|
6
6
|
import CopyPlugin from "copy-webpack-plugin";
|
|
7
|
-
import { cosmiconfig } from "cosmiconfig";
|
|
8
7
|
import cssNano from "cssnano";
|
|
9
8
|
import { EsbuildPlugin } from "esbuild-loader";
|
|
10
9
|
import glob from "fast-glob";
|
|
@@ -320,6 +319,10 @@ export async function config(options) {
|
|
|
320
319
|
entry.key = "icons/sprite.svg";
|
|
321
320
|
return entry;
|
|
322
321
|
}
|
|
322
|
+
if (entry.key.startsWith("icons/sprite") && entry.key.endsWith(".svg")) {
|
|
323
|
+
entry.key = "icons/sprite.svg";
|
|
324
|
+
return entry;
|
|
325
|
+
}
|
|
323
326
|
if (entry.key.startsWith("/")) {
|
|
324
327
|
entry.key = entry.key.slice(1);
|
|
325
328
|
}
|
|
@@ -389,52 +392,25 @@ async function getSassOptions(srcFolder) {
|
|
|
389
392
|
if (smashConfig) {
|
|
390
393
|
return smashConfig.scssAliases;
|
|
391
394
|
}
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
const config = result.config;
|
|
401
|
-
if (typeof config === "object" &&
|
|
402
|
-
config !== null &&
|
|
403
|
-
Object.keys(config).length <= 2) {
|
|
404
|
-
if (Object.keys(config).length === 2 &&
|
|
405
|
-
"importers" in config &&
|
|
406
|
-
"loadPaths" in config) {
|
|
407
|
-
return config;
|
|
408
|
-
}
|
|
409
|
-
if (Object.keys(config).length === 1 &&
|
|
410
|
-
("importers" in config || "loadPaths" in config)) {
|
|
411
|
-
return config;
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
throw new Error("Return default config.");
|
|
415
|
-
})
|
|
416
|
-
.catch(() => {
|
|
417
|
-
const defaultConfig = {
|
|
418
|
-
importers: [
|
|
419
|
-
{
|
|
420
|
-
findFileUrl(url) {
|
|
421
|
-
if (!url.startsWith("sitecss:"))
|
|
422
|
-
return null;
|
|
423
|
-
const pathname = url.substring(8);
|
|
424
|
-
return pathToFileURL(`${resolvePath(srcFolder, "../css")}${pathname.startsWith("/") ? pathname : `/${pathname}`}`);
|
|
425
|
-
},
|
|
395
|
+
const defaultConfig = {
|
|
396
|
+
importers: [
|
|
397
|
+
{
|
|
398
|
+
findFileUrl(url) {
|
|
399
|
+
if (!url.startsWith("sitecss:"))
|
|
400
|
+
return null;
|
|
401
|
+
const pathname = url.substring(8);
|
|
402
|
+
return pathToFileURL(`${resolvePath(srcFolder, "../css")}${pathname.startsWith("/") ? pathname : `/${pathname}`}`);
|
|
426
403
|
},
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
}
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
findFileUrl(url) {
|
|
407
|
+
if (!url.startsWith("launchpad:"))
|
|
408
|
+
return null;
|
|
409
|
+
const pathname = url.substring(10);
|
|
410
|
+
return pathToFileURL(`${resolvePath(process.cwd(), "public/wp-content/themes/launchpad/src/styles")}${pathname.startsWith("/") ? pathname : `/${pathname}`}`);
|
|
434
411
|
},
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
return config;
|
|
412
|
+
},
|
|
413
|
+
],
|
|
414
|
+
};
|
|
415
|
+
return defaultConfig;
|
|
440
416
|
}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atomicsmash/compiler",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.0
|
|
4
|
+
"version": "3.0.0",
|
|
5
5
|
"description": "A universal compiler for all Atomic Smash projects.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"cli",
|
|
@@ -47,10 +47,10 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@atomicsmash/date-php": "^2.1.0",
|
|
50
|
-
"@
|
|
50
|
+
"@atomicsmash/smash-config": "^1.0.0",
|
|
51
|
+
"@wordpress/dependency-extraction-webpack-plugin": "^6.36.0",
|
|
51
52
|
"browserslist-to-esbuild": "^2.1.1",
|
|
52
|
-
"copy-webpack-plugin": "^
|
|
53
|
-
"cosmiconfig": "^9.0.0",
|
|
53
|
+
"copy-webpack-plugin": "^13.0.1",
|
|
54
54
|
"cssnano": "^7.1.2",
|
|
55
55
|
"esbuild-loader": "^4.4.0",
|
|
56
56
|
"fast-glob": "^3.3.3",
|
|
@@ -58,20 +58,19 @@
|
|
|
58
58
|
"json2php": "^0.0.12",
|
|
59
59
|
"postcss": "^8.5.6",
|
|
60
60
|
"postcss-loader": "^8.2.0",
|
|
61
|
-
"postcss-preset-env": "^10.
|
|
62
|
-
"sass": "^1.
|
|
61
|
+
"postcss-preset-env": "^10.5.0",
|
|
62
|
+
"sass": "^1.97.0",
|
|
63
63
|
"sass-loader": "^16.0.6",
|
|
64
|
-
"svg-spritemap-webpack-plugin": "^
|
|
64
|
+
"svg-spritemap-webpack-plugin": "^5.1.0",
|
|
65
65
|
"tsconfig-paths-webpack-plugin": "^4.2.0",
|
|
66
|
-
"tsx": "^4.
|
|
67
|
-
"webpack": "^5.
|
|
68
|
-
"webpack-assets-manifest": "^6.
|
|
69
|
-
"webpack-bundle-analyzer": "^
|
|
70
|
-
"yargs": "^
|
|
66
|
+
"tsx": "^4.21.0",
|
|
67
|
+
"webpack": "^5.104.0",
|
|
68
|
+
"webpack-assets-manifest": "^6.5.0",
|
|
69
|
+
"webpack-bundle-analyzer": "^5.1.0",
|
|
70
|
+
"yargs": "^18.0.0"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
-
"@tailwindcss/postcss": "^4.1.
|
|
74
|
-
"@types/svg-spritemap-webpack-plugin": "^4.4.4",
|
|
73
|
+
"@tailwindcss/postcss": "^4.1.18",
|
|
75
74
|
"@types/webpack": "^5.28.5",
|
|
76
75
|
"@types/webpack-assets-manifest": "^5.1.4",
|
|
77
76
|
"@types/webpack-bundle-analyzer": "^4.7.0",
|
|
@@ -81,8 +80,5 @@
|
|
|
81
80
|
},
|
|
82
81
|
"engines": {
|
|
83
82
|
"node": "^20 || >=22"
|
|
84
|
-
},
|
|
85
|
-
"peerDependencies": {
|
|
86
|
-
"@atomicsmash/cli": "^10.0.0-beta.1"
|
|
87
83
|
}
|
|
88
84
|
}
|