@ripple-ts/vite-plugin 0.2.213 → 0.2.215
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/CHANGELOG.md +19 -0
- package/package.json +14 -3
- package/src/bin/preview.js +43 -0
- package/src/constants.js +2 -0
- package/src/index.js +542 -193
- package/src/load-config.js +172 -0
- package/src/server/production.js +127 -94
- package/src/server/render-route.js +1 -1
- package/src/server/virtual-entry.js +215 -0
- package/tsconfig.json +8 -0
- package/types/index.d.ts +117 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @ripple-ts/vite-plugin
|
|
2
2
|
|
|
3
|
+
## 0.2.215
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies []:
|
|
8
|
+
- @ripple-ts/adapter@0.2.215
|
|
9
|
+
|
|
10
|
+
## 0.2.214
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [#730](https://github.com/Ripple-TS/ripple/pull/730)
|
|
15
|
+
[`6efde20`](https://github.com/Ripple-TS/ripple/commit/6efde20a7fe1e29b27ac98823362cba2001340fa)
|
|
16
|
+
Thanks [@leonidaz](https://github.com/leonidaz)! - Force patch version bump for
|
|
17
|
+
vite-plugin package.
|
|
18
|
+
|
|
19
|
+
- Updated dependencies []:
|
|
20
|
+
- @ripple-ts/adapter@0.2.214
|
|
21
|
+
|
|
3
22
|
## 0.2.213
|
|
4
23
|
|
|
5
24
|
## 0.2.212
|
package/package.json
CHANGED
|
@@ -3,18 +3,26 @@
|
|
|
3
3
|
"description": "Vite plugin for Ripple",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Dominic Gannaway",
|
|
6
|
-
"version": "0.2.
|
|
6
|
+
"version": "0.2.215",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"module": "src/index.js",
|
|
9
9
|
"main": "src/index.js",
|
|
10
|
+
"bin": {
|
|
11
|
+
"ripple-preview": "src/bin/preview.js"
|
|
12
|
+
},
|
|
10
13
|
"exports": {
|
|
11
14
|
".": {
|
|
12
15
|
"types": "./types/index.d.ts",
|
|
13
16
|
"import": "./src/index.js",
|
|
14
17
|
"default": "./src/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./production": {
|
|
20
|
+
"import": "./src/server/production.js",
|
|
21
|
+
"default": "./src/server/production.js",
|
|
22
|
+
"types": "./types/index.d.ts"
|
|
15
23
|
}
|
|
16
24
|
},
|
|
17
|
-
"homepage": "https://
|
|
25
|
+
"homepage": "https://ripple-ts.com",
|
|
18
26
|
"repository": {
|
|
19
27
|
"type": "git",
|
|
20
28
|
"url": "git+https://github.com/Ripple-TS/ripple.git",
|
|
@@ -23,10 +31,13 @@
|
|
|
23
31
|
"bugs": {
|
|
24
32
|
"url": "https://github.com/Ripple-TS/ripple/issues"
|
|
25
33
|
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@ripple-ts/adapter": "0.2.215"
|
|
36
|
+
},
|
|
26
37
|
"devDependencies": {
|
|
27
38
|
"type-fest": "^5.1.0",
|
|
28
39
|
"vite": "^7.1.9",
|
|
29
|
-
"ripple": "0.2.
|
|
40
|
+
"ripple": "0.2.215"
|
|
30
41
|
},
|
|
31
42
|
"publishConfig": {
|
|
32
43
|
"access": "public"
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ripple-preview — Start the production SSR server.
|
|
5
|
+
*
|
|
6
|
+
* Loads ripple.config.ts reads `build.outDir`,
|
|
7
|
+
* and spawns `node {outDir}/server/entry.js`.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { spawn } from 'node:child_process';
|
|
11
|
+
import path from 'node:path';
|
|
12
|
+
import fs from 'node:fs';
|
|
13
|
+
import { loadRippleConfig } from '../load-config.js';
|
|
14
|
+
import { ENTRY_FILENAME } from '../constants.js';
|
|
15
|
+
|
|
16
|
+
const projectRoot = process.cwd();
|
|
17
|
+
|
|
18
|
+
try {
|
|
19
|
+
const config = await loadRippleConfig(projectRoot);
|
|
20
|
+
const outDir = config.build.outDir;
|
|
21
|
+
const entryPath = path.join(projectRoot, outDir, 'server', ENTRY_FILENAME);
|
|
22
|
+
|
|
23
|
+
if (!fs.existsSync(entryPath)) {
|
|
24
|
+
console.error(`[ripple-preview] Server entry not found: ${entryPath}`);
|
|
25
|
+
console.error('[ripple-preview] Did you run `pnpm build` first?');
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
console.log(`[ripple-preview] Starting server from ${outDir}/server/${ENTRY_FILENAME}`);
|
|
30
|
+
|
|
31
|
+
const child = spawn(process.execPath, [entryPath], {
|
|
32
|
+
stdio: 'inherit',
|
|
33
|
+
cwd: projectRoot,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
child.on('close', (code) => {
|
|
37
|
+
process.exit(code ?? 0);
|
|
38
|
+
});
|
|
39
|
+
} catch (e) {
|
|
40
|
+
const error = /** @type {Error} */ (e);
|
|
41
|
+
console.error('[ripple-preview] Failed to load config:', error.message);
|
|
42
|
+
process.exit(1);
|
|
43
|
+
}
|
package/src/constants.js
ADDED