@jay-framework/wix-deploy 0.25.1 → 0.25.5

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.
@@ -0,0 +1,76 @@
1
+ import { WixClient } from '@wix/sdk';
2
+ import { ArtifactStore, RouteManifest, CacheEntry, ServerElementModule } from '@jay-framework/production-server/serve';
3
+ export { ArtifactStore, CacheEntry, RouteManifest, ServerElementModule } from '@jay-framework/production-server/serve';
4
+
5
+ /**
6
+ * WixDataArtifactStore — implements ArtifactStore for Wix BaaS deployments.
7
+ *
8
+ * Reads eager files (route-manifest.json, build-metadata.json) from the dist
9
+ * directory alongside entry.mjs. Fetches lazy JSON files (page-parts, cache
10
+ * data) from a Wix data collection on demand and caches them to disk.
11
+ * All JS modules are resolved from the bundled MODULE_REGISTRY — no disk
12
+ * loading of JS files.
13
+ *
14
+ * Also supports writes (for upload-backend) to the data collection.
15
+ *
16
+ * Data collection schema:
17
+ * _id: string — sha256("{version}/{path}") truncated to 32 chars
18
+ * version: string — deploy version (e.g. "0.0.1-d849685dc3de")
19
+ * path: string — relative file path within backend dir
20
+ * content: string — file content (text)
21
+ * fileType: string — extension (js, json)
22
+ * sizeBytes: number — content byte length
23
+ * category: string — 'eager' | 'lazy'
24
+ */
25
+
26
+ interface BackendFileItem {
27
+ _id: string;
28
+ version: string;
29
+ path: string;
30
+ content: string;
31
+ fileType: string;
32
+ sizeBytes: number;
33
+ category: 'eager' | 'lazy';
34
+ }
35
+ declare function makeItemId(version: string, relativePath: string): string;
36
+ interface WixDataArtifactStoreOptions {
37
+ wixClient: WixClient;
38
+ collectionId: string;
39
+ version: string;
40
+ /** Directory containing entry.mjs and eager files (route-manifest.json, build-metadata.json). Required for reads. */
41
+ distDir?: string;
42
+ /** Directory for caching lazy files fetched from the data collection */
43
+ cacheDir: string;
44
+ moduleRegistry?: Record<string, any>;
45
+ }
46
+ declare class WixDataArtifactStore implements ArtifactStore {
47
+ readonly collectionId: string;
48
+ readonly version: string;
49
+ private readonly distDir;
50
+ private readonly cacheDir;
51
+ private readonly dataClient;
52
+ private readonly moduleRegistry;
53
+ private manifestCache?;
54
+ private fetchPromises;
55
+ constructor(options: WixDataArtifactStoreOptions);
56
+ readManifest(): Promise<RouteManifest>;
57
+ readCacheData(relativePath: string): Promise<CacheEntry>;
58
+ readPagePartsConfig(relativePath: string): Promise<any>;
59
+ loadServerElement(relativePath: string): Promise<ServerElementModule>;
60
+ loadModule(modulePath: string, _local?: boolean): Promise<any>;
61
+ getAssetPath(relativePath: string): string;
62
+ getBuildDir(): string;
63
+ loadEagerFiles(): Promise<void>;
64
+ ensurePageFiles(preRenderedPath: string): Promise<void>;
65
+ writeFile(relativePath: string, content: string, category: 'eager' | 'lazy'): Promise<void>;
66
+ writeFiles(files: Array<{
67
+ path: string;
68
+ content: string;
69
+ category: 'eager' | 'lazy';
70
+ }>): Promise<number>;
71
+ private ensureFile;
72
+ private fetchFromCollection;
73
+ private writeToCache;
74
+ }
75
+
76
+ export { type BackendFileItem, WixDataArtifactStore, type WixDataArtifactStoreOptions, makeItemId };
@@ -0,0 +1,7 @@
1
+ name: build-entry
2
+ description: Build a BaaS-ready entry.mjs from Jay build output
3
+
4
+ inputSchema:
5
+ collectionId?: string
6
+ staticBaseUrl?: string
7
+ excludePlugins?: string
@@ -0,0 +1,5 @@
1
+ name: deploy-baas
2
+ description: Deploy dist/ folder to Wix BaaS using the deployment API directly
3
+
4
+ inputSchema:
5
+ dryRun?: boolean
@@ -0,0 +1,8 @@
1
+ name: deploy
2
+ description: Build entry.mjs, upload backend data, and deploy to Wix BaaS + CDN
3
+
4
+ inputSchema:
5
+ collectionId?: string
6
+ staticBaseUrl?: string
7
+ excludePlugins?: string
8
+ dryRun?: boolean
@@ -0,0 +1,6 @@
1
+ name: upload-backend
2
+ description: Upload backend build files to a Wix data collection for BaaS serving
3
+
4
+ inputSchema:
5
+ collectionId?: string
6
+ dryRun?: boolean
package/dist/index.d.ts CHANGED
@@ -1,65 +1,3 @@
1
- import { WixClient } from '@wix/sdk';
2
- import { ArtifactStore, RouteManifest, CacheEntry, ServerElementModule } from '@jay-framework/production-server/serve';
3
-
4
- /**
5
- * WixDataArtifactStore — implements ArtifactStore for Wix BaaS deployments.
6
- *
7
- * Reads eager files (route-manifest.json, build-metadata.json) from the dist
8
- * directory alongside entry.mjs. Fetches lazy JSON files (page-parts, cache
9
- * data) from a Wix data collection on demand and caches them to disk.
10
- * All JS modules are resolved from the bundled MODULE_REGISTRY — no disk
11
- * loading of JS files.
12
- *
13
- * Also supports writes (for upload-backend) to the data collection.
14
- *
15
- * Data collection schema:
16
- * _id: string — sha256("{version}/{path}") truncated to 32 chars
17
- * version: string — deploy version (e.g. "0.0.1-d849685dc3de")
18
- * path: string — relative file path within backend dir
19
- * content: string — file content (text)
20
- * fileType: string — extension (js, json)
21
- * sizeBytes: number — content byte length
22
- * category: string — 'eager' | 'lazy'
23
- */
24
-
25
- interface WixDataArtifactStoreOptions {
26
- wixClient: WixClient;
27
- collectionId: string;
28
- version: string;
29
- /** Directory containing entry.mjs and eager files (route-manifest.json, build-metadata.json). Required for reads. */
30
- distDir?: string;
31
- /** Directory for caching lazy files fetched from the data collection */
32
- cacheDir: string;
33
- moduleRegistry?: Record<string, any>;
34
- }
35
- declare class WixDataArtifactStore implements ArtifactStore {
36
- readonly collectionId: string;
37
- readonly version: string;
38
- private readonly distDir;
39
- private readonly cacheDir;
40
- private readonly dataClient;
41
- private readonly moduleRegistry;
42
- private manifestCache?;
43
- private fetchPromises;
44
- constructor(options: WixDataArtifactStoreOptions);
45
- readManifest(): Promise<RouteManifest>;
46
- readCacheData(relativePath: string): Promise<CacheEntry>;
47
- readPagePartsConfig(relativePath: string): Promise<any>;
48
- loadServerElement(relativePath: string): Promise<ServerElementModule>;
49
- loadModule(modulePath: string, _local?: boolean): Promise<any>;
50
- getAssetPath(relativePath: string): string;
51
- getBuildDir(): string;
52
- loadEagerFiles(): Promise<void>;
53
- ensurePageFiles(preRenderedPath: string): Promise<void>;
54
- writeFile(relativePath: string, content: string, category: 'eager' | 'lazy'): Promise<void>;
55
- writeFiles(files: Array<{
56
- path: string;
57
- content: string;
58
- category: 'eager' | 'lazy';
59
- }>): Promise<number>;
60
- private ensureFile;
61
- private fetchFromCollection;
62
- private writeToCache;
63
- }
64
-
65
- export { WixDataArtifactStore, type WixDataArtifactStoreOptions };
1
+ export { WixDataArtifactStore, WixDataArtifactStoreOptions } from './artifact-store.js';
2
+ import '@wix/sdk';
3
+ import '@jay-framework/production-server/serve';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jay-framework/wix-deploy",
3
- "version": "0.25.1",
3
+ "version": "0.25.5",
4
4
  "type": "module",
