@ttsc/strip 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttsc/strip",
3
- "version": "0.16.2",
3
+ "version": "0.16.3",
4
4
  "description": "First-party ttsc plugin that removes configured calls and statements from emitted JavaScript.",
5
5
  "main": "src/index.cjs",
6
6
  "types": "src/index.d.ts",
package/src/index.cjs CHANGED
@@ -30,7 +30,9 @@ module.exports = function createTtscStrip(context) {
30
30
  }
31
31
  return {
32
32
  name: "@ttsc/strip",
33
- source: path.resolve(__dirname, "..", "driver"),
33
+ // `context.dirname` is this descriptor's own directory in every load mode —
34
+ // the ESM-safe replacement for `__dirname`.
35
+ source: path.resolve(context.dirname, "..", "driver"),
34
36
  stage: "transform",
35
37
  };
36
38
  };
package/src/index.d.ts CHANGED
@@ -1,12 +1,22 @@
1
1
  /**
2
2
  * Plugin descriptor factory consumed by ttsc's package discovery.
3
3
  *
4
- * `@ttsc/strip` is configured through a `strip.config.*` file, never through
5
- * the factory context the factory only returns the native descriptor.
4
+ * `@ttsc/strip` is configured through a `strip.config.*` file, not through
5
+ * inline plugin options. The factory reads only `context.dirname` to locate its
6
+ * own Go `source` (the load-mode-independent replacement for `__dirname`) and
7
+ * returns the native descriptor.
6
8
  *
7
9
  * @internal
8
10
  */
9
- declare function createTtscStrip(context: unknown): {
11
+ declare function createTtscStrip(context: {
12
+ /**
13
+ * Absolute directory of this descriptor module; the Go `source` resolves from
14
+ * it.
15
+ */
16
+ dirname: string;
17
+ /** Original tsconfig plugin entry, validated for unsupported keys. */
18
+ plugin?: Record<string, unknown>;
19
+ }): {
10
20
  name: string;
11
21
  source: string;
12
22
  stage: "transform";