polen 0.8.0-next.6 → 0.8.0-next.8
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/build/api/api.d.ts +4 -0
- package/build/api/api.d.ts.map +1 -0
- package/build/api/api.js +4 -0
- package/build/api/api.js.map +1 -0
- package/build/api/{build/build.d.ts → builder/builder.d.ts} +3 -3
- package/build/api/builder/builder.d.ts.map +1 -0
- package/build/api/{build/build.js → builder/builder.js} +11 -14
- package/build/api/builder/builder.js.map +1 -0
- package/build/api/builder/index.d.ts +2 -0
- package/build/api/builder/index.d.ts.map +1 -0
- package/build/api/builder/index.js +2 -0
- package/build/api/builder/index.js.map +1 -0
- package/build/api/config/config.d.ts +5 -0
- package/build/api/config/config.d.ts.map +1 -0
- package/build/api/config/config.js +5 -0
- package/build/api/config/config.js.map +1 -0
- package/build/api/{configurator → config}/configurator.d.ts +13 -3
- package/build/api/config/configurator.d.ts.map +1 -0
- package/build/api/{configurator → config}/configurator.js +52 -28
- package/build/api/config/configurator.js.map +1 -0
- package/build/api/config/define.d.ts +7 -0
- package/build/api/config/define.d.ts.map +1 -0
- package/build/api/config/define.js +7 -0
- package/build/api/config/define.js.map +1 -0
- package/build/api/config/index.d.ts +2 -0
- package/build/api/config/index.d.ts.map +1 -0
- package/build/api/config/index.js +2 -0
- package/build/api/config/index.js.map +1 -0
- package/build/api/config/load.d.ts +11 -0
- package/build/api/config/load.d.ts.map +1 -0
- package/build/api/config/load.js +36 -0
- package/build/api/config/load.js.map +1 -0
- package/build/api/config/merge.d.ts +7 -0
- package/build/api/config/merge.d.ts.map +1 -0
- package/build/api/config/merge.js +54 -0
- package/build/api/config/merge.js.map +1 -0
- package/build/api/config-resolver/config-resolver.d.ts +3 -0
- package/build/api/config-resolver/config-resolver.d.ts.map +1 -0
- package/build/api/config-resolver/config-resolver.js +3 -0
- package/build/api/config-resolver/config-resolver.js.map +1 -0
- package/build/api/config-resolver/index.d.ts +2 -0
- package/build/api/config-resolver/index.d.ts.map +1 -0
- package/build/api/config-resolver/index.js +2 -0
- package/build/api/config-resolver/index.js.map +1 -0
- package/build/api/config-resolver/resolve.d.ts +16 -0
- package/build/api/config-resolver/resolve.d.ts.map +1 -0
- package/build/api/config-resolver/resolve.js +21 -0
- package/build/api/config-resolver/resolve.js.map +1 -0
- package/build/api/config-resolver/vite.d.ts +10 -0
- package/build/api/config-resolver/vite.d.ts.map +1 -0
- package/build/api/config-resolver/vite.js +18 -0
- package/build/api/config-resolver/vite.js.map +1 -0
- package/build/api/index.d.ts +2 -0
- package/build/api/index.d.ts.map +1 -0
- package/build/api/index.js +2 -0
- package/build/api/index.js.map +1 -0
- package/build/api/vite/plugins/build.d.ts +2 -2
- package/build/api/vite/plugins/build.d.ts.map +1 -1
- package/build/api/vite/plugins/build.js.map +1 -1
- package/build/api/vite/plugins/core.d.ts +2 -2
- package/build/api/vite/plugins/core.d.ts.map +1 -1
- package/build/api/vite/plugins/core.js.map +1 -1
- package/build/api/vite/plugins/main.d.ts +2 -2
- package/build/api/vite/plugins/main.d.ts.map +1 -1
- package/build/api/vite/plugins/main.js.map +1 -1
- package/build/api/vite/plugins/serve.d.ts +2 -2
- package/build/api/vite/plugins/serve.d.ts.map +1 -1
- package/build/api/vite/plugins/serve.js.map +1 -1
- package/build/cli/commands/$default.js +1 -1
- package/build/cli/commands/$default.js.map +1 -1
- package/build/cli/commands/build.js +3 -5
- package/build/cli/commands/build.js.map +1 -1
- package/build/cli/commands/dev.js +27 -9
- package/build/cli/commands/dev.js.map +1 -1
- package/build/cli/commands/open.js +2 -2
- package/build/cli/commands/open.js.map +1 -1
- package/build/cli/index.js +6 -0
- package/build/cli/index.js.map +1 -1
- package/build/exports/polen.d.ts +3 -3
- package/build/exports/polen.d.ts.map +1 -1
- package/build/exports/polen.js +3 -3
- package/build/exports/polen.js.map +1 -1
- package/build/lib/kit-temp.d.ts +5 -0
- package/build/lib/kit-temp.d.ts.map +1 -1
- package/build/lib/kit-temp.js +29 -0
- package/build/lib/kit-temp.js.map +1 -1
- package/build/project-data.d.ts +2 -2
- package/build/project-data.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/api/api.ts +3 -0
- package/src/api/{build/build.ts → builder/builder.ts} +11 -14
- package/src/api/builder/index.ts +1 -0
- package/src/api/config/config.ts +4 -0
- package/src/api/{configurator → config}/configurator.ts +61 -42
- package/src/api/config/define.ts +8 -0
- package/src/api/config/index.ts +1 -0
- package/src/api/config/load.ts +52 -0
- package/src/api/config/merge.ts +68 -0
- package/src/api/config-resolver/config-resolver.ts +2 -0
- package/src/api/config-resolver/index.ts +1 -0
- package/src/api/config-resolver/resolve.ts +28 -0
- package/src/api/config-resolver/vite.ts +27 -0
- package/src/api/index.ts +1 -0
- package/src/api/vite/plugins/build.ts +3 -3
- package/src/api/vite/plugins/core.ts +2 -2
- package/src/api/vite/plugins/main.ts +2 -2
- package/src/api/vite/plugins/serve.ts +2 -2
- package/src/cli/commands/$default.ts +1 -1
- package/src/cli/commands/build.ts +3 -5
- package/src/cli/commands/dev.ts +32 -10
- package/src/cli/commands/open.ts +2 -2
- package/src/cli/index.ts +7 -0
- package/src/exports/polen.ts +3 -3
- package/src/lib/kit-temp.ts +30 -0
- package/src/project-data.ts +2 -2
- package/build/api/build/build.d.ts.map +0 -1
- package/build/api/build/build.js.map +0 -1
- package/build/api/configurator/configurator.d.ts.map +0 -1
- package/build/api/configurator/configurator.js.map +0 -1
- package/build/api/configurator/index.d.ts +0 -2
- package/build/api/configurator/index.d.ts.map +0 -1
- package/build/api/configurator/index.js +0 -2
- package/build/api/configurator/index.js.map +0 -1
- package/build/api/define-config.d.ts +0 -13
- package/build/api/define-config.d.ts.map +0 -1
- package/build/api/define-config.js +0 -23
- package/build/api/define-config.js.map +0 -1
- package/build/api/load-config.d.ts +0 -9
- package/build/api/load-config.d.ts.map +0 -1
- package/build/api/load-config.js +0 -40
- package/build/api/load-config.js.map +0 -1
- package/build/api/vite/vite-plugin-delete.d.ts +0 -2
- package/build/api/vite/vite-plugin-delete.d.ts.map +0 -1
- package/build/api/vite/vite-plugin-delete.js +0 -11
- package/build/api/vite/vite-plugin-delete.js.map +0 -1
- package/src/api/configurator/index.ts +0 -1
- package/src/api/define-config.ts +0 -35
- package/src/api/load-config.ts +0 -55
- package/src/api/vite/vite-plugin-delete.ts +0 -10
@@ -1,4 +1,5 @@
|
|
1
1
|
import type { Vite } from '#dep/vite/index.js'
|
2
|
+
import { assertPathAbsolute } from '#lib/kit-temp.js'
|
2
3
|
import { Path } from '@wollybeard/kit'
|
3
4
|
import { z } from 'zod'
|
4
5
|
import type { SchemaAugmentation } from '../../api/schema-augmentation/index.js'
|
@@ -21,9 +22,9 @@ export interface ConfigInput {
|
|
21
22
|
/**
|
22
23
|
* Path to the root directory of your project.
|
23
24
|
*
|
24
|
-
* Relative paths will be resolved relative to
|
25
|
+
* Relative paths will be resolved relative to this config file.
|
25
26
|
*
|
26
|
-
* @defaultValue
|
27
|
+
* @defaultValue The directory where the config file is located.
|
27
28
|
*/
|
28
29
|
root?: string
|
29
30
|
/**
|
@@ -90,7 +91,37 @@ export interface TemplateVariables {
|
|
90
91
|
title: string
|
91
92
|
}
|
92
93
|
|
94
|
+
const buildPaths = (rootDir: string): Config[`paths`] => {
|
95
|
+
if (!Path.isAbsolute(rootDir)) throw new Error(`Root dir path must be absolute: ${rootDir}`)
|
96
|
+
const ensureAbsolute = Path.ensureAbsoluteWith(rootDir)
|
97
|
+
return {
|
98
|
+
project: {
|
99
|
+
rootDir,
|
100
|
+
relative: {
|
101
|
+
build: {
|
102
|
+
root: `build`,
|
103
|
+
relative: {
|
104
|
+
serverEntrypoint: `app.js`,
|
105
|
+
assets: `assets`,
|
106
|
+
},
|
107
|
+
},
|
108
|
+
pages: `pages`,
|
109
|
+
},
|
110
|
+
absolute: {
|
111
|
+
build: {
|
112
|
+
root: ensureAbsolute(`build`),
|
113
|
+
serverEntrypoint: ensureAbsolute(`build/app.js`),
|
114
|
+
assets: ensureAbsolute(`build/assets`),
|
115
|
+
},
|
116
|
+
pages: ensureAbsolute(`pages`),
|
117
|
+
},
|
118
|
+
},
|
119
|
+
framework: packagePaths,
|
120
|
+
}
|
121
|
+
}
|
122
|
+
|
93
123
|
export interface Config {
|
124
|
+
_input: ConfigInput
|
94
125
|
build: {
|
95
126
|
architecture: BuildArchitecture
|
96
127
|
}
|
@@ -135,6 +166,7 @@ export interface Config {
|
|
135
166
|
}
|
136
167
|
|
137
168
|
const configInputDefaults: Config = {
|
169
|
+
_input: {},
|
138
170
|
templateVariables: {
|
139
171
|
title: `My Developer Portal`,
|
140
172
|
},
|
@@ -149,30 +181,7 @@ const configInputDefaults: Config = {
|
|
149
181
|
ssr: {
|
150
182
|
enabled: true,
|
151
183
|
},
|
152
|
-
paths:
|
153
|
-
project: {
|
154
|
-
rootDir: process.cwd(),
|
155
|
-
relative: {
|
156
|
-
build: {
|
157
|
-
root: `build`,
|
158
|
-
relative: {
|
159
|
-
serverEntrypoint: `app.js`,
|
160
|
-
assets: `assets`,
|
161
|
-
},
|
162
|
-
},
|
163
|
-
pages: `pages`,
|
164
|
-
},
|
165
|
-
absolute: {
|
166
|
-
build: {
|
167
|
-
root: Path.ensureAbsoluteWithCWD(`build`),
|
168
|
-
serverEntrypoint: Path.ensureAbsoluteWithCWD(`build/app.js`),
|
169
|
-
assets: Path.ensureAbsoluteWithCWD(`build/assets`),
|
170
|
-
},
|
171
|
-
pages: Path.ensureAbsoluteWithCWD(`pages`),
|
172
|
-
},
|
173
|
-
},
|
174
|
-
framework: packagePaths,
|
175
|
-
},
|
184
|
+
paths: buildPaths(process.cwd()),
|
176
185
|
advanced: {
|
177
186
|
debug: false,
|
178
187
|
explorer: false,
|
@@ -180,11 +189,26 @@ const configInputDefaults: Config = {
|
|
180
189
|
}
|
181
190
|
|
182
191
|
export const normalizeInput = async (
|
183
|
-
configInput
|
192
|
+
configInput: ConfigInput | undefined,
|
193
|
+
/**
|
194
|
+
* If the input has a relative root path, then resolve it relative to this path.
|
195
|
+
*
|
196
|
+
* We tell users relative paths are resolved to the config file directory.
|
197
|
+
* Config loaders should pass the directory of the config file here to ensure that happens.
|
198
|
+
*
|
199
|
+
* If this is omitted, then relative root paths will throw an error.
|
200
|
+
*/
|
201
|
+
baseRootDirPath: string,
|
184
202
|
// eslint-disable-next-line
|
185
203
|
): Promise<Config> => {
|
204
|
+
assertPathAbsolute(baseRootDirPath)
|
205
|
+
|
186
206
|
const config = structuredClone(configInputDefaults)
|
187
207
|
|
208
|
+
if (configInput) {
|
209
|
+
config._input = configInput
|
210
|
+
}
|
211
|
+
|
188
212
|
if (configInput?.build?.architecture) {
|
189
213
|
config.build.architecture = configInput.build.architecture
|
190
214
|
}
|
@@ -193,21 +217,16 @@ export const normalizeInput = async (
|
|
193
217
|
config.advanced.debug = configInput.advanced.debug
|
194
218
|
}
|
195
219
|
|
196
|
-
if (configInput?.root) {
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
)
|
203
|
-
config.paths
|
204
|
-
|
205
|
-
|
206
|
-
)
|
207
|
-
config.paths.project.absolute.pages = Path.join(
|
208
|
-
config.paths.project.rootDir,
|
209
|
-
config.paths.project.relative.pages,
|
210
|
-
)
|
220
|
+
if (configInput?.root !== undefined) {
|
221
|
+
if (!baseRootDirPath && !Path.isAbsolute(configInput.root)) {
|
222
|
+
throw new Error(
|
223
|
+
`Root path must be absolute or baseRootPath must be provided to resolve relative root paths. Provided: ${configInput.root}`,
|
224
|
+
)
|
225
|
+
}
|
226
|
+
const root = Path.ensureAbsolute(configInput.root, baseRootDirPath)
|
227
|
+
config.paths = buildPaths(root)
|
228
|
+
} else if (baseRootDirPath) {
|
229
|
+
config.paths = buildPaths(baseRootDirPath)
|
211
230
|
}
|
212
231
|
|
213
232
|
if (configInput?.advanced?.vite) {
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { Fn } from '@wollybeard/kit'
|
2
|
+
import type { ConfigInput } from './configurator.js'
|
3
|
+
|
4
|
+
/**
|
5
|
+
* Define a Polen configuration.
|
6
|
+
* This is an identity function that provides type safety for config files.
|
7
|
+
*/
|
8
|
+
export const defineConfig = Fn.identity<ConfigInput>
|
@@ -0,0 +1 @@
|
|
1
|
+
export * as Config from './config.js'
|
@@ -0,0 +1,52 @@
|
|
1
|
+
import { assertOptionalPathAbsolute, pickFirstPathExisting } from '#lib/kit-temp.js'
|
2
|
+
import type { Prom } from '@wollybeard/kit'
|
3
|
+
import { Path } from '@wollybeard/kit'
|
4
|
+
import type { ConfigInput } from './configurator.js'
|
5
|
+
|
6
|
+
export const fileNameBases = [`polen.config`, `.polen.config`]
|
7
|
+
export const fileNameExtensionsTypeScript = [`.ts`, `.js`, `.mjs`, `.mts`]
|
8
|
+
export const fileNameExtensionsJavaScript = [`.js`, `.mjs`]
|
9
|
+
export const fileNameExtensions = [...fileNameExtensionsTypeScript, ...fileNameExtensionsJavaScript]
|
10
|
+
export const fileNames = fileNameBases.flatMap(base => fileNameExtensions.map(ext => `${base}${ext}`))
|
11
|
+
|
12
|
+
export interface LoadOptions {
|
13
|
+
dir: string
|
14
|
+
}
|
15
|
+
|
16
|
+
export const load = async (options: LoadOptions): Promise<ConfigInput> => {
|
17
|
+
assertOptionalPathAbsolute(options.dir)
|
18
|
+
|
19
|
+
const filePaths = fileNames.map(fileName => Path.join(options.dir, fileName))
|
20
|
+
const filePath = await pickFirstPathExisting(filePaths)
|
21
|
+
|
22
|
+
if (!filePath) return {}
|
23
|
+
|
24
|
+
let module: { default?: Prom.Maybe<ConfigInput>; config?: Prom.Maybe<ConfigInput> }
|
25
|
+
|
26
|
+
if (fileNameExtensionsTypeScript.some(_ => filePath.endsWith(_))) {
|
27
|
+
// @see https://tsx.is/dev-api/ts-import#usage
|
28
|
+
const { tsImport } = await import(`tsx/esm/api`)
|
29
|
+
// eslint-disable-next-line
|
30
|
+
module = await tsImport(filePath, import.meta.url)
|
31
|
+
} else {
|
32
|
+
// eslint-disable-next-line
|
33
|
+
module = await import(filePath)
|
34
|
+
}
|
35
|
+
|
36
|
+
// // Use dynamic import with file URL to support Windows
|
37
|
+
// const configUrl = pathToFileURL(configPath).href
|
38
|
+
|
39
|
+
// todo: report errors nicely if this fails
|
40
|
+
const configInput = await (module.default ?? module.config)
|
41
|
+
|
42
|
+
// todo: check schema of configInput
|
43
|
+
|
44
|
+
// todo: report errors nicely
|
45
|
+
if (!configInput) {
|
46
|
+
throw new Error(
|
47
|
+
`Your Polen config module (${filePath}) must export a config. You can use a default export or named export of \`config\`.`,
|
48
|
+
)
|
49
|
+
}
|
50
|
+
|
51
|
+
return configInput
|
52
|
+
}
|
@@ -0,0 +1,68 @@
|
|
1
|
+
import { Vite } from '#dep/vite/index.js'
|
2
|
+
import type { ConfigInput } from './configurator.js'
|
3
|
+
|
4
|
+
/**
|
5
|
+
* Deep merge two Polen config inputs.
|
6
|
+
* The second config (overrides) takes precedence over the first (base).
|
7
|
+
*/
|
8
|
+
export const mergeInputs = (
|
9
|
+
base: ConfigInput,
|
10
|
+
// eslint-disable-next-line
|
11
|
+
overrides?: ConfigInput | undefined,
|
12
|
+
): ConfigInput => {
|
13
|
+
if (!overrides) {
|
14
|
+
return base
|
15
|
+
}
|
16
|
+
|
17
|
+
const merged: ConfigInput = {
|
18
|
+
...base,
|
19
|
+
...overrides,
|
20
|
+
}
|
21
|
+
|
22
|
+
// Merge schema if both have it
|
23
|
+
if (base.schema || overrides.schema) {
|
24
|
+
merged.schema = overrides.schema ?? base.schema
|
25
|
+
}
|
26
|
+
|
27
|
+
// Merge build config
|
28
|
+
if (base.build || overrides.build) {
|
29
|
+
merged.build = {
|
30
|
+
...base.build,
|
31
|
+
...overrides.build,
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
35
|
+
// Merge advanced config
|
36
|
+
if (base.advanced || overrides.advanced) {
|
37
|
+
merged.advanced = {
|
38
|
+
...base.advanced,
|
39
|
+
...overrides.advanced,
|
40
|
+
}
|
41
|
+
|
42
|
+
// Merge advanced.watch config
|
43
|
+
if (base.advanced?.watch || overrides.advanced?.watch) {
|
44
|
+
merged.advanced.watch = {
|
45
|
+
...base.advanced?.watch,
|
46
|
+
...overrides.advanced?.watch,
|
47
|
+
}
|
48
|
+
|
49
|
+
// Merge watch.also arrays
|
50
|
+
if (base.advanced?.watch?.also || overrides.advanced?.watch?.also) {
|
51
|
+
merged.advanced.watch.also = [
|
52
|
+
...(base.advanced?.watch?.also ?? []),
|
53
|
+
...(overrides.advanced?.watch?.also ?? []),
|
54
|
+
]
|
55
|
+
}
|
56
|
+
}
|
57
|
+
|
58
|
+
// Merge Vite configs if present
|
59
|
+
if (base.advanced?.vite ?? overrides.advanced?.vite) {
|
60
|
+
merged.advanced.vite = Vite.mergeConfig(
|
61
|
+
base.advanced?.vite ?? {},
|
62
|
+
overrides.advanced?.vite ?? {},
|
63
|
+
)
|
64
|
+
}
|
65
|
+
}
|
66
|
+
|
67
|
+
return merged
|
68
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export * as ConfigResolver from './config-resolver.js'
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { type ConfigInput, normalizeInput } from '../config/configurator.js'
|
2
|
+
import { load, type LoadOptions } from '../config/load.js'
|
3
|
+
import { mergeInputs } from '../config/merge.js'
|
4
|
+
import { toViteUserConfig, type ViteUserConfigWithPolen } from './vite.js'
|
5
|
+
|
6
|
+
interface ResolveFromFileOptions extends LoadOptions {
|
7
|
+
overrides?: ConfigInput
|
8
|
+
}
|
9
|
+
|
10
|
+
export const fromFile = async (options: ResolveFromFileOptions): Promise<ViteUserConfigWithPolen> => {
|
11
|
+
const configInput = await load(options)
|
12
|
+
const configInputMerged = mergeInputs(configInput, options.overrides)
|
13
|
+
return fromMemory(configInputMerged, options.dir)
|
14
|
+
}
|
15
|
+
|
16
|
+
export const fromMemory = async (
|
17
|
+
input: ConfigInput,
|
18
|
+
/**
|
19
|
+
* Refer to `baseRootDirPath` parameter on {@link normalizeInput}.
|
20
|
+
*
|
21
|
+
* @defaultValue `process.cwd()`
|
22
|
+
*/
|
23
|
+
baseRootDirPath?: string,
|
24
|
+
) => {
|
25
|
+
const configNormalized = await normalizeInput(input, baseRootDirPath ?? process.cwd())
|
26
|
+
const viteUserConfig = toViteUserConfig(configNormalized)
|
27
|
+
return viteUserConfig
|
28
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { Main } from '#api/vite/plugins/main.js'
|
2
|
+
import { Vite } from '#dep/vite/index.js'
|
3
|
+
import type { Config } from '../config/configurator.js'
|
4
|
+
|
5
|
+
/**
|
6
|
+
* Transform Polen config input into a Vite configuration.
|
7
|
+
*/
|
8
|
+
export const toViteUserConfig = (
|
9
|
+
config: Config,
|
10
|
+
): ViteUserConfigWithPolen => {
|
11
|
+
const viteUserConfigFromPolen: Vite.UserConfig = {
|
12
|
+
plugins: [Main(config)],
|
13
|
+
}
|
14
|
+
|
15
|
+
const viteUserConfigMerged = config.advanced.vite
|
16
|
+
? Vite.mergeConfig(viteUserConfigFromPolen, config.advanced.vite)
|
17
|
+
: viteUserConfigFromPolen
|
18
|
+
|
19
|
+
return {
|
20
|
+
...viteUserConfigMerged,
|
21
|
+
_polen: config,
|
22
|
+
}
|
23
|
+
}
|
24
|
+
|
25
|
+
export interface ViteUserConfigWithPolen extends Vite.UserConfig {
|
26
|
+
_polen: Config
|
27
|
+
}
|
package/src/api/index.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export * as Api from './api.js'
|
@@ -1,11 +1,11 @@
|
|
1
|
+
import type { Config } from '#api/config/index.js'
|
1
2
|
import { Vite } from '#dep/vite/index.js'
|
2
3
|
import { ViteVirtual } from '#lib/vite-virtual/index.js'
|
3
4
|
import { Fs, Path } from '@wollybeard/kit'
|
4
|
-
import type { Configurator } from '../../configurator/index.js'
|
5
5
|
import { isKitUnusedExternalImport, isRadixModuleLevelDirective } from '../log-filters.js'
|
6
6
|
import { vi } from '../vi.js'
|
7
7
|
|
8
|
-
export const Build = (config:
|
8
|
+
export const Build = (config: Config.Config): Vite.Plugin[] => {
|
9
9
|
// let viteConfigResolved: Vite.ResolvedConfig
|
10
10
|
|
11
11
|
// const outDir = Path.join(config.paths.project.rootDir, `dist`)
|
@@ -116,7 +116,7 @@ export const Build = (config: Configurator.Config): Vite.Plugin[] => {
|
|
116
116
|
|
117
117
|
const viClientManifest = vi([`vite`, `client`, `manifest`])
|
118
118
|
|
119
|
-
const Manifest = (config:
|
119
|
+
const Manifest = (config: Config.Config): Vite.Plugin => {
|
120
120
|
let configEnv: Vite.ConfigEnv
|
121
121
|
|
122
122
|
return {
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import type { Config } from '#api/config/index.js'
|
1
2
|
import type { ReactRouter } from '#dep/react-router/index.js'
|
2
3
|
import type { Vite } from '#dep/vite/index.js'
|
3
4
|
import { FileRouter } from '#lib/file-router/index.js'
|
@@ -15,7 +16,6 @@ import type {
|
|
15
16
|
SiteNavigationItem,
|
16
17
|
} from '../../../project-data.js'
|
17
18
|
import { superjson } from '../../../singletons/superjson.js'
|
18
|
-
import type { Configurator } from '../../configurator/index.js'
|
19
19
|
import { SchemaAugmentation } from '../../schema-augmentation/index.js'
|
20
20
|
import { Schema } from '../../schema/index.js'
|
21
21
|
import { logger } from '../logger.js'
|
@@ -30,7 +30,7 @@ export interface ProjectPagesModule {
|
|
30
30
|
pages: ReactRouter.RouteObject[]
|
31
31
|
}
|
32
32
|
|
33
|
-
export const Core = (config:
|
33
|
+
export const Core = (config: Config.Config): Vite.PluginOption[] => {
|
34
34
|
const scanPageRoutes = Cache.memoize(async () =>
|
35
35
|
await FileRouter.scan({
|
36
36
|
dir: config.paths.project.absolute.pages,
|
@@ -1,15 +1,15 @@
|
|
1
|
+
import type { Config } from '#api/config/index.js'
|
1
2
|
import type { Vite } from '#dep/vite/index.js'
|
2
3
|
import ViteReact from '@vitejs/plugin-react'
|
3
4
|
import { Arr, Path } from '@wollybeard/kit'
|
4
5
|
import Inspect from 'vite-plugin-inspect'
|
5
6
|
import Restart from 'vite-plugin-restart'
|
6
|
-
import type { Configurator } from '../../configurator/index.js'
|
7
7
|
import { Build } from './build.js'
|
8
8
|
import { Core } from './core.js'
|
9
9
|
import { Serve } from './serve.js'
|
10
10
|
|
11
11
|
export const Main = (
|
12
|
-
config:
|
12
|
+
config: Config.Config,
|
13
13
|
): Vite.PluginOption => {
|
14
14
|
const plugins: Vite.PluginOption = []
|
15
15
|
|
@@ -1,10 +1,10 @@
|
|
1
|
+
import type { Config } from '#api/config/index.js'
|
1
2
|
import type { Hono } from '#dep/hono/index.js'
|
2
3
|
import type { Vite } from '#dep/vite/index.js'
|
3
4
|
import * as HonoNodeServer from '@hono/node-server'
|
4
|
-
import type { Configurator } from '../../configurator/index.js'
|
5
5
|
|
6
6
|
export const Serve = (
|
7
|
-
config:
|
7
|
+
config: Config.Config,
|
8
8
|
): Vite.PluginOption => {
|
9
9
|
return {
|
10
10
|
name: `polen:serve`,
|
@@ -1,17 +1,15 @@
|
|
1
1
|
/* eslint-disable */
|
2
2
|
// @ts-nocheck
|
3
|
-
import {
|
4
|
-
import { Configurator } from '#api/configurator/index.js'
|
3
|
+
import { Api } from '#api/index.js'
|
5
4
|
import { Vite } from '#dep/vite/index.js'
|
6
5
|
import { Command } from '@molt/command'
|
7
6
|
import { z } from 'zod'
|
8
|
-
import { loadConfig } from '../../api/load-config.js'
|
9
7
|
|
10
8
|
const args = Command.create()
|
11
9
|
.parameter(`--debug -d`, z.boolean().default(false))
|
12
10
|
.parameter(
|
13
11
|
`--architecture -a`,
|
14
|
-
|
12
|
+
Api.Config.BuildArchitecture.default('ssg').describe('Which kind of application architecture to output.'),
|
15
13
|
)
|
16
14
|
.settings({
|
17
15
|
parameters: {
|
@@ -32,7 +30,7 @@ const args = Command.create()
|
|
32
30
|
// we don't want cli defaults to override explicit inputs in the config file either
|
33
31
|
// we need something like setset and/or an ability in molt to show a default but then have undefined internally etc.
|
34
32
|
// and now if user passes --no-debug/ --debug false it has no effect which is wrong since its not via default anymore, ... ugh
|
35
|
-
await build({
|
33
|
+
await Api.Builder.build({
|
36
34
|
...(args.debug === false ? {} : { debug: args.debug }),
|
37
35
|
...(args.architecture === 'ssg' ? {} : { architecture: args.architecture }),
|
38
36
|
})
|
package/src/cli/commands/dev.ts
CHANGED
@@ -1,18 +1,40 @@
|
|
1
|
+
/* eslint-disable */
|
2
|
+
// @ts-nocheck
|
3
|
+
import { Api } from '#api/index.js'
|
1
4
|
import { Vite } from '#dep/vite/index.js'
|
2
|
-
import {
|
3
|
-
import {
|
5
|
+
import { ensureOptionalAbsolute, ensureOptionalAbsoluteWithCwd } from '#lib/kit-temp.js'
|
6
|
+
import { Command } from '@molt/command'
|
7
|
+
import { Err, Path } from '@wollybeard/kit'
|
8
|
+
import { z } from 'zod'
|
9
|
+
// import { loadConfig } from '../../api/load-config.js'
|
4
10
|
|
5
|
-
const
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
+
const args = Command.create()
|
12
|
+
.parameter(
|
13
|
+
`--project -p`,
|
14
|
+
// @ts-expect-error
|
15
|
+
z.string().optional().describe(`The path to the project directory. Default is CWD (current working directory).`),
|
16
|
+
)
|
17
|
+
.settings({
|
18
|
+
parameters: {
|
19
|
+
environment: {
|
20
|
+
$default: {
|
21
|
+
// todo prfix seting doesn't seem to work with Molt!
|
22
|
+
prefix: `POLEN_DEV_`,
|
23
|
+
enabled: false,
|
24
|
+
},
|
25
|
+
},
|
26
|
+
},
|
27
|
+
})
|
28
|
+
.parse()
|
11
29
|
|
12
|
-
const
|
30
|
+
const dir = ensureOptionalAbsoluteWithCwd(args.project) as string
|
31
|
+
|
32
|
+
const viteUserConfig = await Api.ConfigResolver.fromFile({ dir })
|
33
|
+
|
34
|
+
const viteDevServer = await Err.tryCatch(() => Vite.createServer(viteUserConfig))
|
13
35
|
|
14
36
|
if (Err.is(viteDevServer)) {
|
15
|
-
|
37
|
+
Err.log(viteDevServer)
|
16
38
|
process.exit(1)
|
17
39
|
}
|
18
40
|
|
package/src/cli/commands/open.ts
CHANGED
@@ -8,6 +8,7 @@
|
|
8
8
|
* polen open --sdl https://docs.github.com/public/fpt/schema.docs.graphql
|
9
9
|
*/
|
10
10
|
|
11
|
+
import { Api } from '#api/index.js'
|
11
12
|
import { Vite } from '#dep/vite/index.js'
|
12
13
|
import { Grafaid } from '#lib/grafaid/index.js'
|
13
14
|
import { GraphqlSchemaLoader } from '#lib/graphql-schema-loader/index.js'
|
@@ -16,7 +17,6 @@ import type { Fn } from '@wollybeard/kit'
|
|
16
17
|
import { Err, Fs, Json, Path, Rec } from '@wollybeard/kit'
|
17
18
|
import { homedir } from 'node:os'
|
18
19
|
import { z } from 'zod'
|
19
|
-
import { defineConfig } from '../../api/define-config.js'
|
20
20
|
|
21
21
|
const args = Command.create()
|
22
22
|
.parameter(
|
@@ -156,7 +156,7 @@ const schema = await load(
|
|
156
156
|
},
|
157
157
|
)
|
158
158
|
|
159
|
-
const config = await
|
159
|
+
const config = await Api.ConfigResolver.fromMemory({
|
160
160
|
root: await Fs.makeTemporaryDirectory(),
|
161
161
|
schema: {
|
162
162
|
dataSources: {
|
package/src/cli/index.ts
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
2
|
|
3
3
|
import { Cli, Path } from '@wollybeard/kit'
|
4
|
+
import manifest from '../../package.json' with { type: 'json' }
|
5
|
+
|
6
|
+
// Handle --version flag
|
7
|
+
if (process.argv.includes('--version') || process.argv.includes('-v')) {
|
8
|
+
console.log(manifest.version)
|
9
|
+
process.exit(0)
|
10
|
+
}
|
4
11
|
|
5
12
|
const commandsDir = Path.join(import.meta.dirname, `commands`)
|
6
13
|
await Cli.dispatch(commandsDir)
|
package/src/exports/polen.ts
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
export {
|
2
|
-
export {
|
3
|
-
export { Main as VitePlugin } from '
|
1
|
+
export { defineConfig } from '#api/config/config.js'
|
2
|
+
export { type ConfigInput } from '#api/config/configurator.js'
|
3
|
+
export { Main as VitePlugin } from '#api/vite/plugins/main.js'
|
package/src/lib/kit-temp.ts
CHANGED
@@ -12,6 +12,8 @@
|
|
12
12
|
//
|
13
13
|
//
|
14
14
|
|
15
|
+
import { Fs, Path, Undefined } from '@wollybeard/kit'
|
16
|
+
|
15
17
|
export const arrayEquals = (a: any[], b: any[]) => {
|
16
18
|
if (a.length !== b.length) return false
|
17
19
|
for (let i = 0; i < a.length; i++) {
|
@@ -19,3 +21,31 @@ export const arrayEquals = (a: any[], b: any[]) => {
|
|
19
21
|
}
|
20
22
|
return true
|
21
23
|
}
|
24
|
+
|
25
|
+
export const ensureOptionalAbsoluteWithCwd = (pathExp: string | undefined): string => {
|
26
|
+
if (Undefined.is(pathExp)) return process.cwd()
|
27
|
+
return Path.ensureAbsolute(pathExp, process.cwd())
|
28
|
+
}
|
29
|
+
|
30
|
+
export const ensureOptionalAbsolute = (pathExp: string | undefined, basePathExp: string): string => {
|
31
|
+
assertPathAbsolute(basePathExp)
|
32
|
+
if (Undefined.is(pathExp)) return basePathExp
|
33
|
+
return Path.ensureAbsolute(pathExp, basePathExp)
|
34
|
+
}
|
35
|
+
|
36
|
+
export const assertPathAbsolute = (pathExpression: string): void => {
|
37
|
+
if (Path.isAbsolute(pathExpression)) return
|
38
|
+
throw new Error(`Path must be absolute: ${pathExpression}`)
|
39
|
+
}
|
40
|
+
|
41
|
+
export const assertOptionalPathAbsolute = (pathExpression: string | undefined, message?: string): void => {
|
42
|
+
if (Undefined.is(pathExpression)) return
|
43
|
+
if (Path.isAbsolute(pathExpression)) return
|
44
|
+
const message_ = message ?? `Path must be absolute: ${pathExpression}`
|
45
|
+
throw new Error(message_)
|
46
|
+
}
|
47
|
+
|
48
|
+
export const pickFirstPathExisting = async (paths: string[]): Promise<string | undefined> => {
|
49
|
+
const checks = await Promise.all(paths.map(path => Fs.exists(path).then(exists => exists ? path : undefined)))
|
50
|
+
return checks.find(maybePath => maybePath !== undefined)
|
51
|
+
}
|
package/src/project-data.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
+
import type { Config } from '#api/config/index.js'
|
1
2
|
import type { FileRouter } from '#lib/file-router/index.js'
|
2
|
-
import type { Configurator } from './api/configurator/index.js'
|
3
3
|
import type { Schema } from './api/schema/index.js'
|
4
4
|
|
5
5
|
export interface ProjectData {
|
@@ -7,7 +7,7 @@ export interface ProjectData {
|
|
7
7
|
siteNavigationItems: SiteNavigationItem[]
|
8
8
|
sidebarIndex: SidebarIndex
|
9
9
|
faviconPath: string
|
10
|
-
paths:
|
10
|
+
paths: Config.Config[`paths`][`project`]
|
11
11
|
pagesScanResult: FileRouter.ScanResult
|
12
12
|
server: {
|
13
13
|
static: {
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/api/build/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAWzD,UAAU,gBAAgB;IACxB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,YAAY,CAAC,EAAE,YAAY,CAAC,iBAAiB,CAAA;CAC9C;AAED,eAAO,MAAM,KAAK,GAAU,kBAAkB,gBAAgB,kBAkC7D,CAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../../src/api/build/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AACzC,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AACpC,OAAO,OAAO,MAAM,SAAS,CAAA;AAE7B,MAAM,aAAa,GAAG;IACpB,KAAK,EAAE,KAAK;IACZ,YAAY,EAAE,YAAY,CAAC,iBAAiB,CAAC,IAAI,CAAC,GAAG;CACtD,CAAA;AAOD,MAAM,CAAC,MAAM,KAA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AK,EAAE,OAAO,CAAA;QACd,IAAI,CAAC,EAAE,IAAI,CAAC,UAAU,CAAA;KACvB,CAAA;CACF;AA+CD,eAAO,MAAM,cAAc,GACzB,cAAc,WAAW,KAExB,OAAO,CAAC,MAAM,CAsDhB,CAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"configurator.js","sourceRoot":"","sources":["../../../src/api/configurator/configurator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AACtC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAqB,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAGxE,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;CACF,CAAA;AAEV,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAA;AA2HpE,MAAM,mBAAmB,GAAW;IAClC,iBAAiB,EAAE;QACjB,KAAK,EAAE,qBAAqB;KAC7B;IACD,mBAAmB,EAAE,EAAE;IACvB,KAAK,EAAE;QACL,IAAI,EAAE,EAAE;KACT;IACD,KAAK,EAAE;QACL,YAAY,EAAE,iBAAiB,CAAC,IAAI,CAAC,GAAG;KACzC;IACD,MAAM,EAAE,IAAI;IACZ,GAAG,EAAE;QACH,OAAO,EAAE,IAAI;KACd;IACD,KAAK,EAAE;QACL,OAAO,EAAE;YACP,OAAO,EAAE,OAAO,CAAC,GAAG,EAAE;YACtB,QAAQ,EAAE;gBACR,KAAK,EAAE;oBACL,IAAI,EAAE,OAAO;oBACb,QAAQ,EAAE;wBACR,gBAAgB,EAAE,QAAQ;wBAC1B,MAAM,EAAE,QAAQ;qBACjB;iBACF;gBACD,KAAK,EAAE,OAAO;aACf;YACD,QAAQ,EAAE;gBACR,KAAK,EAAE;oBACL,IAAI,EAAE,IAAI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