5
5
  "description": "Wix BaaS deployment adapter for Jay Framework — WixDataArtifactStore and entry builder",
6
6
  "license": "Apache-2.0",
@@ -11,40 +11,54 @@
11
11
  "agent-kit"
12
12
  ],
13
13
  "exports": {
14
- ".": "./dist/index.js",
15
- "./artifact-store": "./dist/artifact-store.js",
16
- "./tools": "./dist/tools.js",
14
+ ".": {
15
+ "types": "./dist/index.d.ts",
16
+ "default": "./dist/index.js"
17
+ },
18
+ "./artifact-store": {
19
+ "types": "./dist/artifact-store.d.ts",
20
+ "default": "./dist/artifact-store.js"
21
+ },
22
+ "./tools": {
23
+ "types": "./dist/tools.d.ts",
24
+ "default": "./dist/tools.js"
25
+ },
17
26
  "./plugin.yaml": "./plugin.yaml",
27
+ "./deploy.jay-command": "./dist/commands/deploy.jay-command",
28
+ "./build-entry.jay-command": "./dist/commands/build-entry.jay-command",
29
+ "./upload-backend.jay-command": "./dist/commands/upload-backend.jay-command",
30
+ "./deploy-baas.jay-command": "./dist/commands/deploy-baas.jay-command",
18
31
  "./package.json": "./package.json"
19
32
  },
