@atomicsmash/compiler 0.8.1 → 0.9.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/cli.js +11 -10
- package/dist/config.d.ts +11 -5
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +16 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/package.json +4 -2
package/dist/cli.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
// import type { Configuration } from "webpack";
|
|
3
|
+
// import { cosmiconfig } from "cosmiconfig";
|
|
3
4
|
import webpack from "webpack";
|
|
4
5
|
import yargs from "yargs";
|
|
5
6
|
import { hideBin } from "yargs/helpers";
|
|
6
|
-
import { config as defaultConfig } from "./config";
|
|
7
|
+
import { config as defaultConfig } from "./config.js";
|
|
7
8
|
const argv = await yargs(hideBin(process.argv))
|
|
8
9
|
.options({
|
|
9
10
|
in: {
|
|
@@ -40,14 +41,14 @@ const argv = await yargs(hideBin(process.argv))
|
|
|
40
41
|
})
|
|
41
42
|
.showHelpOnFail(false, "Specify --help for available options")
|
|
42
43
|
.parse();
|
|
43
|
-
const explorer = cosmiconfig("smash-compiler");
|
|
44
|
-
const config = await explorer.search().then(async (config) => {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
});
|
|
50
|
-
const compiler = webpack(
|
|
44
|
+
// const explorer = cosmiconfig("smash-compiler");
|
|
45
|
+
// const config = await explorer.search().then(async (config) => {
|
|
46
|
+
// if (!config) {
|
|
47
|
+
// return await defaultConfig({ ...argv });
|
|
48
|
+
// }
|
|
49
|
+
// return config.config as Configuration;
|
|
50
|
+
// });
|
|
51
|
+
const compiler = webpack(await defaultConfig({ ...argv }));
|
|
51
52
|
if (argv.watch) {
|
|
52
53
|
const watching = compiler.watch({
|
|
53
54
|
// Example
|
package/dist/config.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ export declare function config(options: {
|
|
|
40
40
|
};
|
|
41
41
|
devtool: false | "source-map";
|
|
42
42
|
mode: "production" | "development";
|
|
43
|
-
entry: string | string[] | (() => string | webpack.EntryObject | string[] | Promise<string | string[] | webpack.EntryObject>) |
|
|
43
|
+
entry: string | string[] | webpack.EntryObject | (() => string | webpack.EntryObject | string[] | Promise<string | string[] | webpack.EntryObject>) | undefined;
|
|
44
44
|
output: {
|
|
45
45
|
filename: string;
|
|
46
46
|
clean: true;
|
|
@@ -64,7 +64,7 @@ export declare function config(options: {
|
|
|
64
64
|
use: {
|
|
65
65
|
loader: string;
|
|
66
66
|
options: {
|
|
67
|
-
loader: "
|
|
67
|
+
loader: "default" | "ts";
|
|
68
68
|
target: string[];
|
|
69
69
|
tsconfig: string;
|
|
70
70
|
};
|
|
@@ -96,25 +96,31 @@ export declare function config(options: {
|
|
|
96
96
|
options: {
|
|
97
97
|
postcssOptions: {
|
|
98
98
|
sourceMap: boolean;
|
|
99
|
-
plugins: ((import("postcss").Processor | import("postcss").PluginCreator<{
|
|
99
|
+
plugins: (typeof cssNano | (import("postcss").Processor | import("postcss").PluginCreator<{
|
|
100
100
|
base?: string;
|
|
101
101
|
optimize?: boolean | {
|
|
102
102
|
minify?: boolean;
|
|
103
103
|
};
|
|
104
|
-
}> | typeof import("tailwindcss").default | import("postcss").Plugin)[]
|
|
104
|
+
}> | typeof import("tailwindcss").default | import("postcss").Plugin)[])[];
|
|
105
105
|
};
|
|
106
106
|
sourceMap?: undefined;
|
|
107
|
+
sassOptions?: undefined;
|
|
107
108
|
};
|
|
108
109
|
} | {
|
|
109
110
|
loader: string;
|
|
110
111
|
options: {
|
|
111
112
|
sourceMap: boolean;
|
|
113
|
+
sassOptions: {
|
|
114
|
+
importers: {
|
|
115
|
+
findFileUrl(url: string): import("url").URL | null;
|
|
116
|
+
}[];
|
|
117
|
+
};
|
|
112
118
|
postcssOptions?: undefined;
|
|
113
119
|
};
|
|
114
120
|
})[];
|
|
115
121
|
})[];
|
|
116
122
|
};
|
|
117
|
-
plugins: (import("vue-loader").VueLoaderPlugin | webpack.ProgressPlugin | WebpackAssetsManifest |
|
|
123
|
+
plugins: (BlocksPlugin | DependencyExtractionWebpackPlugin | CopyPlugin | SVGSpritemapPlugin | import("vue-loader").VueLoaderPlugin | webpack.ProgressPlugin | WebpackAssetsManifest | BundleAnalyzerPlugin | webpack.DefinePlugin)[];
|
|
118
124
|
optimization: {
|
|
119
125
|
minimizer: EsbuildPlugin[];
|
|
120
126
|
};
|
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,EAAiB,QAAQ,EAAe,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,QAAQ,EAAe,MAAM,SAAS,CAAC;AAQpE,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,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B;;OAEG;IACH,yBAAyB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAChD;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;CACrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCA6K6B,QAAQ;;;;;;;;;;;qCAeX,QAAQ;;;;;;;;;;sCAxOrB,CAAC;;;;;;;;;;;;;6CAuRa,MAAM;;;;;;;;;;;;GA0JjC"}
|
package/dist/config.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { sep as pathSeparator, extname, resolve as resolvePath, relative, } from "node:path";
|
|
2
|
+
import { pathToFileURL } from "node:url";
|
|
2
3
|
import DependencyExtractionWebpackPlugin from "@wordpress/dependency-extraction-webpack-plugin";
|
|
3
4
|
import browserslistToEsbuild from "browserslist-to-esbuild";
|
|
4
5
|
import CopyPlugin from "copy-webpack-plugin";
|
|
@@ -13,7 +14,6 @@ import { WebpackAssetsManifest } from "webpack-assets-manifest";
|
|
|
13
14
|
import { BundleAnalyzerPlugin } from "webpack-bundle-analyzer";
|
|
14
15
|
import { BlocksPlugin } from "./BlocksPlugin.js";
|
|
15
16
|
import { getBlocksAssetsEntryPoints } from "./getBlocksAssetsEntryPoints.js";
|
|
16
|
-
// ArgumentsCamelCase<Awaited<ReturnType<typeof builder>["argv"]>>
|
|
17
17
|
export async function config(options) {
|
|
18
18
|
const argv = {
|
|
19
19
|
watch: false,
|
|
@@ -223,7 +223,21 @@ export async function config(options) {
|
|
|
223
223
|
},
|
|
224
224
|
{
|
|
225
225
|
loader: "sass-loader",
|
|
226
|
-
options: {
|
|
226
|
+
options: {
|
|
227
|
+
sourceMap: MODE === "development",
|
|
228
|
+
sassOptions: {
|
|
229
|
+
importers: [
|
|
230
|
+
{
|
|
231
|
+
findFileUrl(url) {
|
|
232
|
+
if (!url.startsWith("sitecss:"))
|
|
233
|
+
return null;
|
|
234
|
+
const pathname = url.substring(8);
|
|
235
|
+
return pathToFileURL(`${srcFolder}/styles${pathname.startsWith("/") ? pathname : `/${pathname}`}`);
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
],
|
|
239
|
+
},
|
|
240
|
+
},
|
|
227
241
|
},
|
|
228
242
|
],
|
|
229
243
|
},
|
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
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { config
|
|
1
|
+
export {};
|
|
2
|
+
// export { config } from "./config";
|
|
3
|
+
// export { config as default } from "./config";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atomicsmash/compiler",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.9.0",
|
|
5
5
|
"description": "A universal compiler for all Atomic Smash projects.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"cli",
|
|
@@ -23,7 +23,9 @@
|
|
|
23
23
|
"files": [
|
|
24
24
|
"./dist/**/*"
|
|
25
25
|
],
|
|
26
|
-
"
|
|
26
|
+
"exports": {
|
|
27
|
+
".": "./dist/index.js"
|
|
28
|
+
},
|
|
27
29
|
"bin": {
|
|
28
30
|
"smash-compile": "./dist/cli.js"
|
|
29
31
|
},
|