unplugin-atscript 0.1.69 → 0.1.70

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/esbuild.cjs CHANGED
@@ -31,13 +31,13 @@ const __atscript_typescript = __toESM(require("@atscript/typescript"));
31
31
  //#region packages/unplugin/src/index.ts
32
32
  const unpluginFactory = (opts) => {
33
33
  const root = process.cwd();
34
- const atscriptConfig = new Promise((resolve) => {
35
- (0, __atscript_core.resolveConfigFile)(root).then((p) => {
36
- (0, __atscript_core.loadConfig)(p).then(resolve);
37
- });
38
- });
39
34
  const strict = opts?.strict ?? true;
40
35
  let repo;
36
+ let configPromise;
37
+ const getConfig = () => configPromise ?? (configPromise = (async () => {
38
+ const p = await (0, __atscript_core.resolveConfigFile)(root);
39
+ return p ? (0, __atscript_core.loadConfig)(p) : {};
40
+ })());
41
41
  return {
42
42
  name: "unplugin-atscript",
43
43
  resolveId(id, importer) {
@@ -49,7 +49,7 @@ const unpluginFactory = (opts) => {
49
49
  async load(id) {
50
50
  if (id.endsWith(".as")) {
51
51
  if (!repo) {
52
- const config = await atscriptConfig;
52
+ const config = await getConfig();
53
53
  if (!config.plugins) config.plugins = [(0, __atscript_typescript.tsPlugin)()];
54
54
  repo = new __atscript_core.AtscriptRepo(root, config);
55
55
  }
package/dist/esbuild.mjs CHANGED
@@ -7,13 +7,13 @@ import { tsPlugin } from "@atscript/typescript";
7
7
  //#region packages/unplugin/src/index.ts
8
8
  const unpluginFactory = (opts) => {
9
9
  const root = process.cwd();
10
- const atscriptConfig = new Promise((resolve) => {
11
- resolveConfigFile(root).then((p) => {
12
- loadConfig(p).then(resolve);
13
- });
14
- });
15
10
  const strict = opts?.strict ?? true;
16
11
  let repo;
12
+ let configPromise;
13
+ const getConfig = () => configPromise ?? (configPromise = (async () => {
14
+ const p = await resolveConfigFile(root);
15
+ return p ? loadConfig(p) : {};
16
+ })());
17
17
  return {
18
18
  name: "unplugin-atscript",
19
19
  resolveId(id, importer) {
@@ -25,7 +25,7 @@ const unpluginFactory = (opts) => {
25
25
  async load(id) {
26
26
  if (id.endsWith(".as")) {
27
27
  if (!repo) {
28
- const config = await atscriptConfig;
28
+ const config = await getConfig();
29
29
  if (!config.plugins) config.plugins = [tsPlugin()];
30
30
  repo = new AtscriptRepo(root, config);
31
31
  }
package/dist/farm.cjs CHANGED
@@ -31,13 +31,13 @@ const __atscript_typescript = __toESM(require("@atscript/typescript"));
31
31
  //#region packages/unplugin/src/index.ts
32
32
  const unpluginFactory = (opts) => {
33
33
  const root = process.cwd();
34
- const atscriptConfig = new Promise((resolve) => {
35
- (0, __atscript_core.resolveConfigFile)(root).then((p) => {
36
- (0, __atscript_core.loadConfig)(p).then(resolve);
37
- });
38
- });
39
34
  const strict = opts?.strict ?? true;
40
35
  let repo;
36
+ let configPromise;
37
+ const getConfig = () => configPromise ?? (configPromise = (async () => {
38
+ const p = await (0, __atscript_core.resolveConfigFile)(root);
39
+ return p ? (0, __atscript_core.loadConfig)(p) : {};
40
+ })());
41
41
  return {
42
42
  name: "unplugin-atscript",
43
43
  resolveId(id, importer) {
@@ -49,7 +49,7 @@ const unpluginFactory = (opts) => {
49
49
  async load(id) {
50
50
  if (id.endsWith(".as")) {
51
51
  if (!repo) {
52
- const config = await atscriptConfig;
52
+ const config = await getConfig();
53
53
  if (!config.plugins) config.plugins = [(0, __atscript_typescript.tsPlugin)()];
54
54
  repo = new __atscript_core.AtscriptRepo(root, config);
55
55
  }
package/dist/farm.mjs CHANGED
@@ -7,13 +7,13 @@ import { tsPlugin } from "@atscript/typescript";
7
7
  //#region packages/unplugin/src/index.ts
8
8
  const unpluginFactory = (opts) => {
9
9
  const root = process.cwd();
10
- const atscriptConfig = new Promise((resolve) => {
11
- resolveConfigFile(root).then((p) => {
12
- loadConfig(p).then(resolve);
13
- });
14
- });
15
10
  const strict = opts?.strict ?? true;
16
11
  let repo;
12
+ let configPromise;
13
+ const getConfig = () => configPromise ?? (configPromise = (async () => {
14
+ const p = await resolveConfigFile(root);
15
+ return p ? loadConfig(p) : {};
16
+ })());
17
17
  return {
18
18
  name: "unplugin-atscript",
19
19
  resolveId(id, importer) {
@@ -25,7 +25,7 @@ const unpluginFactory = (opts) => {
25
25
  async load(id) {
26
26
  if (id.endsWith(".as")) {
27
27
  if (!repo) {
28
- const config = await atscriptConfig;
28
+ const config = await getConfig();
29
29
  if (!config.plugins) config.plugins = [tsPlugin()];
30
30
  repo = new AtscriptRepo(root, config);
31
31
  }
package/dist/index.cjs CHANGED
@@ -32,13 +32,13 @@ const unplugin = __toESM(require("unplugin"));
32
32
  //#region packages/unplugin/src/index.ts
33
33
  const unpluginFactory = (opts) => {
34
34
  const root = process.cwd();
35
- const atscriptConfig = new Promise((resolve) => {
36
- (0, __atscript_core.resolveConfigFile)(root).then((p) => {
37
- (0, __atscript_core.loadConfig)(p).then(resolve);
38
- });
39
- });
40
35
  const strict = opts?.strict ?? true;
41
36
  let repo;
37
+ let configPromise;
38
+ const getConfig = () => configPromise ?? (configPromise = (async () => {
39
+ const p = await (0, __atscript_core.resolveConfigFile)(root);
40
+ return p ? (0, __atscript_core.loadConfig)(p) : {};
41
+ })());
42
42
  return {
43
43
  name: "unplugin-atscript",
44
44
  resolveId(id, importer) {
@@ -50,7 +50,7 @@ const unpluginFactory = (opts) => {
50
50
  async load(id) {
51
51
  if (id.endsWith(".as")) {
52
52
  if (!repo) {
53
- const config = await atscriptConfig;
53
+ const config = await getConfig();
54
54
  if (!config.plugins) config.plugins = [(0, __atscript_typescript.tsPlugin)()];
55
55
  repo = new __atscript_core.AtscriptRepo(root, config);
56
56
  }
package/dist/index.mjs CHANGED
@@ -7,13 +7,13 @@ import { createUnplugin } from "unplugin";
7
7
  //#region packages/unplugin/src/index.ts
8
8
  const unpluginFactory = (opts) => {
9
9
  const root = process.cwd();
10
- const atscriptConfig = new Promise((resolve) => {
11
- resolveConfigFile(root).then((p) => {
12
- loadConfig(p).then(resolve);
13
- });
14
- });
15
10
  const strict = opts?.strict ?? true;
16
11
  let repo;
12
+ let configPromise;
13
+ const getConfig = () => configPromise ?? (configPromise = (async () => {
14
+ const p = await resolveConfigFile(root);
15
+ return p ? loadConfig(p) : {};
16
+ })());
17
17
  return {
18
18
  name: "unplugin-atscript",
19
19
  resolveId(id, importer) {
@@ -25,7 +25,7 @@ const unpluginFactory = (opts) => {
25
25
  async load(id) {
26
26
  if (id.endsWith(".as")) {
27
27
  if (!repo) {
28
- const config = await atscriptConfig;
28
+ const config = await getConfig();
29
29
  if (!config.plugins) config.plugins = [tsPlugin()];
30
30
  repo = new AtscriptRepo(root, config);
31
31
  }
package/dist/rolldown.cjs CHANGED
@@ -31,13 +31,13 @@ const __atscript_typescript = __toESM(require("@atscript/typescript"));
31
31
  //#region packages/unplugin/src/index.ts
32
32
  const unpluginFactory = (opts) => {
33
33
  const root = process.cwd();
34
- const atscriptConfig = new Promise((resolve) => {
35
- (0, __atscript_core.resolveConfigFile)(root).then((p) => {
36
- (0, __atscript_core.loadConfig)(p).then(resolve);
37
- });
38
- });
39
34
  const strict = opts?.strict ?? true;
40
35
  let repo;
36
+ let configPromise;
37
+ const getConfig = () => configPromise ?? (configPromise = (async () => {
38
+ const p = await (0, __atscript_core.resolveConfigFile)(root);
39
+ return p ? (0, __atscript_core.loadConfig)(p) : {};
40
+ })());
41
41
  return {
42
42
  name: "unplugin-atscript",
43
43
  resolveId(id, importer) {
@@ -49,7 +49,7 @@ const unpluginFactory = (opts) => {
49
49
  async load(id) {
50
50
  if (id.endsWith(".as")) {
51
51
  if (!repo) {
52
- const config = await atscriptConfig;
52
+ const config = await getConfig();
53
53
  if (!config.plugins) config.plugins = [(0, __atscript_typescript.tsPlugin)()];
54
54
  repo = new __atscript_core.AtscriptRepo(root, config);
55
55
  }
package/dist/rolldown.mjs CHANGED
@@ -7,13 +7,13 @@ import { tsPlugin } from "@atscript/typescript";
7
7
  //#region packages/unplugin/src/index.ts
8
8
  const unpluginFactory = (opts) => {
9
9
  const root = process.cwd();
10
- const atscriptConfig = new Promise((resolve) => {
11
- resolveConfigFile(root).then((p) => {
12
- loadConfig(p).then(resolve);
13
- });
14
- });
15
10
  const strict = opts?.strict ?? true;
16
11
  let repo;
12
+ let configPromise;
13
+ const getConfig = () => configPromise ?? (configPromise = (async () => {
14
+ const p = await resolveConfigFile(root);
15
+ return p ? loadConfig(p) : {};
16
+ })());
17
17
  return {
18
18
  name: "unplugin-atscript",
19
19
  resolveId(id, importer) {
@@ -25,7 +25,7 @@ const unpluginFactory = (opts) => {
25
25
  async load(id) {
26
26
  if (id.endsWith(".as")) {
27
27
  if (!repo) {
28
- const config = await atscriptConfig;
28
+ const config = await getConfig();
29
29
  if (!config.plugins) config.plugins = [tsPlugin()];
30
30
  repo = new AtscriptRepo(root, config);
31
31
  }
package/dist/rollup.cjs CHANGED
@@ -31,13 +31,13 @@ const __atscript_typescript = __toESM(require("@atscript/typescript"));
31
31
  //#region packages/unplugin/src/index.ts
32
32
  const unpluginFactory = (opts) => {
33
33
  const root = process.cwd();
34
- const atscriptConfig = new Promise((resolve) => {
35
- (0, __atscript_core.resolveConfigFile)(root).then((p) => {
36
- (0, __atscript_core.loadConfig)(p).then(resolve);
37
- });
38
- });
39
34
  const strict = opts?.strict ?? true;
40
35
  let repo;
36
+ let configPromise;
37
+ const getConfig = () => configPromise ?? (configPromise = (async () => {
38
+ const p = await (0, __atscript_core.resolveConfigFile)(root);
39
+ return p ? (0, __atscript_core.loadConfig)(p) : {};
40
+ })());
41
41
  return {
42
42
  name: "unplugin-atscript",
43
43
  resolveId(id, importer) {
@@ -49,7 +49,7 @@ const unpluginFactory = (opts) => {
49
49
  async load(id) {
50
50
  if (id.endsWith(".as")) {
51
51
  if (!repo) {
52
- const config = await atscriptConfig;
52
+ const config = await getConfig();
53
53
  if (!config.plugins) config.plugins = [(0, __atscript_typescript.tsPlugin)()];
54
54
  repo = new __atscript_core.AtscriptRepo(root, config);
55
55
  }
package/dist/rollup.mjs CHANGED
@@ -7,13 +7,13 @@ import { tsPlugin } from "@atscript/typescript";
7
7
  //#region packages/unplugin/src/index.ts
8
8
  const unpluginFactory = (opts) => {
9
9
  const root = process.cwd();
10
- const atscriptConfig = new Promise((resolve) => {
11
- resolveConfigFile(root).then((p) => {
12
- loadConfig(p).then(resolve);
13
- });
14
- });
15
10
  const strict = opts?.strict ?? true;
16
11
  let repo;
12
+ let configPromise;
13
+ const getConfig = () => configPromise ?? (configPromise = (async () => {
14
+ const p = await resolveConfigFile(root);
15
+ return p ? loadConfig(p) : {};
16
+ })());
17
17
  return {
18
18
  name: "unplugin-atscript",
19
19
  resolveId(id, importer) {
@@ -25,7 +25,7 @@ const unpluginFactory = (opts) => {
25
25
  async load(id) {
26
26
  if (id.endsWith(".as")) {
27
27
  if (!repo) {
28
- const config = await atscriptConfig;
28
+ const config = await getConfig();
29
29
  if (!config.plugins) config.plugins = [tsPlugin()];
30
30
  repo = new AtscriptRepo(root, config);
31
31
  }
package/dist/rspack.cjs CHANGED
@@ -31,13 +31,13 @@ const __atscript_typescript = __toESM(require("@atscript/typescript"));
31
31
  //#region packages/unplugin/src/index.ts
32
32
  const unpluginFactory = (opts) => {
33
33
  const root = process.cwd();
34
- const atscriptConfig = new Promise((resolve) => {
35
- (0, __atscript_core.resolveConfigFile)(root).then((p) => {
36
- (0, __atscript_core.loadConfig)(p).then(resolve);
37
- });
38
- });
39
34
  const strict = opts?.strict ?? true;
40
35
  let repo;
36
+ let configPromise;
37
+ const getConfig = () => configPromise ?? (configPromise = (async () => {
38
+ const p = await (0, __atscript_core.resolveConfigFile)(root);
39
+ return p ? (0, __atscript_core.loadConfig)(p) : {};
40
+ })());
41
41
  return {
42
42
  name: "unplugin-atscript",
43
43
  resolveId(id, importer) {
@@ -49,7 +49,7 @@ const unpluginFactory = (opts) => {
49
49
  async load(id) {
50
50
  if (id.endsWith(".as")) {
51
51
  if (!repo) {
52
- const config = await atscriptConfig;
52
+ const config = await getConfig();
53
53
  if (!config.plugins) config.plugins = [(0, __atscript_typescript.tsPlugin)()];
54
54
  repo = new __atscript_core.AtscriptRepo(root, config);
55
55
  }
package/dist/rspack.mjs CHANGED
@@ -7,13 +7,13 @@ import { tsPlugin } from "@atscript/typescript";
7
7
  //#region packages/unplugin/src/index.ts
8
8
  const unpluginFactory = (opts) => {
9
9
  const root = process.cwd();
10
- const atscriptConfig = new Promise((resolve) => {
11
- resolveConfigFile(root).then((p) => {
12
- loadConfig(p).then(resolve);
13
- });
14
- });
15
10
  const strict = opts?.strict ?? true;
16
11
  let repo;
12
+ let configPromise;
13
+ const getConfig = () => configPromise ?? (configPromise = (async () => {
14
+ const p = await resolveConfigFile(root);
15
+ return p ? loadConfig(p) : {};
16
+ })());
17
17
  return {
18
18
  name: "unplugin-atscript",
19
19
  resolveId(id, importer) {
@@ -25,7 +25,7 @@ const unpluginFactory = (opts) => {
25
25
  async load(id) {
26
26
  if (id.endsWith(".as")) {
27
27
  if (!repo) {
28
- const config = await atscriptConfig;
28
+ const config = await getConfig();
29
29
  if (!config.plugins) config.plugins = [tsPlugin()];
30
30
  repo = new AtscriptRepo(root, config);
31
31
  }
package/dist/vite.cjs CHANGED
@@ -31,13 +31,13 @@ const __atscript_typescript = __toESM(require("@atscript/typescript"));
31
31
  //#region packages/unplugin/src/index.ts
32
32
  const unpluginFactory = (opts) => {
33
33
  const root = process.cwd();
34
- const atscriptConfig = new Promise((resolve) => {
35
- (0, __atscript_core.resolveConfigFile)(root).then((p) => {
36
- (0, __atscript_core.loadConfig)(p).then(resolve);
37
- });
38
- });
39
34
  const strict = opts?.strict ?? true;
40
35
  let repo;
36
+ let configPromise;
37
+ const getConfig = () => configPromise ?? (configPromise = (async () => {
38
+ const p = await (0, __atscript_core.resolveConfigFile)(root);
39
+ return p ? (0, __atscript_core.loadConfig)(p) : {};
40
+ })());
41
41
  return {
42
42
  name: "unplugin-atscript",
43
43
  resolveId(id, importer) {
@@ -49,7 +49,7 @@ const unpluginFactory = (opts) => {
49
49
  async load(id) {
50
50
  if (id.endsWith(".as")) {
51
51
  if (!repo) {
52
- const config = await atscriptConfig;
52
+ const config = await getConfig();
53
53
  if (!config.plugins) config.plugins = [(0, __atscript_typescript.tsPlugin)()];
54
54
  repo = new __atscript_core.AtscriptRepo(root, config);
55
55
  }
package/dist/vite.mjs CHANGED
@@ -7,13 +7,13 @@ import { tsPlugin } from "@atscript/typescript";
7
7
  //#region packages/unplugin/src/index.ts
8
8
  const unpluginFactory = (opts) => {
9
9
  const root = process.cwd();
10
- const atscriptConfig = new Promise((resolve) => {
11
- resolveConfigFile(root).then((p) => {
12
- loadConfig(p).then(resolve);
13
- });
14
- });
15
10
  const strict = opts?.strict ?? true;
16
11
  let repo;
12
+ let configPromise;
13
+ const getConfig = () => configPromise ?? (configPromise = (async () => {
14
+ const p = await resolveConfigFile(root);
15
+ return p ? loadConfig(p) : {};
16
+ })());
17
17
  return {
18
18
  name: "unplugin-atscript",
19
19
  resolveId(id, importer) {
@@ -25,7 +25,7 @@ const unpluginFactory = (opts) => {
25
25
  async load(id) {
26
26
  if (id.endsWith(".as")) {
27
27
  if (!repo) {
28
- const config = await atscriptConfig;
28
+ const config = await getConfig();
29
29
  if (!config.plugins) config.plugins = [tsPlugin()];
30
30
  repo = new AtscriptRepo(root, config);
31
31
  }
package/dist/webpack.cjs CHANGED
@@ -31,13 +31,13 @@ const __atscript_typescript = __toESM(require("@atscript/typescript"));
31
31
  //#region packages/unplugin/src/index.ts
32
32
  const unpluginFactory = (opts) => {
33
33
  const root = process.cwd();
34
- const atscriptConfig = new Promise((resolve) => {
35
- (0, __atscript_core.resolveConfigFile)(root).then((p) => {
36
- (0, __atscript_core.loadConfig)(p).then(resolve);
37
- });
38
- });
39
34
  const strict = opts?.strict ?? true;
40
35
  let repo;
36
+ let configPromise;
37
+ const getConfig = () => configPromise ?? (configPromise = (async () => {
38
+ const p = await (0, __atscript_core.resolveConfigFile)(root);
39
+ return p ? (0, __atscript_core.loadConfig)(p) : {};
40
+ })());
41
41
  return {
42
42
  name: "unplugin-atscript",
43
43
  resolveId(id, importer) {
@@ -49,7 +49,7 @@ const unpluginFactory = (opts) => {
49
49
  async load(id) {
50
50
  if (id.endsWith(".as")) {
51
51
  if (!repo) {
52
- const config = await atscriptConfig;
52
+ const config = await getConfig();
53
53
  if (!config.plugins) config.plugins = [(0, __atscript_typescript.tsPlugin)()];
54
54
  repo = new __atscript_core.AtscriptRepo(root, config);
55
55
  }
package/dist/webpack.mjs CHANGED
@@ -7,13 +7,13 @@ import { tsPlugin } from "@atscript/typescript";
7
7
  //#region packages/unplugin/src/index.ts
8
8
  const unpluginFactory = (opts) => {
9
9
  const root = process.cwd();
10
- const atscriptConfig = new Promise((resolve) => {
11
- resolveConfigFile(root).then((p) => {
12
- loadConfig(p).then(resolve);
13
- });
14
- });
15
10
  const strict = opts?.strict ?? true;
16
11
  let repo;
12
+ let configPromise;
13
+ const getConfig = () => configPromise ?? (configPromise = (async () => {
14
+ const p = await resolveConfigFile(root);
15
+ return p ? loadConfig(p) : {};
16
+ })());
17
17
  return {
18
18
  name: "unplugin-atscript",
19
19
  resolveId(id, importer) {
@@ -25,7 +25,7 @@ const unpluginFactory = (opts) => {
25
25
  async load(id) {
26
26
  if (id.endsWith(".as")) {
27
27
  if (!repo) {
28
- const config = await atscriptConfig;
28
+ const config = await getConfig();
29
29
  if (!config.plugins) config.plugins = [tsPlugin()];
30
30
  repo = new AtscriptRepo(root, config);
31
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unplugin-atscript",
3
- "version": "0.1.69",
3
+ "version": "0.1.70",
4
4
  "description": "Atscript: Configuration and build plugins.",
5
5
  "keywords": [
6
6
  "annotations",
@@ -80,8 +80,8 @@
80
80
  "vitest": "3.2.4"
81
81
  },
82
82
  "peerDependencies": {
83
- "@atscript/core": "^0.1.69",
84
- "@atscript/typescript": "^0.1.69"
83
+ "@atscript/core": "^0.1.70",
84
+ "@atscript/typescript": "^0.1.70"
85
85
  },
86
86
  "build": [
87
87
  {},