polen 0.8.0-next.8 → 0.8.0-next.9
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/vite/plugins/core.d.ts.map +1 -1
- package/build/api/vite/plugins/core.js +20 -8
- package/build/api/vite/plugins/core.js.map +1 -1
- package/build/api/vite/plugins/main.d.ts.map +1 -1
- package/build/api/vite/plugins/main.js +19 -18
- package/build/api/vite/plugins/main.js.map +1 -1
- package/build/cli/index.js +1 -1
- package/build/lib/file-router/linter.js +2 -2
- package/build/lib/file-router/linter.js.map +1 -1
- package/build/lib/vite-plugin-mdx/index.d.ts +2 -0
- package/build/lib/vite-plugin-mdx/index.d.ts.map +1 -0
- package/build/lib/vite-plugin-mdx/index.js +4 -0
- package/build/lib/vite-plugin-mdx/index.js.map +1 -0
- package/build/lib/vite-plugin-mdx/vite-plugin-mdx.d.ts +2 -0
- package/build/lib/vite-plugin-mdx/vite-plugin-mdx.d.ts.map +1 -0
- package/build/lib/vite-plugin-mdx/vite-plugin-mdx.js +74 -0
- package/build/lib/vite-plugin-mdx/vite-plugin-mdx.js.map +1 -0
- package/build/lib/vite-plugins/vite-plugins.d.ts +0 -1
- package/build/lib/vite-plugins/vite-plugins.d.ts.map +1 -1
- package/build/lib/vite-plugins/vite-plugins.js +0 -1
- package/build/lib/vite-plugins/vite-plugins.js.map +1 -1
- package/build/lib/vite-virtual/identified-loader.d.ts.map +1 -1
- package/build/lib/vite-virtual/identified-loader.js +4 -0
- package/build/lib/vite-virtual/identified-loader.js.map +1 -1
- package/build/template/server/render-page.jsx +1 -1
- package/build/template/server/render-page.jsx.map +1 -1
- package/package.json +11 -6
- package/src/api/vite/plugins/core.ts +20 -8
- package/src/api/vite/plugins/main.ts +19 -18
- package/src/cli/index.ts +1 -1
- package/src/lib/file-router/linter.ts +2 -2
- package/src/lib/vite-plugin-mdx/index.ts +2 -0
- package/src/lib/vite-plugin-mdx/vite-plugin-mdx.ts +81 -0
- package/src/lib/vite-plugins/vite-plugins.ts +0 -1
- package/src/lib/vite-virtual/identified-loader.ts +4 -0
- package/src/template/server/render-page.tsx +1 -1
- package/build/lib/vite-plugins/output-logger.d.ts +0 -3
- package/build/lib/vite-plugins/output-logger.d.ts.map +0 -1
- package/build/lib/vite-plugins/output-logger.js +0 -13
- package/build/lib/vite-plugins/output-logger.js.map +0 -1
- package/src/lib/vite-plugins/output-logger.ts +0 -14
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../src/api/vite/plugins/core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAC7D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AA0B9C,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,WAAW,CAAC,WAAW,EAAE,CAAA;CACjC;AAED,eAAO,MAAM,IAAI,GAAI,QAAQ,MAAM,CAAC,MAAM,KAAG,IAAI,CAAC,YAAY,
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../src/api/vite/plugins/core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAC7D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AA0B9C,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,WAAW,CAAC,WAAW,EAAE,CAAA;CACjC;AAED,eAAO,MAAM,IAAI,GAAI,QAAQ,MAAM,CAAC,MAAM,KAAG,IAAI,CAAC,YAAY,EA2P7D,CAAA"}
|
@@ -33,7 +33,10 @@ export const Core = (config) => {
|
|
33
33
|
// @see https://mdxjs.com/docs/getting-started/#vite
|
34
34
|
{
|
35
35
|
enforce: `pre`,
|
36
|
+
// TODO: Use inline vite-plugin-mdx once transform hooks can change module type
|
37
|
+
// @see https://github.com/rolldown/rolldown/issues/4004
|
36
38
|
...mdx({
|
39
|
+
jsxImportSource: `polen/react`,
|
37
40
|
remarkPlugins: [
|
38
41
|
remarkGfm,
|
39
42
|
],
|
@@ -93,11 +96,23 @@ export const Core = (config) => {
|
|
93
96
|
port: 3000,
|
94
97
|
},
|
95
98
|
customLogger: logger,
|
99
|
+
esbuild: false,
|
100
|
+
// oxc: {
|
101
|
+
// jsx: {
|
102
|
+
// runtime: 'automatic',
|
103
|
+
// importSource: 'react',
|
104
|
+
// },
|
105
|
+
// },
|
96
106
|
build: {
|
97
107
|
target: `esnext`,
|
98
108
|
assetsDir: config.paths.project.relative.build.relative.assets,
|
99
109
|
rollupOptions: {
|
100
|
-
treeshake:
|
110
|
+
treeshake: {
|
111
|
+
// Aggressive tree-shaking for smallest bundles
|
112
|
+
moduleSideEffects: false, // Only include code if an export is actually used
|
113
|
+
annotations: true, // Respect @__PURE__ annotations for better dead code elimination
|
114
|
+
unknownGlobalSideEffects: false, // Assume global functions don't have side effects
|
115
|
+
},
|
101
116
|
},
|
102
117
|
minify: !config.advanced.debug,
|
103
118
|
outDir: config.paths.project.absolute.build.root,
|
@@ -227,7 +242,7 @@ export const Core = (config) => {
|
|
227
242
|
*/
|
228
243
|
const buildSidebar = (pages, basePath) => {
|
229
244
|
const navs = [];
|
230
|
-
const sections = Idx.create({
|
245
|
+
const sections = Idx.create({ key: (item) => item.pathExp });
|
231
246
|
// Items
|
232
247
|
for (const page of pages) {
|
233
248
|
const pageRelative = FileRouter.makeRelativeUnsafe(page, basePath);
|
@@ -240,7 +255,7 @@ const buildSidebar = (pages, basePath) => {
|
|
240
255
|
const sectionPath = page.logical.path;
|
241
256
|
const sectionPathExp = FileRouter.pathToExpression(sectionPath);
|
242
257
|
let section;
|
243
|
-
section = sections.
|
258
|
+
section = sections.getAt(sectionPathExp);
|
244
259
|
if (!section) {
|
245
260
|
const sectionTitle = Str.titlizeSlug(FileRouter.pathToExpression(pageRelative.logical.path));
|
246
261
|
section = {
|
@@ -265,7 +280,7 @@ const buildSidebar = (pages, basePath) => {
|
|
265
280
|
const sectionPath = [...basePath, ...sectionRelativePath];
|
266
281
|
const sectionPathExp = FileRouter.pathToExpression(sectionPath);
|
267
282
|
let section;
|
268
|
-
section = sections.
|
283
|
+
section = sections.getAt(sectionPathExp);
|
269
284
|
if (!section) {
|
270
285
|
const sectionTitle = Str.titlizeSlug(FileRouter.pathToExpression(sectionRelativePath));
|
271
286
|
section = {
|
@@ -280,14 +295,11 @@ const buildSidebar = (pages, basePath) => {
|
|
280
295
|
section.navs.push(pageToSidebarNav(page, sectionPath));
|
281
296
|
}
|
282
297
|
}
|
283
|
-
const items = [...navs, ...sections.
|
298
|
+
const items = [...navs, ...sections.toArray()];
|
284
299
|
return {
|
285
300
|
items,
|
286
301
|
};
|
287
302
|
};
|
288
|
-
/**
|
289
|
-
* Helper function to build sidebar items recursively
|
290
|
-
*/
|
291
303
|
const pageToSidebarNav = (page, basePath) => {
|
292
304
|
const pagePathExp = FileRouter.routeToPathExpression(page);
|
293
305
|
const pageRelative = FileRouter.makeRelativeUnsafe(page, basePath);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../../../src/api/vite/plugins/core.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,GAAG,MAAM,gBAAgB,CAAA;AAChC,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAC7D,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,SAAS,MAAM,YAAY,CAAA;AASlC,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAA;A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EAAE,KAAK;oBACf,IAAI,EAAE,EAAE;iBACT,CAAA;gBACD,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;YACvB,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,CAAA;QACxD,CAAC;IACH,CAAC;IAED,MAAM,KAAK,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAA;IAE9C,OAAO;QACL,KAAK;KACN,CAAA;AACH,CAAC,CAAA;AAED,MAAM,gBAAgB,GAAG,CAAC,IAAsB,EAAE,QAAyB,EAAc,EAAE;IACzF,MAAM,WAAW,GAAG,UAAU,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAA;IAC1D,MAAM,YAAY,GAAG,UAAU,CAAC,kBAAkB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;IAClE,MAAM,mBAAmB,GAAG,UAAU,CAAC,qBAAqB,CAAC,YAAY,CAAC,CAAA;IAE1E,OAAO;QACL,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,WAAW;QACpB,KAAK,EAAE,GAAG,CAAC,WAAW,CAAC,mBAAmB,CAAC;KAC5C,CAAA;AACH,CAAC,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../../src/api/vite/plugins/main.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AAS9C,eAAO,MAAM,IAAI,GACf,QAAQ,MAAM,CAAC,MAAM,KACpB,IAAI,CAAC,
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../../src/api/vite/plugins/main.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AAS9C,eAAO,MAAM,IAAI,GACf,QAAQ,MAAM,CAAC,MAAM,KACpB,IAAI,CAAC,YA8BP,CAAA"}
|
@@ -1,27 +1,28 @@
|
|
1
|
-
import ViteReact from '@vitejs/plugin-react';
|
2
|
-
import { Arr, Path } from '@wollybeard/kit'
|
3
|
-
import Inspect from 'vite-plugin-inspect'
|
4
|
-
import Restart from 'vite-plugin-restart'
|
1
|
+
import ViteReact from '@vitejs/plugin-react-oxc';
|
2
|
+
// import { Arr, Path } from '@wollybeard/kit'
|
3
|
+
// import Inspect from 'vite-plugin-inspect'
|
4
|
+
// import Restart from 'vite-plugin-restart'
|
5
5
|
import { Build } from './build.js';
|
6
6
|
import { Core } from './core.js';
|
7
7
|
import { Serve } from './serve.js';
|
8
8
|
export const Main = (config) => {
|
9
9
|
const plugins = [];
|
10
10
|
// Optional Plugins based on config
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
11
|
+
// TODO: Re-enable when compatible with Rolldown
|
12
|
+
// if (config.advanced.explorer) {
|
13
|
+
// const outputDir = Path.join(config.paths.project.rootDir, `.bundle-explorer`)
|
14
|
+
// const plugin = Inspect({
|
15
|
+
// build: true,
|
16
|
+
// outputDir,
|
17
|
+
// })
|
18
|
+
// plugins.push(plugin)
|
19
|
+
// }
|
20
|
+
// if (Arr.isntEmpty(config.watch.also)) {
|
21
|
+
// const plugin = Restart({
|
22
|
+
// restart: config.watch.also,
|
23
|
+
// })
|
24
|
+
// plugins.push(plugin)
|
25
|
+
// }
|
25
26
|
plugins.push(ViteReact(), Core(config), Serve(config), Build(config));
|
26
27
|
return plugins;
|
27
28
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../../../src/api/vite/plugins/main.ts"],"names":[],"mappings":"AAEA,OAAO,SAAS,MAAM,
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../../../src/api/vite/plugins/main.ts"],"names":[],"mappings":"AAEA,OAAO,SAAS,MAAM,0BAA0B,CAAA;AAChD,8CAA8C;AAC9C,4CAA4C;AAC5C,4CAA4C;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC,MAAM,CAAC,MAAM,IAAI,GAAG,CAClB,MAAqB,EACF,EAAE;IACrB,MAAM,OAAO,GAAsB,EAAE,CAAA;IAErC,mCAAmC;IACnC,gDAAgD;IAEhD,kCAAkC;IAClC,kFAAkF;IAClF,6BAA6B;IAC7B,mBAAmB;IACnB,iBAAiB;IACjB,OAAO;IACP,yBAAyB;IACzB,IAAI;IAEJ,0CAA0C;IAC1C,6BAA6B;IAC7B,kCAAkC;IAClC,OAAO;IACP,yBAAyB;IACzB,IAAI;IAEJ,OAAO,CAAC,IAAI,CACV,SAAS,EAAE,EACX,IAAI,CAAC,MAAM,CAAC,EACZ,KAAK,CAAC,MAAM,CAAC,EACb,KAAK,CAAC,MAAM,CAAC,CACd,CAAA;IAED,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA"}
|
package/build/cli/index.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
import { Cli, Path } from '@wollybeard/kit';
|
3
3
|
import manifest from '../../package.json' with { type: 'json' };
|
4
4
|
// Handle --version flag
|
5
|
-
if (process.argv.includes(
|
5
|
+
if (process.argv.includes(`--version`) || process.argv.includes(`-v`)) {
|
6
6
|
console.log(manifest.version);
|
7
7
|
process.exit(0);
|
8
8
|
}
|
@@ -2,7 +2,7 @@ import { Idx, Path } from '@wollybeard/kit';
|
|
2
2
|
import { routeIsFromIndexFile, routeToPathExpression } from './route.js';
|
3
3
|
export const lint = (routes) => {
|
4
4
|
const diagnostics = [];
|
5
|
-
const seen = Idx.create({
|
5
|
+
const seen = Idx.create({ key: routeToPathExpression });
|
6
6
|
// ━ Check for conflict between index and literal.
|
7
7
|
// Note: There is no other way for paths to conflict so we safely assuming the cause is index+literal.
|
8
8
|
for (const route of routes) {
|
@@ -33,7 +33,7 @@ export const lint = (routes) => {
|
|
33
33
|
}
|
34
34
|
return {
|
35
35
|
diagnostics,
|
36
|
-
routes: seen.
|
36
|
+
routes: seen.toArray(),
|
37
37
|
};
|
38
38
|
};
|
39
39
|
//# sourceMappingURL=linter.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"linter.js","sourceRoot":"","sources":["../../../src/lib/file-router/linter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAA8B,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAmBpG,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,MAAe,EAAc,EAAE;IAClD,MAAM,WAAW,GAAiB,EAAE,CAAA;IAEpC,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,
|
1
|
+
{"version":3,"file":"linter.js","sourceRoot":"","sources":["../../../src/lib/file-router/linter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAA8B,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAmBpG,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,MAAe,EAAc,EAAE;IAClD,MAAM,WAAW,GAAiB,EAAE,CAAA;IAEpC,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,qBAAqB,EAAE,CAAC,CAAA;IAEvD,kDAAkD;IAClD,wGAAwG;IACxG,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,SAAS;QACT,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;QAEjC,IAAI,SAAS,EAAE,CAAC;YACd,yBAAyB;YACzB,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;YAC9F,IAAI,SAAS,KAAK,KAAK,EAAE,CAAC;gBACxB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;YACjB,CAAC;YAED,SAAS;YACT,MAAM,UAAU,GAA4B;gBAC1C,gBAAgB;gBAChB,OAAO,EAAE,sEAAsE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,oDAAoD,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,yCAAyC;gBACxP,OAAO,EAAE;oBACP,IAAI,EAAE,OAAO,CAAC,IAAI;iBACnB;gBACD,KAAK,EAAE;oBACL,IAAI,EAAE,KAAK,CAAC,IAAI;iBACjB;aACF,CAAA;YACD,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;YAE5B,SAAQ;QACV,CAAC;QAED,WAAW;QACX,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;IACjB,CAAC;IAED,OAAO;QACL,WAAW;QACX,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE;KACvB,CAAA;AACH,CAAC,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/vite-plugin-mdx/index.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/vite-plugin-mdx/index.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,oEAAoE"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"vite-plugin-mdx.d.ts","sourceRoot":"","sources":["../../../src/lib/vite-plugin-mdx/vite-plugin-mdx.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,74 @@
|
|
1
|
+
// TODO: use this or similar once transform hook can change module type and have result re-processed
|
2
|
+
// @see https://github.com/rolldown/rolldown/issues/4004
|
3
|
+
export {};
|
4
|
+
// import type { CompileOptions } from '@mdx-js/mdx'
|
5
|
+
// import {
|
6
|
+
// createFormatAwareProcessors,
|
7
|
+
// type FormatAwareProcessors,
|
8
|
+
// } from '@mdx-js/mdx/internal-create-format-aware-processors'
|
9
|
+
// import { createFilter, type FilterPattern } from '@rollup/pluginutils'
|
10
|
+
// import type { SourceDescription } from 'rolldown'
|
11
|
+
// import { SourceMapGenerator } from 'source-map'
|
12
|
+
// import { VFile } from 'vfile'
|
13
|
+
// import type { Plugin } from 'vite'
|
14
|
+
// type ApplicableOptions = Omit<CompileOptions, `SourceMapGenerator`>
|
15
|
+
// interface ExtraOptions {
|
16
|
+
// /**
|
17
|
+
// * Picomatch patterns to exclude (optional).
|
18
|
+
// */
|
19
|
+
// exclude?: FilterPattern | null | undefined
|
20
|
+
// /**
|
21
|
+
// * Picomatch patterns to include (optional).
|
22
|
+
// */
|
23
|
+
// include?: FilterPattern | null | undefined
|
24
|
+
// }
|
25
|
+
// export type Options = ApplicableOptions & ExtraOptions
|
26
|
+
// /**
|
27
|
+
// * Plugin to compile MDX w/ rolldown.
|
28
|
+
// */
|
29
|
+
// export function VitePluginMdx(options?: Readonly<Options> | null): Plugin {
|
30
|
+
// const {
|
31
|
+
// exclude,
|
32
|
+
// include = /\.mdx?$/, // Default to .md and .mdx files
|
33
|
+
// ...rest
|
34
|
+
// } = options ?? {}
|
35
|
+
// let formatAwareProcessors: FormatAwareProcessors
|
36
|
+
// const filter = createFilter(include, exclude)
|
37
|
+
// return {
|
38
|
+
// name: `@mdx-js/rolldown`,
|
39
|
+
// enforce: `pre`, // Run before other transforms
|
40
|
+
// config(config, env) {
|
41
|
+
// // Initialize processors with Vite environment info
|
42
|
+
// formatAwareProcessors = createFormatAwareProcessors({
|
43
|
+
// SourceMapGenerator,
|
44
|
+
// development: env.mode === `development`,
|
45
|
+
// ...rest,
|
46
|
+
// })
|
47
|
+
// },
|
48
|
+
// async transform(value: string, id: string): Promise<SourceDescription | undefined> {
|
49
|
+
// // Ensure processors are initialized
|
50
|
+
// // if (!formatAwareProcessors) {
|
51
|
+
// // formatAwareProcessors = createFormatAwareProcessors({
|
52
|
+
// // SourceMapGenerator,
|
53
|
+
// // ...rest,
|
54
|
+
// // })
|
55
|
+
// // }
|
56
|
+
// const file = new VFile({ path: id, value })
|
57
|
+
// if (
|
58
|
+
// file.extname
|
59
|
+
// && filter(file.path)
|
60
|
+
// && formatAwareProcessors.extnames.includes(file.extname)
|
61
|
+
// ) {
|
62
|
+
// const compiled = await formatAwareProcessors.process(file)
|
63
|
+
// const code = String(compiled.value)
|
64
|
+
// const result: SourceDescription = {
|
65
|
+
// code,
|
66
|
+
// // When MDX compiles to JS (not JSX), we don't need to set moduleType
|
67
|
+
// map: compiled.map,
|
68
|
+
// }
|
69
|
+
// return result
|
70
|
+
// }
|
71
|
+
// },
|
72
|
+
// }
|
73
|
+
// }
|
74
|
+
//# sourceMappingURL=vite-plugin-mdx.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"vite-plugin-mdx.js","sourceRoot":"","sources":["../../../src/lib/vite-plugin-mdx/vite-plugin-mdx.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,yDAAyD;;AAEzD,oDAAoD;AACpD,WAAW;AACX,iCAAiC;AACjC,gCAAgC;AAChC,+DAA+D;AAC/D,yEAAyE;AACzE,oDAAoD;AACpD,kDAAkD;AAClD,gCAAgC;AAChC,qCAAqC;AAErC,sEAAsE;AAEtE,2BAA2B;AAC3B,QAAQ;AACR,iDAAiD;AACjD,QAAQ;AACR,+CAA+C;AAC/C,QAAQ;AACR,iDAAiD;AACjD,QAAQ;AACR,+CAA+C;AAC/C,IAAI;AAEJ,yDAAyD;AAEzD,MAAM;AACN,wCAAwC;AACxC,MAAM;AACN,8EAA8E;AAC9E,YAAY;AACZ,eAAe;AACf,4DAA4D;AAC5D,cAAc;AACd,sBAAsB;AACtB,qDAAqD;AACrD,kDAAkD;AAElD,aAAa;AACb,gCAAgC;AAChC,qDAAqD;AACrD,4BAA4B;AAC5B,4DAA4D;AAC5D,8DAA8D;AAC9D,8BAA8B;AAC9B,mDAAmD;AACnD,mBAAmB;AACnB,WAAW;AACX,SAAS;AACT,2FAA2F;AAC3F,6CAA6C;AAC7C,yCAAyC;AACzC,mEAAmE;AACnE,mCAAmC;AACnC,wBAAwB;AACxB,gBAAgB;AAChB,aAAa;AAEb,oDAAoD;AAEpD,aAAa;AACb,uBAAuB;AACvB,+BAA+B;AAC/B,mEAAmE;AACnE,YAAY;AACZ,qEAAqE;AACrE,8CAA8C;AAC9C,8CAA8C;AAC9C,kBAAkB;AAClB,kFAAkF;AAClF,+BAA+B;AAC/B,YAAY;AAEZ,wBAAwB;AACxB,UAAU;AACV,SAAS;AACT,MAAM;AACN,IAAI"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"vite-plugins.d.ts","sourceRoot":"","sources":["../../../src/lib/vite-plugins/vite-plugins.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA
|
1
|
+
{"version":3,"file":"vite-plugins.d.ts","sourceRoot":"","sources":["../../../src/lib/vite-plugins/vite-plugins.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"vite-plugins.js","sourceRoot":"","sources":["../../../src/lib/vite-plugins/vite-plugins.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA
|
1
|
+
{"version":3,"file":"vite-plugins.js","sourceRoot":"","sources":["../../../src/lib/vite-plugins/vite-plugins.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"identified-loader.d.ts","sourceRoot":"","sources":["../../../src/lib/vite-virtual/identified-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AAG9C,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,UAAU,CAAA;IACtB,MAAM,EAAE,IAAI,CAAC,cAAc,CAAA;CAC5B;AAED,eAAO,MAAM,UAAU,GACrB,kBAAkB,gBAAgB,KACjC,
|
1
|
+
{"version":3,"file":"identified-loader.d.ts","sourceRoot":"","sources":["../../../src/lib/vite-virtual/identified-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AAG9C,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,UAAU,CAAA;IACtB,MAAM,EAAE,IAAI,CAAC,cAAc,CAAA;CAC5B;AAED,eAAO,MAAM,UAAU,GACrB,kBAAkB,gBAAgB,KACjC,QAeF,CAAA;AAED,eAAO,MAAM,eAAe,GAAI,kBAAkB,gBAAgB,KAAG,aAOpE,CAAA;AAED,eAAO,MAAM,OAAO,GAClB,GAAG,mBAAmB,gBAAgB,EAAE,KACvC;IACD,SAAS,EAAE,IAAI,CAAC,mBAAmB,CAAA;IACnC,IAAI,EAAE,IAAI,CAAC,cAAc,CAAA;CAc1B,CAAA;AAED,eAAO,MAAM,QAAQ,GAAI,GAAG,mBAAmB,gBAAgB,EAAE,KAAG,IAAI,CAAC,MAKxE,CAAA"}
|
@@ -7,6 +7,10 @@ export const toHookLoad = (identifiedLoader) => {
|
|
7
7
|
debug(`will load`, { identifier: identifiedLoader.identifier });
|
8
8
|
const result = await identifiedLoader.loader(...args);
|
9
9
|
debug(`did load`, { identifier: identifiedLoader.identifier, result });
|
10
|
+
// Add moduleType for Rolldown compatibility
|
11
|
+
if (result && typeof result === `string`) {
|
12
|
+
return { code: result, moduleType: `js` };
|
13
|
+
}
|
10
14
|
return result;
|
11
15
|
}
|
12
16
|
return undefined;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"identified-loader.js","sourceRoot":"","sources":["../../../src/lib/vite-virtual/identified-loader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAS5D,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,gBAAkC,EACxB,EAAE;IACZ,OAAO,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE;QACvB,uDAAuD;QACvD,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,gBAAgB,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;YACrD,KAAK,CAAC,WAAW,EAAE,EAAE,UAAU,EAAE,gBAAgB,CAAC,UAAU,EAAE,CAAC,CAAA;YAC/D,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAA;YACrD,KAAK,CAAC,UAAU,EAAE,EAAE,UAAU,EAAE,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,CAAC,CAAA;YACtE,OAAO,MAAM,CAAA;QACf,CAAC;QACD,OAAO,SAAS,CAAA;IAClB,CAAC,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,gBAAkC,EAAiB,EAAE;IACnF,OAAO,EAAE,CAAC,EAAE;QACV,IAAI,EAAE,KAAK,gBAAgB,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC;YAC1C,OAAO,gBAAgB,CAAC,UAAU,CAAC,QAAQ,CAAA;QAC7C,CAAC;QACD,OAAO,SAAS,CAAA;IAClB,CAAC,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,CACrB,GAAG,iBAAqC,EAIxC,EAAE;IACF,MAAM,SAAS,GAAG,cAAc,CAAC,YAAY,CAC3C,iBAAiB,CAAC,GAAG,CAAC,eAAe,CAAC,CACvC,CAAA;IAED,MAAM,IAAI,GAAG,cAAc,CAAC,YAAY,CACtC,iBAAiB,CAAC,GAAG,CAAC,UAAU,CAAC,CAClC,CAAA;IAED,OAAO;QACL,SAAS;QACT,IAAI;KACL,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAG,iBAAqC,EAAe,EAAE;IAChF,OAAO;QACL,IAAI,EAAE,cAAc;QACpB,GAAG,OAAO,CAAC,GAAG,iBAAiB,CAAC;KACjC,CAAA;AACH,CAAC,CAAA"}
|
1
|
+
{"version":3,"file":"identified-loader.js","sourceRoot":"","sources":["../../../src/lib/vite-virtual/identified-loader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAS5D,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,gBAAkC,EACxB,EAAE;IACZ,OAAO,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE;QACvB,uDAAuD;QACvD,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,gBAAgB,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;YACrD,KAAK,CAAC,WAAW,EAAE,EAAE,UAAU,EAAE,gBAAgB,CAAC,UAAU,EAAE,CAAC,CAAA;YAC/D,M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 @@ const getStatusCode = (context) => {
|
|
40
40
|
return context.statusCode;
|
41
41
|
}
|
42
42
|
// Then check for custom status in route handle
|
43
|
-
const handle = Arr.
|
43
|
+
const handle = Arr.getLast(context.matches)?.route.handle;
|
44
44
|
if (handle?.statusCode) {
|
45
45
|
return handle.statusCode;
|
46
46
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"render-page.jsx","sourceRoot":"","sources":["../../../src/template/server/render-page.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAClC,OAAO,KAAK,cAAc,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AACvE,OAAO,uBAAuB,MAAM,oCAAoC,CAAA;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,oBAAsD,EACtD,EAAE;IACF,MAAM,MAAM,GAAG,kBAAkB,CAAC,IAAI,CAAC,UAAU,EAAE,oBAAoB,CAAC,CAAA;IAExE,IAAI,IAAI,GAAG,EAAE,CAAA;IAEb,IAAI,CAAC;QACH,IAAI,GAAG,cAAc,CAAC,cAAc,CAClC,CAAC,UAAU,CACT;QAAA,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,oBAAoB,CAAC,EACtE;MAAA,EAAE,UAAU,CAAC,CACd,CAAA;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,uCAAuC,EAAE,EAAE,KAAK,EAAE,CAAC,CAAA;IACrE,CAAC;IAED,IAAI,YAAY,EAAE,CAAC;QACjB,IAAI,GAAG,sBAAsB,CAAC,I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/C,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,MAAgD,CAAA;IACnG,IAAI,MAAM,EAAE,UAAU,EAAE,CAAC;QACvB,OAAO,MAAM,CAAC,UAAU,CAAA;IAC1B,CAAC;IAED,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA;AAED,MAAM,eAAe,GAAG,CACtB,OAAyC,EAChC,EAAE;IACX,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;IACxD,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,OAAO,EAAE,CAAA;IAE/B,MAAM,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;IAC1D,MAAM,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;IAC1D,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,aAAa,CAAC,CAAA;IAC1C,IAAI,aAAa,EAAE,CAAC;QAClB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,aAAa,CAAC,OAAO,EAAE,EAAE,CAAC;YACnD,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;QAC5B,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "polen",
|
3
|
-
"version": "0.8.0-next.
|
3
|
+
"version": "0.8.0-next.9",
|
4
4
|
"type": "module",
|
5
5
|
"description": "A framework for delightful GraphQL developer portals",
|
6
6
|
"author": {
|
@@ -53,15 +53,17 @@
|
|
53
53
|
"@graphql-inspector/core": "^6.2.1",
|
54
54
|
"@graphql-tools/load": "^8.1.0",
|
55
55
|
"@hono/node-server": "^1.14.1",
|
56
|
-
"@
|
56
|
+
"@mdx-js/mdx": "^3.1.0",
|
57
57
|
"@mdx-js/rollup": "^3.1.0",
|
58
58
|
"@radix-ui/react-icons": "^1.3.2",
|
59
59
|
"@radix-ui/themes": "^3.2.1",
|
60
60
|
"@rolldown/pluginutils": "1.0.0-beta.9",
|
61
|
+
"@rollup/pluginutils": "^5.1.4",
|
61
62
|
"@swc/core": "^1.11.29",
|
62
63
|
"@types/jsesc": "^3.0.3",
|
63
|
-
"@vitejs/plugin-react": "^4.
|
64
|
-
"@
|
64
|
+
"@vitejs/plugin-react": "^4.5.1",
|
65
|
+
"@vitejs/plugin-react-oxc": "^0.2.1",
|
66
|
+
"@wollybeard/kit": "^0.34.0",
|
65
67
|
"@wollybeard/projector": "^0.1.1",
|
66
68
|
"ansis": "^4.0.0",
|
67
69
|
"consola": "^3.4.2",
|
@@ -80,13 +82,16 @@
|
|
80
82
|
"remark-gfm": "^4.0.0",
|
81
83
|
"remark-html": "^16.0.1",
|
82
84
|
"resolve.imports": "^2.0.3",
|
85
|
+
"rolldown": "1.0.0-beta.11",
|
86
|
+
"source-map": "^0.7.4",
|
83
87
|
"superjson": "^2.2.2",
|
84
88
|
"tinyglobby": "^0.2.13",
|
89
|
+
"tsx": "^4.19.4",
|
85
90
|
"typescript": "^5.8.3",
|
86
|
-
"
|
91
|
+
"vfile": "^6.0.3",
|
92
|
+
"vite": "npm:rolldown-vite@~6.3.17",
|
87
93
|
"vite-plugin-inspect": "^11.0.1",
|
88
94
|
"vite-plugin-restart": "^0.4.2",
|
89
|
-
"tsx": "^4.19.4",
|
90
95
|
"zx": "8.5.4"
|
91
96
|
},
|
92
97
|
"devDependencies": {
|
@@ -53,7 +53,10 @@ export const Core = (config: Config.Config): Vite.PluginOption[] => {
|
|
53
53
|
// @see https://mdxjs.com/docs/getting-started/#vite
|
54
54
|
{
|
55
55
|
enforce: `pre`,
|
56
|
+
// TODO: Use inline vite-plugin-mdx once transform hooks can change module type
|
57
|
+
// @see https://github.com/rolldown/rolldown/issues/4004
|
56
58
|
...mdx({
|
59
|
+
jsxImportSource: `polen/react`,
|
57
60
|
remarkPlugins: [
|
58
61
|
remarkGfm,
|
59
62
|
],
|
@@ -114,11 +117,23 @@ export const Core = (config: Config.Config): Vite.PluginOption[] => {
|
|
114
117
|
port: 3000,
|
115
118
|
},
|
116
119
|
customLogger: logger,
|
120
|
+
esbuild: false,
|
121
|
+
// oxc: {
|
122
|
+
// jsx: {
|
123
|
+
// runtime: 'automatic',
|
124
|
+
// importSource: 'react',
|
125
|
+
// },
|
126
|
+
// },
|
117
127
|
build: {
|
118
128
|
target: `esnext`,
|
119
129
|
assetsDir: config.paths.project.relative.build.relative.assets,
|
120
130
|
rollupOptions: {
|
121
|
-
treeshake:
|
131
|
+
treeshake: {
|
132
|
+
// Aggressive tree-shaking for smallest bundles
|
133
|
+
moduleSideEffects: false, // Only include code if an export is actually used
|
134
|
+
annotations: true, // Respect @__PURE__ annotations for better dead code elimination
|
135
|
+
unknownGlobalSideEffects: false, // Assume global functions don't have side effects
|
136
|
+
},
|
122
137
|
},
|
123
138
|
minify: !config.advanced.debug,
|
124
139
|
outDir: config.paths.project.absolute.build.root,
|
@@ -273,7 +288,7 @@ export const Core = (config: Config.Config): Vite.PluginOption[] => {
|
|
273
288
|
*/
|
274
289
|
const buildSidebar = (pages: FileRouter.Route[], basePath: FileRouter.Path): Sidebar => {
|
275
290
|
const navs: SidebarNav[] = []
|
276
|
-
const sections = Idx.create<SidebarSection, string>({
|
291
|
+
const sections = Idx.create<SidebarSection, string>({ key: (item) => item.pathExp })
|
277
292
|
|
278
293
|
// Items
|
279
294
|
for (const page of pages) {
|
@@ -290,7 +305,7 @@ const buildSidebar = (pages: FileRouter.Route[], basePath: FileRouter.Path): Sid
|
|
290
305
|
const sectionPathExp = FileRouter.pathToExpression(sectionPath)
|
291
306
|
|
292
307
|
let section: SidebarSection | undefined
|
293
|
-
section = sections.
|
308
|
+
section = sections.getAt(sectionPathExp)
|
294
309
|
|
295
310
|
if (!section) {
|
296
311
|
const sectionTitle = Str.titlizeSlug(FileRouter.pathToExpression(pageRelative.logical.path))
|
@@ -320,7 +335,7 @@ const buildSidebar = (pages: FileRouter.Route[], basePath: FileRouter.Path): Sid
|
|
320
335
|
const sectionPathExp = FileRouter.pathToExpression(sectionPath)
|
321
336
|
|
322
337
|
let section: SidebarSection | undefined
|
323
|
-
section = sections.
|
338
|
+
section = sections.getAt(sectionPathExp)
|
324
339
|
|
325
340
|
if (!section) {
|
326
341
|
const sectionTitle = Str.titlizeSlug(FileRouter.pathToExpression(sectionRelativePath))
|
@@ -337,16 +352,13 @@ const buildSidebar = (pages: FileRouter.Route[], basePath: FileRouter.Path): Sid
|
|
337
352
|
}
|
338
353
|
}
|
339
354
|
|
340
|
-
const items = [...navs, ...sections.
|
355
|
+
const items = [...navs, ...sections.toArray()]
|
341
356
|
|
342
357
|
return {
|
343
358
|
items,
|
344
359
|
}
|
345
360
|
}
|
346
361
|
|
347
|
-
/**
|
348
|
-
* Helper function to build sidebar items recursively
|
349
|
-
*/
|
350
362
|
const pageToSidebarNav = (page: FileRouter.Route, basePath: FileRouter.Path): SidebarNav => {
|
351
363
|
const pagePathExp = FileRouter.routeToPathExpression(page)
|
352
364
|
const pageRelative = FileRouter.makeRelativeUnsafe(page, basePath)
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import type { Config } from '#api/config/index.js'
|
2
2
|
import type { Vite } from '#dep/vite/index.js'
|
3
|
-
import ViteReact from '@vitejs/plugin-react'
|
4
|
-
import { Arr, Path } from '@wollybeard/kit'
|
5
|
-
import Inspect from 'vite-plugin-inspect'
|
6
|
-
import Restart from 'vite-plugin-restart'
|
3
|
+
import ViteReact from '@vitejs/plugin-react-oxc'
|
4
|
+
// import { Arr, Path } from '@wollybeard/kit'
|
5
|
+
// import Inspect from 'vite-plugin-inspect'
|
6
|
+
// import Restart from 'vite-plugin-restart'
|
7
7
|
import { Build } from './build.js'
|
8
8
|
import { Core } from './core.js'
|
9
9
|
import { Serve } from './serve.js'
|
@@ -14,22 +14,23 @@ export const Main = (
|
|
14
14
|
const plugins: Vite.PluginOption = []
|
15
15
|
|
16
16
|
// Optional Plugins based on config
|
17
|
+
// TODO: Re-enable when compatible with Rolldown
|
17
18
|
|
18
|
-
if (config.advanced.explorer) {
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
}
|
19
|
+
// if (config.advanced.explorer) {
|
20
|
+
// const outputDir = Path.join(config.paths.project.rootDir, `.bundle-explorer`)
|
21
|
+
// const plugin = Inspect({
|
22
|
+
// build: true,
|
23
|
+
// outputDir,
|
24
|
+
// })
|
25
|
+
// plugins.push(plugin)
|
26
|
+
// }
|
26
27
|
|
27
|
-
if (Arr.isntEmpty(config.watch.also)) {
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
}
|
28
|
+
// if (Arr.isntEmpty(config.watch.also)) {
|
29
|
+
// const plugin = Restart({
|
30
|
+
// restart: config.watch.also,
|
31
|
+
// })
|
32
|
+
// plugins.push(plugin)
|
33
|
+
// }
|
33
34
|
|
34
35
|
plugins.push(
|
35
36
|
ViteReact(),
|
package/src/cli/index.ts
CHANGED
@@ -4,7 +4,7 @@ import { Cli, Path } from '@wollybeard/kit'
|
|
4
4
|
import manifest from '../../package.json' with { type: 'json' }
|
5
5
|
|
6
6
|
// Handle --version flag
|
7
|
-
if (process.argv.includes(
|
7
|
+
if (process.argv.includes(`--version`) || process.argv.includes(`-v`)) {
|
8
8
|
console.log(manifest.version)
|
9
9
|
process.exit(0)
|
10
10
|
}
|
@@ -21,7 +21,7 @@ export interface LintResult {
|
|
21
21
|
export const lint = (routes: Route[]): LintResult => {
|
22
22
|
const diagnostics: Diagnostic[] = []
|
23
23
|
|
24
|
-
const seen = Idx.create({
|
24
|
+
const seen = Idx.create({ key: routeToPathExpression })
|
25
25
|
|
26
26
|
// ━ Check for conflict between index and literal.
|
27
27
|
// Note: There is no other way for paths to conflict so we safely assuming the cause is index+literal.
|
@@ -58,6 +58,6 @@ export const lint = (routes: Route[]): LintResult => {
|
|
58
58
|
|
59
59
|
return {
|
60
60
|
diagnostics,
|
61
|
-
routes: seen.
|
61
|
+
routes: seen.toArray(),
|
62
62
|
}
|
63
63
|
}
|
@@ -0,0 +1,81 @@
|
|
1
|
+
// TODO: use this or similar once transform hook can change module type and have result re-processed
|
2
|
+
// @see https://github.com/rolldown/rolldown/issues/4004
|
3
|
+
|
4
|
+
// import type { CompileOptions } from '@mdx-js/mdx'
|
5
|
+
// import {
|
6
|
+
// createFormatAwareProcessors,
|
7
|
+
// type FormatAwareProcessors,
|
8
|
+
// } from '@mdx-js/mdx/internal-create-format-aware-processors'
|
9
|
+
// import { createFilter, type FilterPattern } from '@rollup/pluginutils'
|
10
|
+
// import type { SourceDescription } from 'rolldown'
|
11
|
+
// import { SourceMapGenerator } from 'source-map'
|
12
|
+
// import { VFile } from 'vfile'
|
13
|
+
// import type { Plugin } from 'vite'
|
14
|
+
|
15
|
+
// type ApplicableOptions = Omit<CompileOptions, `SourceMapGenerator`>
|
16
|
+
|
17
|
+
// interface ExtraOptions {
|
18
|
+
// /**
|
19
|
+
// * Picomatch patterns to exclude (optional).
|
20
|
+
// */
|
21
|
+
// exclude?: FilterPattern | null | undefined
|
22
|
+
// /**
|
23
|
+
// * Picomatch patterns to include (optional).
|
24
|
+
// */
|
25
|
+
// include?: FilterPattern | null | undefined
|
26
|
+
// }
|
27
|
+
|
28
|
+
// export type Options = ApplicableOptions & ExtraOptions
|
29
|
+
|
30
|
+
// /**
|
31
|
+
// * Plugin to compile MDX w/ rolldown.
|
32
|
+
// */
|
33
|
+
// export function VitePluginMdx(options?: Readonly<Options> | null): Plugin {
|
34
|
+
// const {
|
35
|
+
// exclude,
|
36
|
+
// include = /\.mdx?$/, // Default to .md and .mdx files
|
37
|
+
// ...rest
|
38
|
+
// } = options ?? {}
|
39
|
+
// let formatAwareProcessors: FormatAwareProcessors
|
40
|
+
// const filter = createFilter(include, exclude)
|
41
|
+
|
42
|
+
// return {
|
43
|
+
// name: `@mdx-js/rolldown`,
|
44
|
+
// enforce: `pre`, // Run before other transforms
|
45
|
+
// config(config, env) {
|
46
|
+
// // Initialize processors with Vite environment info
|
47
|
+
// formatAwareProcessors = createFormatAwareProcessors({
|
48
|
+
// SourceMapGenerator,
|
49
|
+
// development: env.mode === `development`,
|
50
|
+
// ...rest,
|
51
|
+
// })
|
52
|
+
// },
|
53
|
+
// async transform(value: string, id: string): Promise<SourceDescription | undefined> {
|
54
|
+
// // Ensure processors are initialized
|
55
|
+
// // if (!formatAwareProcessors) {
|
56
|
+
// // formatAwareProcessors = createFormatAwareProcessors({
|
57
|
+
// // SourceMapGenerator,
|
58
|
+
// // ...rest,
|
59
|
+
// // })
|
60
|
+
// // }
|
61
|
+
|
62
|
+
// const file = new VFile({ path: id, value })
|
63
|
+
|
64
|
+
// if (
|
65
|
+
// file.extname
|
66
|
+
// && filter(file.path)
|
67
|
+
// && formatAwareProcessors.extnames.includes(file.extname)
|
68
|
+
// ) {
|
69
|
+
// const compiled = await formatAwareProcessors.process(file)
|
70
|
+
// const code = String(compiled.value)
|
71
|
+
// const result: SourceDescription = {
|
72
|
+
// code,
|
73
|
+
// // When MDX compiles to JS (not JSX), we don't need to set moduleType
|
74
|
+
// map: compiled.map,
|
75
|
+
// }
|
76
|
+
|
77
|
+
// return result
|
78
|
+
// }
|
79
|
+
// },
|
80
|
+
// }
|
81
|
+
// }
|
@@ -18,6 +18,10 @@ export const toHookLoad = (
|
|
18
18
|
debug(`will load`, { identifier: identifiedLoader.identifier })
|
19
19
|
const result = await identifiedLoader.loader(...args)
|
20
20
|
debug(`did load`, { identifier: identifiedLoader.identifier, result })
|
21
|
+
// Add moduleType for Rolldown compatibility
|
22
|
+
if (result && typeof result === `string`) {
|
23
|
+
return { code: result, moduleType: `js` }
|
24
|
+
}
|
21
25
|
return result
|
22
26
|
}
|
23
27
|
return undefined
|
@@ -57,7 +57,7 @@ const getStatusCode = (
|
|
57
57
|
}
|
58
58
|
|
59
59
|
// Then check for custom status in route handle
|
60
|
-
const handle = Arr.
|
60
|
+
const handle = Arr.getLast(context.matches)?.route.handle as undefined | ReactRouterAid.RouteHandle
|
61
61
|
if (handle?.statusCode) {
|
62
62
|
return handle.statusCode
|
63
63
|
}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"output-logger.d.ts","sourceRoot":"","sources":["../../../src/lib/vite-plugins/output-logger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAElC,eAAO,MAAM,YAAY,EAAE,MAW1B,CAAA"}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
export const OutputLogger = {
|
2
|
-
name: `output-logger`,
|
3
|
-
outputOptions(...args) {
|
4
|
-
console.log(`outputOptions`, args);
|
5
|
-
},
|
6
|
-
renderStart(...args) {
|
7
|
-
console.log(`renderStart`, args);
|
8
|
-
},
|
9
|
-
renderDynamicImport(...args) {
|
10
|
-
console.log(`renderDynamicImport`, args);
|
11
|
-
},
|
12
|
-
};
|
13
|
-
//# sourceMappingURL=output-logger.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"output-logger.js","sourceRoot":"","sources":["../../../src/lib/vite-plugins/output-logger.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAW;IAClC,IAAI,EAAE,eAAe;IACrB,aAAa,CAAC,GAAG,IAAI;QACnB,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,IAAI,CAAC,CAAA;IACpC,CAAC;IACD,WAAW,CAAC,GAAG,IAAI;QACjB,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,IAAI,CAAC,CAAA;IAClC,CAAC;IACD,mBAAmB,CAAC,GAAG,IAAI;QACzB,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,IAAI,CAAC,CAAA;IAC1C,CAAC;CACF,CAAA"}
|
@@ -1,14 +0,0 @@
|
|
1
|
-
import type { Plugin } from 'vite'
|
2
|
-
|
3
|
-
export const OutputLogger: Plugin = {
|
4
|
-
name: `output-logger`,
|
5
|
-
outputOptions(...args) {
|
6
|
-
console.log(`outputOptions`, args)
|
7
|
-
},
|
8
|
-
renderStart(...args) {
|
9
|
-
console.log(`renderStart`, args)
|
10
|
-
},
|
11
|
-
renderDynamicImport(...args) {
|
12
|
-
console.log(`renderDynamicImport`, args)
|
13
|
-
},
|
14
|
-
}
|