polen 0.2.0-next.2 → 0.2.0-next.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 +5 -4
- package/build/entrypoints/_exports.d.ts +2 -0
- package/build/entrypoints/_exports.js +2 -0
- package/build/entrypoints/dependencies/react/jsx-dev-runtime.d.ts +3 -0
- package/build/entrypoints/dependencies/react/jsx-dev-runtime.js +3 -0
- package/build/entrypoints/dependencies/react/jsx-runtime.d.ts +1 -0
- package/build/entrypoints/dependencies/react/jsx-runtime.js +1 -0
- package/build/entrypoints/dependencies/react.d.ts +2 -0
- package/build/entrypoints/dependencies/react.js +2 -0
- package/build/vite-plugin/build.js +6 -3
- package/build/vite-plugin/vite-plugin.js +45 -9
- package/package.json +12 -6
- package/build/_exports.d.ts +0 -2
- package/build/_exports.js +0 -2
- /package/build/{_namespace.d.ts → entrypoints/_namespace.d.ts} +0 -0
- /package/build/{_namespace.js → entrypoints/_namespace.js} +0 -0
package/README.md
CHANGED
|
@@ -5,12 +5,13 @@ A framework for delightful GraphQL developer portals ✨.
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```
|
|
8
|
-
npm add polen vite react-dom
|
|
8
|
+
npm add polen vite react react-dom
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
- `vite`
|
|
12
|
-
- `react-dom`
|
|
13
|
-
|
|
11
|
+
- `vite`, `react`, `react-dom` are peer dependencies of Polen.
|
|
12
|
+
- We would like to remove `react` and `react-dom` as peers deps in the future to
|
|
13
|
+
simplify this for you.
|
|
14
|
+
([see](https://github.com/the-guild-org/polen/pull/9#issuecomment-2801683840))
|
|
14
15
|
|
|
15
16
|
## Example
|
|
16
17
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from 'react/jsx-runtime';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from 'react/jsx-runtime';
|
|
@@ -34,14 +34,17 @@ export const Build = (parameters) => {
|
|
|
34
34
|
entry: `entry`,
|
|
35
35
|
entries: `entries`,
|
|
36
36
|
};
|
|
37
|
-
|
|
37
|
+
const honoPath = import.meta.resolve(`hono`);
|
|
38
|
+
const honoNodeServerServeStaticPath = import.meta.resolve(`@hono/node-server/serve-static`);
|
|
39
|
+
const honoNodeServerPath = import.meta.resolve(`@hono/node-server`);
|
|
40
|
+
code(`import { Hono } from '${honoPath}'`);
|
|
38
41
|
code(``);
|
|
39
42
|
code(`const ${_.app} = new Hono()`);
|
|
40
43
|
code(``);
|
|
41
44
|
code(``);
|
|
42
45
|
code(`// Static Files`);
|
|
43
46
|
code(``);
|
|
44
|
-
code(`import { serveStatic } from '
|
|
47
|
+
code(`import { serveStatic } from '${honoNodeServerServeStaticPath}'`);
|
|
45
48
|
code(``);
|
|
46
49
|
code(`${_.app}.use(
|
|
47
50
|
'${staticServingPaths.routePath}',
|
|
@@ -74,7 +77,7 @@ export const Build = (parameters) => {
|
|
|
74
77
|
code(``);
|
|
75
78
|
code(`// Start Server`);
|
|
76
79
|
code(``);
|
|
77
|
-
code(`import { serve } from '
|
|
80
|
+
code(`import { serve } from '${honoNodeServerPath}'`);
|
|
78
81
|
code(`serve({ fetch: ${_.app}.fetch, port: ${serverPort.toString()} })`);
|
|
79
82
|
return code.render();
|
|
80
83
|
}]),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Configurator } from '../configurator/_namespace.js';
|
|
2
|
+
import * as HonoNodeServer from '@hono/node-server';
|
|
2
3
|
import { Vite } from '../lib/vite/_namespace.js';
|
|
3
|
-
import ReactVite from '@vitejs/plugin-react';
|
|
4
|
+
import ReactVite from '@vitejs/plugin-react-swc';
|
|
4
5
|
import { vi } from './helpers.js';
|
|
5
6
|
import { Build } from './build.js';
|
|
6
7
|
import { ViteVirtual } from '../lib/vite-virtual/_namespace.js';
|
|
@@ -16,14 +17,15 @@ export const VitePlugin = (polenConfigInput) => {
|
|
|
16
17
|
const polenConfig = Configurator.normalizeInput(polenConfigInput);
|
|
17
18
|
return VitePluginInternal(polenConfig);
|
|
18
19
|
};
|
|
19
|
-
import * as HonoNodeServer from '@hono/node-server';
|
|
20
20
|
export const VitePluginInternal = (polenConfig) => {
|
|
21
21
|
const debug = true;
|
|
22
22
|
return [
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
//
|
|
26
|
-
//
|
|
23
|
+
// {
|
|
24
|
+
// name: `debug`,
|
|
25
|
+
// configResolved(config) {
|
|
26
|
+
// dump(config)
|
|
27
|
+
// },
|
|
28
|
+
// },
|
|
27
29
|
ReactVite(),
|
|
28
30
|
ViteVirtual.Plugin([viAssetGraphqlSchema, async () => {
|
|
29
31
|
const schema = await readSchemaPointer(polenConfig.schema);
|
|
@@ -44,6 +46,7 @@ export const VitePluginInternal = (polenConfig) => {
|
|
|
44
46
|
let honoApp;
|
|
45
47
|
try {
|
|
46
48
|
const ssrloadedModule = await server.ssrLoadModule(polenConfig.paths.appTemplate.entryServer);
|
|
49
|
+
// console.log(ssrloadedModule)
|
|
47
50
|
honoApp = ssrloadedModule[`default`];
|
|
48
51
|
}
|
|
49
52
|
catch (cause) {
|
|
@@ -68,10 +71,43 @@ export const VitePluginInternal = (polenConfig) => {
|
|
|
68
71
|
};
|
|
69
72
|
},
|
|
70
73
|
config() {
|
|
74
|
+
// const reactPath = import.meta.resolve(`react`)
|
|
75
|
+
// const reactJsxRuntimePath = import.meta.resolve(`react/jsx-runtime`)
|
|
76
|
+
// const reactJsxDevRuntimePath = import.meta.resolve(`react/jsx-dev-runtime`)
|
|
71
77
|
return {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
78
|
+
optimizeDeps: {
|
|
79
|
+
include: [
|
|
80
|
+
`react`,
|
|
81
|
+
// `react/jsx-runtime`,
|
|
82
|
+
// `react/jsx-dev-runtime`,
|
|
83
|
+
// reactPath,
|
|
84
|
+
// reactJsxRuntimePath,
|
|
85
|
+
// reactJsxDevRuntimePath,
|
|
86
|
+
],
|
|
87
|
+
},
|
|
88
|
+
// Make it possible for ReactVite to find react dependency within Polen.
|
|
89
|
+
resolve: {
|
|
90
|
+
alias: [
|
|
91
|
+
// { find: `react`, replacement: reactPath },
|
|
92
|
+
// { find: `react/jsx-runtime`, replacement: reactJsxRuntimePath },
|
|
93
|
+
// { find: `react/jsx-dev-runtime`, replacement: reactJsxDevRuntimePath },
|
|
94
|
+
// {
|
|
95
|
+
// find: `react`,
|
|
96
|
+
// replacement: `polen/dependencies/react`,
|
|
97
|
+
// },
|
|
98
|
+
// {
|
|
99
|
+
// find: `react/jsx-runtime`,
|
|
100
|
+
// replacement: `polen/dependencies/react/jsx-runtime`,
|
|
101
|
+
// },
|
|
102
|
+
// {
|
|
103
|
+
// find: `react/jsx-dev-runtime`,
|
|
104
|
+
// replacement: `polen/dependencies/react/jsx-dev-runtime`,
|
|
105
|
+
// },
|
|
106
|
+
],
|
|
107
|
+
},
|
|
108
|
+
// server: {
|
|
109
|
+
// middlewareMode: true,
|
|
110
|
+
// },
|
|
75
111
|
};
|
|
76
112
|
},
|
|
77
113
|
},
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "polen",
|
|
3
|
-
"version": "0.2.0-next.
|
|
3
|
+
"version": "0.2.0-next.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"examples:unlink": "rm -rf examples/{basic,github}/pnpm-workspace.yaml && git checkout examples/*/pnpm-lock.yaml",
|
|
7
7
|
"test:examples": "playwright test --config 'examples/_tests/playwright.config.ts'",
|
|
8
8
|
"test:integration": "playwright test --config 'tests/integration/playwright.config.ts'",
|
|
9
9
|
"dev": "pnpm build:watch:emit",
|
|
10
|
+
"build:clean": "tsc --build tsconfig.build.json --clean && rm -rf build",
|
|
10
11
|
"build": "tsc --build tsconfig.build.json",
|
|
11
12
|
"build:watch": "tsc --build tsconfig.build.json --watch",
|
|
12
13
|
"build:watch:emit": "tsc --build tsconfig.build.json --watch --nocheck",
|
|
@@ -28,8 +29,11 @@
|
|
|
28
29
|
"url": "git+https://github.com/the-guild-org/polen.git"
|
|
29
30
|
},
|
|
30
31
|
"exports": {
|
|
31
|
-
".": "./build/_namespace.js",
|
|
32
|
-
"./exports": "./build/_exports.js"
|
|
32
|
+
".": "./build/entrypoints/_namespace.js",
|
|
33
|
+
"./exports": "./build/entrypoints/_exports.js",
|
|
34
|
+
"./dependencies/react/jsx-runtime": "./build/entrypoints/dependencies/react/jsx-runtime.js",
|
|
35
|
+
"./dependencies/react/jsx-dev-runtime": "./build/entrypoints/dependencies/react/jsx-dev-runtime.js",
|
|
36
|
+
"./dependencies/react": "./build/entrypoints/dependencies/react.js"
|
|
33
37
|
},
|
|
34
38
|
"files": [
|
|
35
39
|
"build",
|
|
@@ -40,7 +44,7 @@
|
|
|
40
44
|
"@hono/vite-dev-server": "^0.19.0",
|
|
41
45
|
"@radix-ui/react-icons": "^1.3.2",
|
|
42
46
|
"@radix-ui/themes": "^3.2.1",
|
|
43
|
-
"@vitejs/plugin-react": "^
|
|
47
|
+
"@vitejs/plugin-react-swc": "^3.8.1",
|
|
44
48
|
"consola": "^3.4.2",
|
|
45
49
|
"defu": "^6.1.4",
|
|
46
50
|
"es-toolkit": "^1.34.1",
|
|
@@ -48,8 +52,6 @@
|
|
|
48
52
|
"graphql": "^16.10.0",
|
|
49
53
|
"hono": "^4.7.6",
|
|
50
54
|
"marked": "^15.0.8",
|
|
51
|
-
"react": "^19.1.0",
|
|
52
|
-
"react-dom": "^19.1.0",
|
|
53
55
|
"react-router": "^7.5.0"
|
|
54
56
|
},
|
|
55
57
|
"devDependencies": {
|
|
@@ -76,6 +78,8 @@
|
|
|
76
78
|
"globals": "^16.0.0",
|
|
77
79
|
"playwright": "^1.51.1",
|
|
78
80
|
"publint": "^0.3.11",
|
|
81
|
+
"react": "^19.1.0",
|
|
82
|
+
"react-dom": "^19.1.0",
|
|
79
83
|
"strip-ansi": "^7.1.0",
|
|
80
84
|
"tsx": "^4.19.3",
|
|
81
85
|
"type-fest": "^4.39.1",
|
|
@@ -88,6 +92,8 @@
|
|
|
88
92
|
},
|
|
89
93
|
"packageManager": "pnpm@10.8.0",
|
|
90
94
|
"peerDependencies": {
|
|
95
|
+
"react": "^19.1.0",
|
|
96
|
+
"react-dom": "^19.1.0",
|
|
91
97
|
"vite": "^6.2.5"
|
|
92
98
|
}
|
|
93
99
|
}
|
package/build/_exports.d.ts
DELETED
package/build/_exports.js
DELETED
|
File without changes
|
|
File without changes
|