@atomicsmash/compiler 4.0.0 → 5.0.0-beta.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 +3 -10
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +3 -38
- package/package.json +13 -13
package/dist/config.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { SCSSAliases } from "@atomicsmash/smash-config";
|
|
2
1
|
import type { PathData } from "webpack";
|
|
3
2
|
import DependencyExtractionWebpackPlugin from "@wordpress/dependency-extraction-webpack-plugin";
|
|
4
3
|
import CopyPlugin from "copy-webpack-plugin";
|
|
@@ -63,7 +62,7 @@ export declare function config(options: {
|
|
|
63
62
|
use: {
|
|
64
63
|
loader: string;
|
|
65
64
|
options: {
|
|
66
|
-
loader: "
|
|
65
|
+
loader: "ts" | "default";
|
|
67
66
|
target: string[];
|
|
68
67
|
tsconfig: string;
|
|
69
68
|
};
|
|
@@ -108,13 +107,7 @@ export declare function config(options: {
|
|
|
108
107
|
options: {
|
|
109
108
|
postcssOptions: {
|
|
110
109
|
sourceMap: boolean;
|
|
111
|
-
plugins: (typeof cssNano | (import("postcss").Processor | import("postcss").PluginCreator<
|
|
112
|
-
base?: string;
|
|
113
|
-
optimize?: boolean | {
|
|
114
|
-
minify?: boolean;
|
|
115
|
-
};
|
|
116
|
-
transformAssetUrls?: boolean;
|
|
117
|
-
}> | typeof import("tailwindcss").default | import("postcss").Plugin)[])[];
|
|
110
|
+
plugins: (typeof cssNano | (import("postcss").Processor | import("postcss").PluginCreator<import("@tailwindcss/postcss").PluginOptions> | typeof import("tailwindcss").default | import("postcss").Plugin)[])[];
|
|
118
111
|
};
|
|
119
112
|
sourceMap?: undefined;
|
|
120
113
|
sassOptions?: undefined;
|
|
@@ -123,7 +116,7 @@ export declare function config(options: {
|
|
|
123
116
|
loader: string;
|
|
124
117
|
options: {
|
|
125
118
|
sourceMap: boolean;
|
|
126
|
-
sassOptions: SCSSAliases;
|
|
119
|
+
sassOptions: import("@atomicsmash/smash-config").SCSSAliases;
|
|
127
120
|
postcssOptions?: undefined;
|
|
128
121
|
};
|
|
129
122
|
})[];
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,QAAQ,EAAe,MAAM,SAAS,CAAC;AASpE,OAAO,iCAAiC,MAAM,iDAAiD,CAAC;AAEhG,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAG/C,OAAO,kBAAkB,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,wBAAsB,MAAM,CAAC,OAAO,EAAE;IACrC;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;CACrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yCAkM4B,QAAQ;;;;;;;;;;;;;;;qCAeV,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwMlC"}
|
package/dist/config.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { sep as pathSeparator, extname, resolve as resolvePath, relative, join, } from "node:path";
|
|
2
|
-
import { pathToFileURL } from "node:url";
|
|
3
2
|
import { getSmashConfig } from "@atomicsmash/smash-config";
|
|
4
3
|
import DependencyExtractionWebpackPlugin from "@wordpress/dependency-extraction-webpack-plugin";
|
|
5
4
|
import browserslistToEsbuild from "browserslist-to-esbuild";
|
|
@@ -28,17 +27,10 @@ export async function config(options) {
|
|
|
28
27
|
: "production";
|
|
29
28
|
const srcFolder = argv.in
|
|
30
29
|
? resolvePath(argv.in)
|
|
31
|
-
: smashConfig
|
|
32
|
-
? resolvePath(join(smashConfig.themePath, "src"))
|
|
33
|
-
: null;
|
|
30
|
+
: resolvePath(join(smashConfig.themePath, "src"));
|
|
34
31
|
const distFolder = argv.out
|
|
35
32
|
? resolvePath(argv.out)
|
|
36
|
-
: smashConfig
|
|
37
|
-
? resolvePath(join(smashConfig.themePath, smashConfig.assetsOutputFolder))
|
|
38
|
-
: null;
|
|
39
|
-
if (!srcFolder || !distFolder) {
|
|
40
|
-
throw new Error("Failed to get the in or out folders for the blocks. Please add a smash.config.ts file to your project with a themeName and a themePath.");
|
|
41
|
-
}
|
|
33
|
+
: resolvePath(join(smashConfig.themePath, smashConfig.assetsOutputFolder));
|
|
42
34
|
// Add optional support for Tailwind if tailwind postcss plugin is installed
|
|
43
35
|
const tailwindPostCSSPlugin = await import("@tailwindcss/postcss")
|
|
44
36
|
.then((tailwindPostCSS) => [tailwindPostCSS.default])
|
|
@@ -250,7 +242,7 @@ export async function config(options) {
|
|
|
250
242
|
loader: "sass-loader",
|
|
251
243
|
options: {
|
|
252
244
|
sourceMap: MODE === "development",
|
|
253
|
-
sassOptions:
|
|
245
|
+
sassOptions: smashConfig.scssAliases,
|
|
254
246
|
},
|
|
255
247
|
},
|
|
256
248
|
],
|
|
@@ -398,30 +390,3 @@ export async function config(options) {
|
|
|
398
390
|
},
|
|
399
391
|
};
|
|
400
392
|
}
|
|
401
|
-
async function getSassOptions(srcFolder) {
|
|
402
|
-
const smashConfig = await getSmashConfig();
|
|
403
|
-
if (smashConfig) {
|
|
404
|
-
return smashConfig.scssAliases;
|
|
405
|
-
}
|
|
406
|
-
const defaultConfig = {
|
|
407
|
-
importers: [
|
|
408
|
-
{
|
|
409
|
-
findFileUrl(url) {
|
|
410
|
-
if (!url.startsWith("sitecss:"))
|
|
411
|
-
return null;
|
|
412
|
-
const pathname = url.substring(8);
|
|
413
|
-
return pathToFileURL(`${resolvePath(srcFolder, "../css")}${pathname.startsWith("/") ? pathname : `/${pathname}`}`);
|
|
414
|
-
},
|
|
415
|
-
},
|
|
416
|
-
{
|
|
417
|
-
findFileUrl(url) {
|
|
418
|
-
if (!url.startsWith("launchpad:"))
|
|
419
|
-
return null;
|
|
420
|
-
const pathname = url.substring(10);
|
|
421
|
-
return pathToFileURL(`${resolvePath(process.cwd(), "public/wp-content/themes/launchpad/src/styles")}${pathname.startsWith("/") ? pathname : `/${pathname}`}`);
|
|
422
|
-
},
|
|
423
|
-
},
|
|
424
|
-
],
|
|
425
|
-
};
|
|
426
|
-
return defaultConfig;
|
|
427
|
-
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atomicsmash/compiler",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "5.0.0-beta.0",
|
|
5
5
|
"description": "A universal compiler for all Atomic Smash projects.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"cli",
|
|
@@ -47,34 +47,34 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@atomicsmash/date-php": "^2.2.0",
|
|
50
|
-
"@atomicsmash/smash-config": "^
|
|
51
|
-
"@wordpress/dependency-extraction-webpack-plugin": "^6.
|
|
50
|
+
"@atomicsmash/smash-config": "^2.0.0-beta.0",
|
|
51
|
+
"@wordpress/dependency-extraction-webpack-plugin": "^6.48.1",
|
|
52
52
|
"browserslist-to-esbuild": "^2.1.1",
|
|
53
53
|
"copy-webpack-plugin": "^14.0.0",
|
|
54
|
-
"
|
|
55
|
-
"esbuild-loader": "^4.4.2",
|
|
54
|
+
"esbuild-loader": "^4.5.0",
|
|
56
55
|
"fast-glob": "^3.3.3",
|
|
57
56
|
"json-loader": "^0.5.7",
|
|
58
57
|
"json2php": "^0.0.12",
|
|
59
58
|
"postcss": "^8.5.8",
|
|
60
59
|
"postcss-loader": "^8.2.1",
|
|
61
|
-
"postcss-preset-env": "^11.
|
|
62
|
-
"sass": "^1.
|
|
63
|
-
"sass-loader": "^16.0.7",
|
|
60
|
+
"postcss-preset-env": "^11.3.1",
|
|
61
|
+
"sass": "^1.101.0",
|
|
64
62
|
"svg-spritemap-webpack-plugin": "^5.1.0",
|
|
65
63
|
"tsconfig-paths-webpack-plugin": "^4.2.0",
|
|
66
|
-
"tsx": "^4.
|
|
67
|
-
"webpack": "^5.
|
|
68
|
-
"webpack-assets-manifest": "^6.5.
|
|
69
|
-
"webpack-bundle-analyzer": "^5.
|
|
64
|
+
"tsx": "^4.22.4",
|
|
65
|
+
"webpack": "^5.107.2",
|
|
66
|
+
"webpack-assets-manifest": "^6.5.2",
|
|
67
|
+
"webpack-bundle-analyzer": "^5.3.0",
|
|
70
68
|
"yargs": "^18.0.0"
|
|
71
69
|
},
|
|
72
70
|
"devDependencies": {
|
|
73
|
-
"@tailwindcss/postcss": "^4.
|
|
71
|
+
"@tailwindcss/postcss": "^4.3.1",
|
|
74
72
|
"@types/webpack": "^5.28.5",
|
|
75
73
|
"@types/webpack-assets-manifest": "^5.1.4",
|
|
76
74
|
"@types/webpack-bundle-analyzer": "^4.7.0",
|
|
77
75
|
"@types/yargs": "^17.0.35",
|
|
76
|
+
"cssnano": "^8.0.2",
|
|
77
|
+
"sass-loader": "^17.0.0",
|
|
78
78
|
"tailwindcss": "^4.0.9",
|
|
79
79
|
"vue-loader": "^17.4.2"
|
|
80
80
|
},
|