orga-build 0.2.2 → 0.2.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/lib/app.jsx +3 -3
- package/lib/build.d.ts.map +1 -1
- package/lib/build.js +2 -0
- package/lib/components.d.ts +2 -0
- package/lib/components.d.ts.map +1 -0
- package/lib/components.js +1 -0
- package/lib/ssr.jsx +1 -1
- package/lib/vite.d.ts.map +1 -1
- package/lib/vite.js +23 -10
- package/package.json +6 -12
package/lib/app.jsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import pages from '
|
|
2
|
-
import layouts from '
|
|
3
|
-
import * as components from '
|
|
1
|
+
import pages from '/@orga-build/pages'
|
|
2
|
+
import layouts from '/@orga-build/layouts'
|
|
3
|
+
import * as components from '/@orga-build/components'
|
|
4
4
|
import { Route, Switch, Link } from 'wouter'
|
|
5
5
|
|
|
6
6
|
export function App() {
|
package/lib/build.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["build.js"],"names":[],"mappings":"AAWA;;GAEG;AACH,qEAFW,OAAO,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["build.js"],"names":[],"mappings":"AAWA;;GAEG;AACH,qEAFW,OAAO,aAAa,EAAE,MAAM,iBA0JtC"}
|
package/lib/build.js
CHANGED
|
@@ -40,6 +40,7 @@ export async function build({
|
|
|
40
40
|
build: {
|
|
41
41
|
ssr: true,
|
|
42
42
|
cssCodeSplit: false,
|
|
43
|
+
emptyOutDir: true,
|
|
43
44
|
rollupOptions: {
|
|
44
45
|
input: fileURLToPath(new URL('./ssr.jsx', import.meta.url)),
|
|
45
46
|
output: {
|
|
@@ -67,6 +68,7 @@ export async function build({
|
|
|
67
68
|
plugins,
|
|
68
69
|
build: {
|
|
69
70
|
cssCodeSplit: false,
|
|
71
|
+
emptyOutDir: true,
|
|
70
72
|
rollupOptions: {
|
|
71
73
|
input: fileURLToPath(new URL('./client.jsx', import.meta.url)),
|
|
72
74
|
preserveEntrySignatures: 'allow-extension'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["components.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Link } from 'wouter'
|
package/lib/ssr.jsx
CHANGED
package/lib/vite.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["vite.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["vite.js"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,uCAHG;IAAwB,GAAG,EAAnB,MAAM;CACd,GAAU,OAAO,MAAM,EAAE,MAAM,CA2GjC"}
|
package/lib/vite.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { setup } from './files.js'
|
|
2
2
|
import path from 'node:path'
|
|
3
3
|
|
|
4
|
-
const magicModulePrefix = '
|
|
5
|
-
const
|
|
4
|
+
const magicModulePrefix = '/@orga-build/'
|
|
5
|
+
const pagesModuleId = magicModulePrefix + 'pages'
|
|
6
|
+
const appEntryId = `${magicModulePrefix}main.js`
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* @param {Object} options
|
|
@@ -15,6 +16,19 @@ export function pluginFactory({ dir }) {
|
|
|
15
16
|
return {
|
|
16
17
|
name: 'vite-plugin-orga-pages',
|
|
17
18
|
enforce: 'pre',
|
|
19
|
+
config: (config, env) => ({
|
|
20
|
+
optimizeDeps: {
|
|
21
|
+
include: [
|
|
22
|
+
'react',
|
|
23
|
+
'react/jsx-runtime',
|
|
24
|
+
'react-dom',
|
|
25
|
+
'react-dom/client',
|
|
26
|
+
'wouter'
|
|
27
|
+
],
|
|
28
|
+
exclude: ['orga-build']
|
|
29
|
+
}
|
|
30
|
+
}),
|
|
31
|
+
|
|
18
32
|
configureServer({ watcher, moduleGraph }) {
|
|
19
33
|
const reloadVirtualModule = (/** @type {string} */ moduleId) => {
|
|
20
34
|
const module = moduleGraph.getModuleById(moduleId)
|
|
@@ -27,8 +41,7 @@ export function pluginFactory({ dir }) {
|
|
|
27
41
|
reloadVirtualModule('/')
|
|
28
42
|
},
|
|
29
43
|
|
|
30
|
-
buildStart() {
|
|
31
|
-
},
|
|
44
|
+
buildStart() {},
|
|
32
45
|
|
|
33
46
|
async resolveId(id, importer) {
|
|
34
47
|
if (id === appEntryId) {
|
|
@@ -40,13 +53,13 @@ export function pluginFactory({ dir }) {
|
|
|
40
53
|
},
|
|
41
54
|
async load(id) {
|
|
42
55
|
if (id === appEntryId) {
|
|
43
|
-
return `import "orga-build/csr
|
|
56
|
+
return `import "orga-build/csr";`
|
|
44
57
|
}
|
|
45
|
-
if (id ===
|
|
58
|
+
if (id === pagesModuleId) {
|
|
46
59
|
return await renderPageList()
|
|
47
60
|
}
|
|
48
|
-
if (id.startsWith(
|
|
49
|
-
let pageId = id.replace(
|
|
61
|
+
if (id.startsWith(pagesModuleId)) {
|
|
62
|
+
let pageId = id.replace(pagesModuleId, '')
|
|
50
63
|
const page = await files.page(pageId)
|
|
51
64
|
if (page) {
|
|
52
65
|
return `
|
|
@@ -56,7 +69,7 @@ export {default} from '${page.dataPath}';
|
|
|
56
69
|
}
|
|
57
70
|
}
|
|
58
71
|
|
|
59
|
-
if (id === `${magicModulePrefix}
|
|
72
|
+
if (id === `${magicModulePrefix}layouts`) {
|
|
60
73
|
const layouts = await files.layouts()
|
|
61
74
|
/** @type {string[]} */
|
|
62
75
|
const imports = []
|
|
@@ -72,7 +85,7 @@ export default layouts;
|
|
|
72
85
|
`
|
|
73
86
|
}
|
|
74
87
|
|
|
75
|
-
if (id === `${magicModulePrefix}
|
|
88
|
+
if (id === `${magicModulePrefix}components`) {
|
|
76
89
|
return await renderComponents()
|
|
77
90
|
}
|
|
78
91
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "orga-build",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "A simple tool that builds org-mode files into a website",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"types": "./index.d.ts",
|
|
19
19
|
"import": "./index.js"
|
|
20
20
|
},
|
|
21
|
-
"./csr
|
|
21
|
+
"./csr": "./lib/csr.jsx",
|
|
22
|
+
"./components": "./lib/components.js"
|
|
22
23
|
},
|
|
23
24
|
"keywords": [
|
|
24
25
|
"orgajs",
|
|
@@ -31,15 +32,14 @@
|
|
|
31
32
|
"license": "MIT",
|
|
32
33
|
"dependencies": {
|
|
33
34
|
"@vitejs/plugin-react": "^4.4.0",
|
|
34
|
-
"esbuild": "^0.24.2",
|
|
35
35
|
"express": "^5.1.0",
|
|
36
36
|
"globby": "^14.1.0",
|
|
37
|
+
"react": "^19.0.0",
|
|
38
|
+
"react-dom": "^19.0.0",
|
|
37
39
|
"rehype-katex": "^7.0.1",
|
|
38
40
|
"unist-util-visit-parents": "^6.0.1",
|
|
39
41
|
"vite": "6.3.2",
|
|
40
42
|
"wouter": "^3.7.0",
|
|
41
|
-
"@orgajs/esbuild": "^1.1.3",
|
|
42
|
-
"@orgajs/node-loader": "^1.1.3",
|
|
43
43
|
"@orgajs/rollup": "1.3.2"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
@@ -47,13 +47,7 @@
|
|
|
47
47
|
"@types/hast": "^3.0.4",
|
|
48
48
|
"@types/node": "^22.13.1",
|
|
49
49
|
"@types/react": "^19.0.8",
|
|
50
|
-
"@types/react-dom": "^19.0.3"
|
|
51
|
-
"@orgajs/orgx": "^2.5.2",
|
|
52
|
-
"orga": "^4.5.1"
|
|
53
|
-
},
|
|
54
|
-
"peerDependencies": {
|
|
55
|
-
"react": "^19.0.0",
|
|
56
|
-
"react-dom": "^19.0.0"
|
|
50
|
+
"@types/react-dom": "^19.0.3"
|
|
57
51
|
},
|
|
58
52
|
"scripts": {}
|
|
59
53
|
}
|