@ttsc/strip 0.37.2 → 0.38.0

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/strip.go +13 -0
  2. package/package.json +1 -1
package/driver/strip.go CHANGED
@@ -54,6 +54,19 @@ func (plugin) ApplyProgram(prog *driver.Program, ctx driver.PluginContext) error
54
54
  return nil
55
55
  }
56
56
 
57
+ // CheckProgram is ApplyProgram's analysis outcome without the rewrite. Only
58
+ // loading and parsing the strip configuration can fail; the statement filter
59
+ // cannot, so the same configuration steps decide the same error, and the
60
+ // source ASTs stay untouched for a resident check host (samchon/ttsc#1864).
61
+ func (plugin) CheckProgram(_ *driver.Program, ctx driver.PluginContext) error {
62
+ config, err := loadStripConfigMapWithReporters(ctx.Entry.Config, ctx.Cwd, ctx.Tsconfig, ctx.ReportHostInput, ctx.ReportHostInputHash, ctx.ReportHostInputRealpath, ctx.ReportObservationIncomplete)
63
+ if err != nil {
64
+ return err
65
+ }
66
+ _, err = parseStrip(config)
67
+ return err
68
+ }
69
+
57
70
  // stripRewriter holds the resolved strip configuration for a single build.
58
71
  type stripRewriter struct {
59
72
  calls []callPattern
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttsc/strip",
3
- "version": "0.37.2",
3
+ "version": "0.38.0",
4
4
  "description": "First-party ttsc plugin that removes configured calls and statements from emitted JavaScript.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",