20
33
  "scripts": {
21
- "build": "npm run clean && npm run build:server && npm run build:types && npm run validate",
34
+ "build": "npm run clean && npm run build:server && npm run build:types && npm run build:copy-commands && npm run validate",
35
+ "build:copy-commands": "mkdir -p dist/commands && cp lib/commands/*.jay-command dist/commands/",
22
36
  "validate": "jay-stack-cli validate-plugin",
23
37
  "build:server": "vite build --ssr",
24
- "build:types": "tsup lib/index.ts lib/tools.ts --dts-only --format esm",
38
+ "build:types": "tsup lib/index.ts lib/artifact-store.ts lib/tools.ts --dts-only --format esm",
25
39
  "build:check-types": "tsc",
26
40
  "clean": "rimraf dist",
27
41
  "confirm": "npm run clean && npm run build && npm run test",
28
42
  "test": ":"
29
43
  },
30
44
  "dependencies": {
31
- "@jay-framework/fullstack-component": "^0.25.1",
32
- "@jay-framework/production-server": "^0.25.1",
33
- "@jay-framework/stack-server-runtime": "^0.25.1",
34
- "@jay-framework/wix-server-client": "^0.25.1",
45
+ "@jay-framework/fullstack-component": "^0.25.5",
46
+ "@jay-framework/production-server": "^0.25.5",
47
+ "@jay-framework/stack-server-runtime": "^0.25.5",
48
+ "@jay-framework/wix-server-client": "^0.25.5",
35
49
  "@wix/data": "^1.0.433",
36
50
  "@wix/sdk": "^1.21.5",
37
51
  "esbuild": "^0.21.0",
38
52
  "js-yaml": "^4.1.0"
39
53
  },
40
54
  "peerDependencies": {
41
- "@jay-framework/compiler-jay-html": "^0.25.1",
42
- "@jay-framework/compiler-shared": "^0.25.1"
55
+ "@jay-framework/compiler-jay-html": "^0.25.5",
56
+ "@jay-framework/compiler-shared": "^0.25.5"
43
57
  },
44
58
  "devDependencies": {
45
- "@jay-framework/compiler-jay-html": "^0.25.1",
46
- "@jay-framework/compiler-shared": "^0.25.1",
47
- "@jay-framework/jay-stack-cli": "^0.25.1",
59
+ "@jay-framework/compiler-jay-html": "^0.25.5",
60
+ "@jay-framework/compiler-shared": "^0.25.5",
61
+ "@jay-framework/jay-stack-cli": "^0.25.5",
48
62
  "tsup": "^8.0.0",
49
63
  "typescript": "^5.3.3",
50
64
  "vite": "^5.0.0"