@weapp-vite/ast-native 0.0.0 → 0.0.2

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/index.d.ts CHANGED
@@ -6,9 +6,48 @@ export interface NativeOnPageScrollDiagnostic {
6
6
  syncApi?: string
7
7
  }
8
8
 
9
+ export interface NativeScriptAnalysis {
10
+ hasStaticRequireLiteral: boolean
11
+ hasPlatformApiAccess: boolean
12
+ featureFlags: string[]
13
+ }
14
+
15
+ export interface NativeScriptAnalysisInput {
16
+ code: string
17
+ moduleId?: string
18
+ hookToFeatureJson?: string
19
+ filename?: string
20
+ }
21
+
22
+ export function analyzeScriptNative(
23
+ code: string,
24
+ moduleId?: string,
25
+ hookToFeatureJson?: string,
26
+ filename?: string,
27
+ ): NativeScriptAnalysis
28
+
29
+ export function analyzeScriptsNative(inputs: NativeScriptAnalysisInput[]): NativeScriptAnalysis[]
30
+
9
31
  export function collectOnPageScrollDiagnosticsNative(
10
32
  code: string,
11
33
  filename?: string,
12
34
  ): NativeOnPageScrollDiagnostic[]
13
35
 
14
36
  export function getVueSfcSignaturePayloadNative(source: string): string | undefined
37
+
38
+ export function mayContainStaticRequireLiteralNative(
39
+ code: string,
40
+ filename?: string,
41
+ ): boolean
42
+
43
+ export function mayContainPlatformApiAccessNative(
44
+ code: string,
45
+ filename?: string,
46
+ ): boolean
47
+
48
+ export function collectFeatureFlagsNative(
49
+ code: string,
50
+ moduleId: string,
51
+ hookToFeatureJson: string,
52
+ filename?: string,
53
+ ): string[]
package/index.js CHANGED
@@ -19,11 +19,21 @@ if (!bindingPath) {
19
19
  }
20
20
 
21
21
  const {
22
+ analyzeScriptNative,
23
+ analyzeScriptsNative,
24
+ collectFeatureFlagsNative,
22
25
  collectOnPageScrollDiagnosticsNative,
23
26
  getVueSfcSignaturePayloadNative,
27
+ mayContainPlatformApiAccessNative,
28
+ mayContainStaticRequireLiteralNative,
24
29
  } = require(bindingPath)
25
30
 
26
31
  export {
32
+ analyzeScriptNative,
33
+ analyzeScriptsNative,
34
+ collectFeatureFlagsNative,
27
35
  collectOnPageScrollDiagnosticsNative,
28
36
  getVueSfcSignaturePayloadNative,
37
+ mayContainPlatformApiAccessNative,
38
+ mayContainStaticRequireLiteralNative,
29
39
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@weapp-vite/ast-native",
3
3
  "type": "module",
4
- "version": "0.0.0",
4
+ "version": "0.0.2",
5
5
  "description": "weapp-vite Rust/Oxc native AST analysis prototype",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -41,10 +41,10 @@
41
41
  "node": ">=22.13.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@napi-rs/cli": "^3.7.2",
45
- "@types/node": "^26.0.1",
46
- "eslint": "^10.6.0",
47
- "vitest": "4.1.9"
44
+ "@napi-rs/cli": "^3.7.4",
45
+ "@types/node": "^26.1.1",
46
+ "eslint": "^10.7.0",
47
+ "vitest": "4.1.10"
48
48
  },
49
49
  "napi": {
50
50
  "binaryName": "weapp_vite_ast_native",