@ttsc/banner 0.16.2 → 0.16.3

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/lib/index.js CHANGED
@@ -54,8 +54,10 @@ function createTtscBanner(context) {
54
54
  return {
55
55
  name: "@ttsc/banner",
56
56
  // Point at the `driver/` directory one level above `lib/` in the
57
- // installed package tree (where the Go sources live).
58
- source: node_path_1.default.resolve(__dirname, "..", "driver"),
57
+ // installed package tree (where the Go sources live). `context.dirname`
58
+ // is this descriptor's own directory in every load mode, unlike the
59
+ // CommonJS `__dirname`, which is undefined under a `.ts`-source or ESM load.
60
+ source: node_path_1.default.resolve(context.dirname, "..", "driver"),
59
61
  stage: "transform",
60
62
  };
61
63
  }
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,0DAA6B;AAI7B,qDAAmC;AAyCnC;;;;GAIG;AACH,MAAM,cAAc,GAAG,IAAI,GAAG,CAAS;IACrC,SAAS;IACT,MAAM;IACN,OAAO;IACP,WAAW;CACZ,CAAC,CAAC;AAEH;;;;;;;;;;GAUG;AACH,0BACE,OAA0D;IAE1D,MAAM,KAAK,GAAG,OAAO,CAAC,MAAiC,CAAC;IACxD,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACrC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,GAAG,KAAK,YAAY,EAAE,CAAC;YACrD,MAAM,IAAI,KAAK,CACb,gEAAgE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI;gBACrF,sFAAsF;gBACtF,iGAAiG,CACpG,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO;QACL,IAAI,EAAE,cAAc;QACpB,iEAAiE;QACjE,sDAAsD;QACtD,MAAM,EAAE,mBAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,QAAQ,CAAC;QAC/C,KAAK,EAAE,WAAW;KACnB,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,0DAA6B;AAI7B,qDAAmC;AAmDnC;;;;GAIG;AACH,MAAM,cAAc,GAAG,IAAI,GAAG,CAAS;IACrC,SAAS;IACT,MAAM;IACN,OAAO;IACP,WAAW;CACZ,CAAC,CAAC;AAEH;;;;;;;;;;GAUG;AACH,0BACE,OAA0D;IAE1D,MAAM,KAAK,GAAG,OAAO,CAAC,MAAiC,CAAC;IACxD,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACrC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,GAAG,KAAK,YAAY,EAAE,CAAC;YACrD,MAAM,IAAI,KAAK,CACb,gEAAgE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI;gBACrF,sFAAsF;gBACtF,iGAAiG,CACpG,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO;QACL,IAAI,EAAE,cAAc;QACpB,iEAAiE;QACjE,wEAAwE;QACxE,oEAAoE;QACpE,6EAA6E;QAC7E,MAAM,EAAE,mBAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC;QACrD,KAAK,EAAE,WAAW;KACnB,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttsc/banner",
3
- "version": "0.16.2",
3
+ "version": "0.16.3",
4
4
  "description": "First-party ttsc plugin that adds package-documentation JSDoc banners during emit.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -35,7 +35,7 @@
35
35
  "@types/node": "^25.3.0",
36
36
  "rimraf": "^6.1.2",
37
37
  "typescript": "7.0.1-rc",
38
- "ttsc": "0.16.2"
38
+ "ttsc": "0.16.3"
39
39
  },
40
40
  "repository": {
41
41
  "type": "git",
package/src/index.ts CHANGED
@@ -35,6 +35,16 @@ type TtscPluginFactoryContext<TConfig> = {
35
35
  binary: string;
36
36
  /** Working directory of the ttsc invocation. */
37
37
  cwd: string;
38
+ /**
39
+ * Absolute path to the directory holding this descriptor module — the
40
+ * load-mode-independent replacement for `__dirname`.
41
+ */
42
+ dirname: string;
43
+ /**
44
+ * Absolute path to this descriptor module — the load-mode-independent
45
+ * replacement for `__filename`.
46
+ */
47
+ filename: string;
38
48
  /** The raw plugin entry from `compilerOptions.plugins[]`. */
39
49
  plugin: TConfig;
40
50
  /** Absolute path to the project root (directory containing tsconfig). */
@@ -83,8 +93,10 @@ export default function createTtscBanner(
83
93
  return {
84
94
  name: "@ttsc/banner",
85
95
  // Point at the `driver/` directory one level above `lib/` in the
86
- // installed package tree (where the Go sources live).
87
- source: path.resolve(__dirname, "..", "driver"),
96
+ // installed package tree (where the Go sources live). `context.dirname`
97
+ // is this descriptor's own directory in every load mode, unlike the
98
+ // CommonJS `__dirname`, which is undefined under a `.ts`-source or ESM load.
99
+ source: path.resolve(context.dirname, "..", "driver"),
88
100
  stage: "transform",
89
101
  };
90
102
  }