@nuvio/vite-plugin 0.5.5 → 1.0.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.
package/dist/scan.d.ts ADDED
@@ -0,0 +1,52 @@
1
+ import { IndexWireEntry, DuplicateIdError, LibraryId } from '@nuvio/shared';
2
+ import { ClassNameMode } from '@nuvio/ast-engine';
3
+ export { NUVIO_DEFAULT_SCAN_GLOBS } from './nuvio-dev-session.js';
4
+ import 'node:http';
5
+
6
+ type SourceIndexEntry = IndexWireEntry;
7
+ type BuildSourceIndexResult = {
8
+ entries: SourceIndexEntry[];
9
+ duplicateErrors: DuplicateIdError[];
10
+ parseErrors: Array<{
11
+ file: string;
12
+ message: string;
13
+ }>;
14
+ /** Files matched by glob (before id extraction). */
15
+ scannedFileCount: number;
16
+ };
17
+ /**
18
+ * Extract every contract id occurrence from a single TSX/JSX source string.
19
+ */
20
+ declare function extractIdsFromSource(fileAbs: string, code: string, options?: {
21
+ classNameMode?: ClassNameMode;
22
+ detectedLibraries?: readonly LibraryId[];
23
+ }): SourceIndexEntry[];
24
+ /**
25
+ * Scan `rootAbs` with glob patterns (relative to `rootAbs`, or absolute) and build `id → file` map.
26
+ * Duplicate ids across the project produce `duplicateErrors`; those ids are omitted from `entries`.
27
+ */
28
+ declare function buildSourceIndex(rootAbs: string, globPatterns: string[], options?: {
29
+ classNameMode?: ClassNameMode;
30
+ detectedLibraries?: readonly LibraryId[];
31
+ }): BuildSourceIndexResult;
32
+ /**
33
+ * Run {@link buildSourceIndex} for each unique candidate root and keep the best result
34
+ * (most ids, then fewest duplicate-id collisions, then most files scanned).
35
+ */
36
+ declare function pickBestSourceIndex(rootCandidates: string[], globPatterns: string[], options?: {
37
+ classNameMode?: ClassNameMode;
38
+ detectedLibraries?: readonly LibraryId[];
39
+ }): BuildSourceIndexResult;
40
+
41
+ /** Best-effort library detection for dev index diagnostics (v0.8). */
42
+ declare function detectProjectLibraries(projectRootAbs: string, packageJson?: Record<string, unknown>): LibraryId[];
43
+
44
+ type RuntimeVersions = {
45
+ viteVersion?: string;
46
+ reactVersion?: string;
47
+ tailwindVersion?: string;
48
+ };
49
+ /** Best-effort versions from the consuming app's node_modules. */
50
+ declare function readRuntimeVersions(projectRootAbs: string): RuntimeVersions;
51
+
52
+ export { type BuildSourceIndexResult, type SourceIndexEntry, buildSourceIndex, detectProjectLibraries, extractIdsFromSource, pickBestSourceIndex, readRuntimeVersions };
package/dist/scan.js ADDED
@@ -0,0 +1,18 @@
1
+ import {
2
+ DEFAULT_GLOBS
3
+ } from "./chunk-EZGH3CUW.js";
4
+ import {
5
+ buildSourceIndex,
6
+ detectProjectLibraries,
7
+ extractIdsFromSource,
8
+ pickBestSourceIndex,
9
+ readRuntimeVersions
10
+ } from "./chunk-QAQAJG7B.js";
11
+ export {
12
+ DEFAULT_GLOBS as NUVIO_DEFAULT_SCAN_GLOBS,
13
+ buildSourceIndex,
14
+ detectProjectLibraries,
15
+ extractIdsFromSource,
16
+ pickBestSourceIndex,
17
+ readRuntimeVersions
18
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nuvio/vite-plugin",
3
- "version": "0.5.5",
4
- "description": "Nuvio Vite plugin: dev WebSocket, source index for data-nuvio-id, secure patch writes.",
3
+ "version": "1.0.0",
4
+ "description": "Nuvio Vite plugin 1.0 — dev WebSocket, source index, click-to-tag, secure patch writes for React + Tailwind.",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -33,6 +33,10 @@
33
33
  "./dev-session": {
34
34
  "types": "./dist/nuvio-dev-session.d.ts",
35
35
  "import": "./dist/nuvio-dev-session.js"
36
+ },
37
+ "./scan": {
38
+ "types": "./dist/scan.d.ts",
39
+ "import": "./dist/scan.js"
36
40
  }
37
41
  },
38
42
  "engines": {
@@ -46,8 +50,8 @@
46
50
  "@babel/traverse": "^7.26.9",
47
51
  "fast-glob": "^3.3.3",
48
52
  "ws": "^8.18.0",
49
- "@nuvio/ast-engine": "0.5.5",
50
- "@nuvio/shared": "0.5.5"
53
+ "@nuvio/ast-engine": "1.0.0",
54
+ "@nuvio/shared": "1.0.0"
51
55
  },
52
56
  "devDependencies": {
53
57
  "@babel/types": "^7.26.9",
@@ -60,7 +64,7 @@
60
64
  "vitest": "^3.0.6"
61
65
  },
62
66
  "scripts": {
63
- "build": "tsup src/index.ts src/nuvio-dev-session.ts --format esm --dts --clean --external vite --external @nuvio/shared --external @nuvio/ast-engine",
67
+ "build": "tsup src/index.ts src/nuvio-dev-session.ts src/scan.ts --format esm --dts --clean --external vite --external @nuvio/shared --external @nuvio/ast-engine",
64
68
  "typecheck": "tsc -p tsconfig.json --noEmit",
65
69
  "test": "vitest run"
66
70
  }