@atscript/typescript 0.1.75 → 0.1.76

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.
@@ -19,7 +19,11 @@ async function prepareFixtures(options) {
19
19
  })));
20
20
  for (const files of results) for (const file of files) {
21
21
  const target = file.target ?? path.default.join(rootDir, file.fileName);
22
- (0, fs.writeFileSync)(target, file.content);
22
+ let existing;
23
+ try {
24
+ existing = (0, fs.readFileSync)(target, "utf8");
25
+ } catch {}
26
+ if (existing !== file.content) (0, fs.writeFileSync)(target, file.content);
23
27
  }
24
28
  }
25
29
 
@@ -17,7 +17,8 @@ interface PrepareFixturesOptions {
17
17
  * artifacts (`.as.js` and/or `.as.d.ts`) next to their sources.
18
18
  *
19
19
  * `tsPlugin()` is injected automatically — callers pass only extra plugins.
20
- * Writes are unconditional; artifacts are treated as test-run outputs.
20
+ * Files are only written when their content changed, so repeat runs
21
+ * don't touch mtimes of up-to-date artifacts.
21
22
  */
22
23
  declare function prepareFixtures(options: PrepareFixturesOptions): Promise<void>;
23
24
 
@@ -2,7 +2,7 @@ import { tsPlugin } from "./plugin-Bmibxc6X.mjs";
2
2
  import "./json-schema-Bq1dwNoo.mjs";
3
3
  import path from "path";
4
4
  import { build } from "@atscript/core";
5
- import { writeFileSync } from "fs";
5
+ import { readFileSync, writeFileSync } from "fs";
6
6
 
7
7
  //#region packages/typescript/src/test-utils.ts
8
8
  async function prepareFixtures(options) {
@@ -18,7 +18,11 @@ async function prepareFixtures(options) {
18
18
  })));
19
19
  for (const files of results) for (const file of files) {
20
20
  const target = file.target ?? path.join(rootDir, file.fileName);
21
- writeFileSync(target, file.content);
21
+ let existing;
22
+ try {
23
+ existing = readFileSync(target, "utf8");
24
+ } catch {}
25
+ if (existing !== file.content) writeFileSync(target, file.content);
22
26
  }
23
27
  }
24
28
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atscript/typescript",
3
- "version": "0.1.75",
3
+ "version": "0.1.76",
4
4
  "description": "Atscript: typescript-gen support.",
5
5
  "keywords": [
6
6
  "annotations",
@@ -64,7 +64,7 @@
64
64
  },
65
65
  "dependencies": {
66
66
  "@moostjs/event-cli": "^0.6.26",
67
- "moost": "^0.6.26"
67
+ "moost": "^0.6.27"
68
68
  },
69
69
  "devDependencies": {
70
70
  "@atscript/db": "^0.1.97",
@@ -73,7 +73,7 @@
73
73
  },
74
74
  "peerDependencies": {
75
75
  "@atscript/db": "^0.1.97",
76
- "@atscript/core": "^0.1.75"
76
+ "@atscript/core": "^0.1.76"
77
77
  },
78
78
  "peerDependenciesMeta": {
79
79
  "@atscript/db": {