@ttsc/strip 0.6.0 → 0.7.1
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 +1 -1
- package/plugin/strip.go +2 -5
- package/src/index.cjs +2 -9
package/package.json
CHANGED
package/plugin/strip.go
CHANGED
|
@@ -14,12 +14,10 @@ import (
|
|
|
14
14
|
shimparser "github.com/microsoft/typescript-go/shim/parser"
|
|
15
15
|
)
|
|
16
16
|
|
|
17
|
-
const modeStrip = "ttsc-strip"
|
|
18
|
-
|
|
19
17
|
type pluginEntry struct {
|
|
20
18
|
Config map[string]any `json:"config"`
|
|
21
|
-
Mode string `json:"mode"`
|
|
22
19
|
Name string `json:"name"`
|
|
20
|
+
Stage string `json:"stage"`
|
|
23
21
|
}
|
|
24
22
|
|
|
25
23
|
type stripTransform struct {
|
|
@@ -46,7 +44,6 @@ func RunOutput(args []string) int {
|
|
|
46
44
|
_ = fs.String("cwd", "", "project directory")
|
|
47
45
|
_ = fs.String("outDir", "", "emit directory override")
|
|
48
46
|
pluginsJSON := fs.String("plugins-json", "", "ttsc plugin manifest JSON")
|
|
49
|
-
_ = fs.String("rewrite-mode", modeStrip, "native mode")
|
|
50
47
|
_ = fs.String("tsconfig", "tsconfig.json", "project tsconfig")
|
|
51
48
|
if err := fs.Parse(args); err != nil {
|
|
52
49
|
return 2
|
|
@@ -320,7 +317,7 @@ func findConfig(pluginsJSON string) (map[string]any, error) {
|
|
|
320
317
|
return nil, fmt.Errorf("@ttsc/strip: invalid --plugins-json: %w", err)
|
|
321
318
|
}
|
|
322
319
|
for _, entry := range entries {
|
|
323
|
-
if entry.
|
|
320
|
+
if entry.Name == "@ttsc/strip" {
|
|
324
321
|
if entry.Config == nil {
|
|
325
322
|
return map[string]any{}, nil
|
|
326
323
|
}
|
package/src/index.cjs
CHANGED
|
@@ -6,14 +6,7 @@ const path = require("node:path");
|
|
|
6
6
|
module.exports = function createTtscStrip() {
|
|
7
7
|
return {
|
|
8
8
|
name: "@ttsc/strip",
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
source: {
|
|
12
|
-
dir: path.resolve(__dirname, ".."),
|
|
13
|
-
entry: "./plugin",
|
|
14
|
-
},
|
|
15
|
-
contractVersion: 1,
|
|
16
|
-
capabilities: ["output"],
|
|
17
|
-
},
|
|
9
|
+
source: path.resolve(__dirname, "..", "plugin"),
|
|
10
|
+
stage: "output",
|
|
18
11
|
};
|
|
19
12
|
};
|