unplugin-atscript 0.0.32 → 0.1.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/index.cjs CHANGED
@@ -62,10 +62,12 @@ const atscriptPluginFactory = (opts) => {
62
62
  } else if (m.severity === 2) console.log(doc.renderDiagMessage(m, false, true));
63
63
  if (error) throw new Error(error);
64
64
  const out = await doc.render("js");
65
+ const hasMutatingAnnotates = doc.nodes.some((n) => (0, __atscript_core.isAnnotate)(n) && n.isMutating);
65
66
  return {
66
67
  code: out?.[0]?.content || "",
67
68
  moduleType: "js",
68
- map: null
69
+ map: null,
70
+ moduleSideEffects: hasMutatingAnnotates ? undefined : false
69
71
  };
70
72
  }
71
73
  }
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import path from "path";
2
- import { AtscriptRepo, loadConfig, resolveConfigFile } from "@atscript/core";
2
+ import { AtscriptRepo, isAnnotate, loadConfig, resolveConfigFile } from "@atscript/core";
3
3
  import ts from "@atscript/typescript";
4
4
  import { readFile } from "fs/promises";
5
5
  import { createUnplugin } from "unplugin";
@@ -37,10 +37,12 @@ const atscriptPluginFactory = (opts) => {
37
37
  } else if (m.severity === 2) console.log(doc.renderDiagMessage(m, false, true));
38
38
  if (error) throw new Error(error);
39
39
  const out = await doc.render("js");
40
+ const hasMutatingAnnotates = doc.nodes.some((n) => isAnnotate(n) && n.isMutating);
40
41
  return {
41
42
  code: out?.[0]?.content || "",
42
43
  moduleType: "js",
43
- map: null
44
+ map: null,
45
+ moduleSideEffects: hasMutatingAnnotates ? undefined : false
44
46
  };
45
47
  }
46
48
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unplugin-atscript",
3
- "version": "0.0.32",
3
+ "version": "0.1.0",
4
4
  "description": "Atscript: Configuration and build plugins.",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",
@@ -42,8 +42,8 @@
42
42
  "vitest": "3.2.4"
43
43
  },
44
44
  "peerDependencies": {
45
- "@atscript/core": "^0.0.32",
46
- "@atscript/typescript": "^0.0.32"
45
+ "@atscript/typescript": "^0.1.0",
46
+ "@atscript/core": "^0.1.0"
47
47
  },
48
48
  "scripts": {
49
49
  "pub": "pnpm publish --access public",