@ttsc/strip 0.18.4 → 0.19.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.
Files changed (2) hide show
  1. package/driver/config.go +8 -10
  2. package/package.json +1 -1
package/driver/config.go CHANGED
@@ -11,6 +11,8 @@ import (
11
11
  "runtime"
12
12
  "strings"
13
13
  "time"
14
+
15
+ "github.com/samchon/ttsc/packages/ttsc/driver"
14
16
  )
15
17
 
16
18
  // configLoaderTimeout caps every `ttsx`/`node -e` subprocess that evaluates a
@@ -129,17 +131,13 @@ func findStripConfigFile(cwd, tsconfigPath string) (string, error) {
129
131
  }
130
132
 
131
133
  // stripDiscoveryBaseDir returns the directory from which auto-discovery walks
132
- // upward. Prefers the tsconfig directory over cwd so nested package configs are
133
- // found relative to the tsconfig that triggered the strip run.
134
+ // upward. The launcher's explicit project-root channel
135
+ // (driver.PluginConfigDirEnv) wins when set — the tsconfig may be a generated
136
+ // wrapper in a temp directory that no longer identifies the project —
137
+ // otherwise the tsconfig directory is preferred over cwd so nested package
138
+ // configs are found relative to the tsconfig that triggered the strip run.
134
139
  func stripDiscoveryBaseDir(cwd, tsconfigPath string) string {
135
- if tsconfigPath != "" {
136
- resolved := tsconfigPath
137
- if !filepath.IsAbs(resolved) {
138
- resolved = filepath.Join(cwd, resolved)
139
- }
140
- return filepath.Dir(resolved)
141
- }
142
- return cwd
140
+ return driver.PluginConfigBaseDir(cwd, tsconfigPath)
143
141
  }
144
142
 
145
143
  // resolveStripConfigFilePath resolves a user-supplied config path to an
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttsc/strip",
3
- "version": "0.18.4",
3
+ "version": "0.19.1",
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",