noxcturnal 0.1.1 → 0.1.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/README.md CHANGED
@@ -63,6 +63,36 @@ Every plugin in a phase observes the same immutable input. Its edits become visi
63
63
  phase boundary, after validation and an optional reparse. Split dependent transforms into separate
64
64
  phases when a later transform must observe an earlier transform's output.
65
65
 
66
+ Plugins that only apply to particular syntax can declare a necessary condition:
67
+
68
+ ```ts
69
+ contract: {
70
+ syntax: {
71
+ anyOf: ['AsyncFunction', 'Super'];
72
+ }
73
+ }
74
+ ```
75
+
76
+ The plugin runs only when at least one listed feature occurs in the current phase's input.
77
+ Features are concrete AST node kinds, plus `AsyncFunction` (including async arrows and methods)
78
+ and `GeneratorFunction` (including generator methods). Comments, strings, and property names do
79
+ not count as the syntax they mention. Choose a conservative condition: use `analyze` for further
80
+ semantic checks. A rejected plugin skips all lifecycle hooks, including state creation and cleanup,
81
+ and adds no retention or child hydration requirements. Native syntax selection shares the input
82
+ parse with active visitors and is reevaluated when earlier phases change the source. Pipelines
83
+ without syntax requirements keep their existing execution path.
84
+
85
+ `path.matchesPattern()` uses native AST facts. Declare `fields: ['memberPath']` for static or
86
+ computed member expressions or `fields: ['name']` for identifiers, including in child contracts.
87
+ Missing declarations throw. An identifier reached through a `memberPath` declaration returns false,
88
+ as do other nodes such as a `super()` callee or a spread argument. Matching never reparses source
89
+ in JavaScript. For fixed patterns, prefer a native
90
+ `where: { memberPath: { equals: 'process.env.NODE_ENV' } }` predicate. Predicates share chain
91
+ prefixes without transferring full paths for every nested member.
92
+
93
+ Generated UIDs avoid decoded AST identifier names and names already reserved in the phase. Text
94
+ inside comments and string literals does not reserve names.
95
+
66
96
  ### Configuration and per-file data
67
97
 
68
98
  Pipeline definitions describe reusable program configuration: