@atomicsmash/compiler 0.8.2 → 0.9.1

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 CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { cosmiconfig } from "cosmiconfig";
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";
@@ -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
- if (!config) {
46
- return await defaultConfig({ ...argv });
47
- }
48
- return config.config;
49
- });
50
- const compiler = webpack(config);
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
@@ -104,11 +104,17 @@ export declare function config(options: {
104
104
  }> | typeof import("tailwindcss").default | import("postcss").Plugin)[] | typeof cssNano)[];
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
  })[];
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,QAAQ,EAAe,MAAM,SAAS,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S,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: { sourceMap: MODE === "development" },
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
  },
@@ -300,7 +314,7 @@ export async function config(options) {
300
314
  if (entry.key.startsWith("css/")) {
301
315
  entry.key = entry.key.replace("css/", "styles/");
302
316
  }
303
- if (entry.key.endsWith(".js.js")) {
317
+ if (entry.key.endsWith(".js")) {
304
318
  entry.key = entry.key.slice(0, -3);
305
319
  }
306
320
  return entry;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,2 @@
1
- export { config } from "./config";
2
- export { config as default } from "./config";
1
+ export {};
3
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,UAAU,CAAC"}
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 { config } from "./config";
2
- export { config as default } from "./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.8.2",
4
+ "version": "0.9.1",
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
- "main": "index",
26
+ "exports": {
27
+ ".": "./dist/index.js"
28
+ },
27
29
  "bin": {
28
30
  "smash-compile": "./dist/cli.js"
29
31
  },