@byline/cli 6.13.0 → 6.13.2
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/LICENSE +5 -5
- package/dist/lib/template-docs-hooks.test.node.d.ts +2 -2
- package/dist/lib/template-docs-hooks.test.node.js +2 -2
- package/dist/lib/template-hook-boundary.test.node.js +2 -1
- package/dist/lib/template-hook-boundary.test.node.js.map +1 -1
- package/dist/lib/template-pages-preview.test.node.d.ts +2 -2
- package/dist/lib/template-pages-preview.test.node.js +2 -2
- package/dist/lib/template-path.d.ts.map +1 -1
- package/dist/lib/template-path.js +20 -1
- package/dist/lib/template-path.js.map +1 -1
- package/dist/lib/template-path.test.d.ts +9 -0
- package/dist/lib/template-path.test.d.ts.map +1 -0
- package/dist/lib/template-path.test.js +43 -0
- package/dist/lib/template-path.test.js.map +1 -0
- package/dist/manifest/deps.js +2 -2
- package/dist/manifest/deps.js.map +1 -1
- package/dist/phases/wire/index.d.ts.map +1 -1
- package/dist/phases/wire/index.js +17 -7
- package/dist/phases/wire/index.js.map +1 -1
- package/dist/phases/wire/start-ts.d.ts +2 -2
- package/dist/phases/wire/start-ts.js +2 -2
- package/dist/phases/wire/start-ts.test.d.ts +2 -2
- package/dist/phases/wire/start-ts.test.js +2 -2
- package/dist/phases/wire/vite-config-apply-error.test.d.ts +2 -0
- package/dist/phases/wire/vite-config-apply-error.test.d.ts.map +1 -0
- package/dist/phases/wire/vite-config-apply-error.test.js +47 -0
- package/dist/phases/wire/vite-config-apply-error.test.js.map +1 -0
- package/dist/phases/wire/vite-config-known-values.d.ts +28 -0
- package/dist/phases/wire/vite-config-known-values.d.ts.map +1 -0
- package/dist/phases/wire/vite-config-known-values.js +58 -0
- package/dist/phases/wire/vite-config-known-values.js.map +1 -0
- package/dist/phases/wire/vite-config-merge.d.ts +17 -0
- package/dist/phases/wire/vite-config-merge.d.ts.map +1 -1
- package/dist/phases/wire/vite-config-merge.js +169 -56
- package/dist/phases/wire/vite-config-merge.js.map +1 -1
- package/dist/phases/wire/vite-config-merge.test.js +149 -3
- package/dist/phases/wire/vite-config-merge.test.js.map +1 -1
- package/dist/phases/wire/vite-config.d.ts.map +1 -1
- package/dist/phases/wire/vite-config.js +64 -7
- package/dist/phases/wire/vite-config.js.map +1 -1
- package/dist/phases/wire/vite-config.test.js +110 -1
- package/dist/phases/wire/vite-config.test.js.map +1 -1
- package/dist/templates/byline/admin.config.ts +2 -2
- package/dist/templates/byline/collections/index.ts +2 -2
- package/dist/templates/byline/i18n.ts +2 -2
- package/dist/templates/byline/load-env.ts +2 -2
- package/dist/templates/byline/locales.ts +2 -2
- package/dist/templates/byline/public.ts +2 -2
- package/dist/templates/byline/routes.ts +2 -2
- package/dist/templates/byline/seed-admin.ts +2 -2
- package/dist/templates/byline/seeds/admin.ts +2 -2
- package/dist/templates/byline-examples/admin.config.ts +2 -2
- package/dist/templates/byline-examples/blocks/photo-block.ts +2 -2
- package/dist/templates/byline-examples/blocks/richtext-block.ts +2 -2
- package/dist/templates/byline-examples/collections/docs/admin.tsx +2 -2
- package/dist/templates/byline-examples/collections/docs/hooks.ts +2 -2
- package/dist/templates/byline-examples/collections/docs/index.ts +2 -2
- package/dist/templates/byline-examples/collections/docs/schema.ts +2 -2
- package/dist/templates/byline-examples/collections/index.ts +2 -2
- package/dist/templates/byline-examples/collections/media/admin.tsx +2 -2
- package/dist/templates/byline-examples/collections/media/components/media-list-view.tsx +2 -2
- package/dist/templates/byline-examples/collections/media/components/media-thumbnail.tsx +2 -2
- package/dist/templates/byline-examples/collections/media/index.ts +2 -2
- package/dist/templates/byline-examples/collections/media/schema.ts +2 -2
- package/dist/templates/byline-examples/collections/news/admin.tsx +2 -2
- package/dist/templates/byline-examples/collections/news/index.ts +2 -2
- package/dist/templates/byline-examples/collections/news/schema.ts +2 -2
- package/dist/templates/byline-examples/collections/news-categories/admin.tsx +2 -2
- package/dist/templates/byline-examples/collections/news-categories/index.ts +2 -2
- package/dist/templates/byline-examples/collections/news-categories/schema.ts +2 -2
- package/dist/templates/byline-examples/collections/pages/admin.tsx +2 -2
- package/dist/templates/byline-examples/collections/pages/index.ts +2 -2
- package/dist/templates/byline-examples/collections/pages/schema.ts +2 -2
- package/dist/templates/byline-examples/components/summary-length.tsx +2 -2
- package/dist/templates/byline-examples/fields/ai-text.ts +2 -2
- package/dist/templates/byline-examples/fields/ai-textarea.ts +2 -2
- package/dist/templates/byline-examples/fields/ai-widgets/ai-field-label.tsx +2 -2
- package/dist/templates/byline-examples/fields/ai-widgets/ai-field-panel.tsx +2 -2
- package/dist/templates/byline-examples/fields/ai-widgets/ai-panel-store.ts +2 -2
- package/dist/templates/byline-examples/fields/lexical-richtext-ai.tsx +2 -2
- package/dist/templates/byline-examples/fields/lexical-richtext-compact-admin.tsx +2 -2
- package/dist/templates/byline-examples/fields/lexical-richtext-compact.ts +2 -2
- package/dist/templates/byline-examples/fields/published-on-field.ts +2 -2
- package/dist/templates/byline-examples/i18n.ts +2 -2
- package/dist/templates/byline-examples/locales.ts +2 -2
- package/dist/templates/byline-examples/public.ts +2 -2
- package/dist/templates/byline-examples/routes.ts +2 -2
- package/dist/templates/byline-examples/scripts/import-docs.ts +2 -2
- package/dist/templates/byline-examples/scripts/lib/frontmatter.ts +2 -2
- package/dist/templates/byline-examples/scripts/lib/mdast-to-lexical.test.node.ts +2 -2
- package/dist/templates/byline-examples/scripts/lib/mdast-to-lexical.ts +2 -2
- package/dist/templates/byline-examples/scripts/lib/parse-markdown.ts +2 -2
- package/dist/templates/byline-examples/scripts/lib/rewrite-doc-links.ts +2 -2
- package/dist/templates/byline-examples/scripts/lib/strip-leading-h1.test.node.ts +2 -2
- package/dist/templates/byline-examples/scripts/lib/strip-leading-h1.ts +2 -2
- package/dist/templates/byline-examples/scripts/regenerate-media.ts +2 -2
- package/dist/templates/byline-examples/seed-docs.ts +2 -2
- package/dist/templates/byline-examples/seeds/docs.ts +2 -2
- package/dist/templates/byline-examples/seeds/news-categories.ts +2 -2
- package/dist/templates/byline-examples/seeds/site-settings.ts +2 -2
- package/dist/templates/byline-examples/singletons/site-settings/admin.ts +2 -2
- package/dist/templates/byline-examples/singletons/site-settings/index.ts +2 -2
- package/dist/templates/byline-examples/singletons/site-settings/schema.ts +2 -2
- package/dist/templates/dialects/mysql/byline/server.config.ts +2 -2
- package/dist/templates/dialects/mysql/byline-examples/server.config.ts +2 -2
- package/dist/templates/dialects/postgres/byline/server.config.ts +2 -2
- package/dist/templates/dialects/postgres/byline-examples/scripts/backfill-version-locales.ts +2 -2
- package/dist/templates/dialects/postgres/byline-examples/scripts/re-anchor.ts +2 -2
- package/dist/templates/dialects/postgres/byline-examples/server.config.ts +2 -2
- package/dist/templates/host/vite.config.ts +7 -1
- package/dist/templates/routes/_byline/admin/account/index.tsx +2 -2
- package/dist/templates/routes/_byline/admin/activity/index.tsx +2 -2
- package/dist/templates/routes/_byline/admin/collections/$collection/$id/api.tsx +2 -2
- package/dist/templates/routes/_byline/admin/collections/$collection/$id/history.tsx +2 -2
- package/dist/templates/routes/_byline/admin/collections/$collection/$id/index.tsx +2 -2
- package/dist/templates/routes/_byline/admin/collections/$collection/create.tsx +2 -2
- package/dist/templates/routes/_byline/admin/collections/$collection/index.tsx +2 -2
- package/dist/templates/routes/_byline/admin/index.tsx +2 -2
- package/dist/templates/routes/_byline/admin/permissions/index.tsx +2 -2
- package/dist/templates/routes/_byline/admin/roles/$id/index.tsx +2 -2
- package/dist/templates/routes/_byline/admin/roles/index.tsx +2 -2
- package/dist/templates/routes/_byline/admin/route.tsx +2 -2
- package/dist/templates/routes/_byline/admin/singletons/$singleton/history.tsx +2 -2
- package/dist/templates/routes/_byline/admin/singletons/$singleton/index.tsx +2 -2
- package/dist/templates/routes/_byline/admin/users/$id/index.tsx +2 -2
- package/dist/templates/routes/_byline/admin/users/index.tsx +2 -2
- package/dist/templates/routes/_byline/route.lazy.tsx +2 -2
- package/dist/templates/routes/_byline/route.tsx +2 -2
- package/dist/templates/routes/_byline/sign-in.tsx +2 -2
- package/dist/templates/ui-byline/components/responsive-image/index.tsx +2 -2
- package/dist/templates/ui-byline/components/richtext-lexical/serialize/types.ts +2 -2
- package/dist/templates-editor-api-drift.test.d.ts +2 -2
- package/dist/templates-editor-api-drift.test.js +2 -2
- package/package.json +2 -2
package/LICENSE
CHANGED
|
@@ -352,12 +352,12 @@ If You choose to distribute Source Code Form that is Incompatible With
|
|
|
352
352
|
Secondary Licenses under the terms of this version of the License, the
|
|
353
353
|
notice described in Exhibit B of this License must be attached.
|
|
354
354
|
|
|
355
|
-
Exhibit A - Source Code License Notice
|
|
355
|
+
Exhibit A - Source Code Form License Notice
|
|
356
356
|
-------------------------------------------
|
|
357
357
|
|
|
358
|
-
This Source Code is subject to the terms of the Mozilla Public
|
|
358
|
+
This Source Code Form is subject to the terms of the Mozilla Public
|
|
359
359
|
License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
360
|
-
file, You can obtain one at
|
|
360
|
+
file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
361
361
|
|
|
362
362
|
If it is not possible or desirable to put the notice in a particular
|
|
363
363
|
file, then You may include the notice in a location (such as a LICENSE
|
|
@@ -369,5 +369,5 @@ You may add additional accurate notices of copyright ownership.
|
|
|
369
369
|
Exhibit B - "Incompatible With Secondary Licenses" Notice
|
|
370
370
|
---------------------------------------------------------
|
|
371
371
|
|
|
372
|
-
This Source Code is "Incompatible With Secondary Licenses", as
|
|
373
|
-
defined by the Mozilla Public License, v. 2.0.
|
|
372
|
+
This Source Code Form is "Incompatible With Secondary Licenses", as
|
|
373
|
+
defined by the Mozilla Public License, v. 2.0.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This Source Code is subject to the terms of the Mozilla Public
|
|
2
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
3
3
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
4
|
-
* file, You can obtain one at
|
|
4
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
5
|
*
|
|
6
6
|
* Copyright (c) Infonomic Company Limited
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This Source Code is subject to the terms of the Mozilla Public
|
|
2
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
3
3
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
4
|
-
* file, You can obtain one at
|
|
4
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
5
|
*
|
|
6
6
|
* Copyright (c) Infonomic Company Limited
|
|
7
7
|
*/
|
|
@@ -28,8 +28,9 @@ describe('scaffold server hook boundary', () => {
|
|
|
28
28
|
expect(source(`dialects/${adapter}/${flavor}/server.config.ts`)).toContain('hooks: serverHooks');
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
expect(source('host/vite.config.ts')).toContain("import { bylineClientHookBoundary } from '@byline/host-tanstack-start/vite'");
|
|
31
|
+
expect(source('host/vite.config.ts')).toContain("import { bylineClientHookBoundary, bylineNitroFeatures } from '@byline/host-tanstack-start/vite'");
|
|
32
32
|
expect(source('host/vite.config.ts')).toContain('bylineClientHookBoundary()');
|
|
33
|
+
expect(source('host/vite.config.ts')).toContain('features: bylineNitroFeatures()');
|
|
33
34
|
});
|
|
34
35
|
});
|
|
35
36
|
//# sourceMappingURL=template-hook-boundary.test.node.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template-hook-boundary.test.node.js","sourceRoot":"","sources":["../../src/lib/template-hook-boundary.test.node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAE7C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AAiC,CAAC,CAAA;IACpF,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This Source Code is subject to the terms of the Mozilla Public
|
|
2
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
3
3
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
4
|
-
* file, You can obtain one at
|
|
4
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
5
|
*
|
|
6
6
|
* Copyright (c) Infonomic Company Limited
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This Source Code is subject to the terms of the Mozilla Public
|
|
2
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
3
3
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
4
|
-
* file, You can obtain one at
|
|
4
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
5
|
*
|
|
6
6
|
* Copyright (c) Infonomic Company Limited
|
|
7
7
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template-path.d.ts","sourceRoot":"","sources":["../../src/lib/template-path.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAExD;
|
|
1
|
+
{"version":3,"file":"template-path.d.ts","sourceRoot":"","sources":["../../src/lib/template-path.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAExD;AAkBD,gFAAgF;AAChF,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAM9D"}
|
|
@@ -2,8 +2,27 @@
|
|
|
2
2
|
export function toPosixTemplatePath(path) {
|
|
3
3
|
return path.replaceAll('\\', '/');
|
|
4
4
|
}
|
|
5
|
+
/**
|
|
6
|
+
* Templates shipped in 6.13 and earlier carried the older wording of the MPL 2.0
|
|
7
|
+
* Exhibit A notice. Files a host installed from those templates must still be
|
|
8
|
+
* recognized as unmodified, so both wordings compare as the current one.
|
|
9
|
+
*/
|
|
10
|
+
const LEGACY_MPL_NOTICE_LINES = [
|
|
11
|
+
[
|
|
12
|
+
'This Source Code is subject to the terms of the Mozilla Public',
|
|
13
|
+
'This Source Code Form is subject to the terms of the Mozilla Public',
|
|
14
|
+
],
|
|
15
|
+
[
|
|
16
|
+
'file, You can obtain one at http://mozilla.org/MPL/2.0/.',
|
|
17
|
+
'file, You can obtain one at https://mozilla.org/MPL/2.0/.',
|
|
18
|
+
],
|
|
19
|
+
];
|
|
5
20
|
/** Source comparison used only for recognizing exact canonical predecessors. */
|
|
6
21
|
export function normalizeTemplateSource(source) {
|
|
7
|
-
|
|
22
|
+
let normalized = source.replaceAll('\r\n', '\n').trimEnd();
|
|
23
|
+
for (const [legacy, current] of LEGACY_MPL_NOTICE_LINES) {
|
|
24
|
+
normalized = normalized.replaceAll(legacy, current);
|
|
25
|
+
}
|
|
26
|
+
return normalized;
|
|
8
27
|
}
|
|
9
28
|
//# sourceMappingURL=template-path.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template-path.js","sourceRoot":"","sources":["../../src/lib/template-path.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;AACnC,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,uBAAuB,CAAC,MAAc;IACpD,
|
|
1
|
+
{"version":3,"file":"template-path.js","sourceRoot":"","sources":["../../src/lib/template-path.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;AACnC,CAAC;AAED;;;;GAIG;AACH,MAAM,uBAAuB,GAA6C;IACxE;QACE,gEAAgE;QAChE,qEAAqE;KACtE;IACD;QACE,0DAA0D;QAC1D,2DAA2D;KAC5D;CACF,CAAA;AAED,gFAAgF;AAChF,MAAM,UAAU,uBAAuB,CAAC,MAAc;IACpD,IAAI,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,OAAO,EAAE,CAAA;IAC1D,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,uBAAuB,EAAE,CAAC;QACxD,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACrD,CAAC;IACD,OAAO,UAAU,CAAA;AACnB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
3
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
4
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Infonomic Company Limited
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=template-path.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template-path.test.d.ts","sourceRoot":"","sources":["../../src/lib/template-path.test.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
3
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
4
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Infonomic Company Limited
|
|
7
|
+
*/
|
|
8
|
+
import { readFileSync } from 'node:fs';
|
|
9
|
+
import { fileURLToPath } from 'node:url';
|
|
10
|
+
import { describe, expect, it } from 'vitest';
|
|
11
|
+
import { recognizeGeneratedRoutesSource } from './route-config.js';
|
|
12
|
+
import { normalizeTemplateSource } from './template-path.js';
|
|
13
|
+
const CURRENT_NOTICE = `/**
|
|
14
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
15
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
16
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
17
|
+
*/`;
|
|
18
|
+
const LEGACY_NOTICE = `/**
|
|
19
|
+
* This Source Code is subject to the terms of the Mozilla Public
|
|
20
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
21
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
22
|
+
*/`;
|
|
23
|
+
function toLegacyNotice(source) {
|
|
24
|
+
return source
|
|
25
|
+
.replace('This Source Code Form is subject', 'This Source Code is subject')
|
|
26
|
+
.replace('https://mozilla.org/MPL/2.0/', 'http://mozilla.org/MPL/2.0/');
|
|
27
|
+
}
|
|
28
|
+
describe('normalizeTemplateSource', () => {
|
|
29
|
+
it('compares the legacy MPL notice wording as the current wording', () => {
|
|
30
|
+
expect(normalizeTemplateSource(`${LEGACY_NOTICE}\nexport {}\n`)).toBe(normalizeTemplateSource(`${CURRENT_NOTICE}\nexport {}\n`));
|
|
31
|
+
});
|
|
32
|
+
it('still distinguishes sources that differ outside the notice', () => {
|
|
33
|
+
expect(normalizeTemplateSource(`${LEGACY_NOTICE}\nexport const a = 1\n`)).not.toBe(normalizeTemplateSource(`${CURRENT_NOTICE}\nexport const a = 2\n`));
|
|
34
|
+
});
|
|
35
|
+
it('recognizes a routes.ts installed from a template with the legacy notice', () => {
|
|
36
|
+
const canonical = readFileSync(fileURLToPath(new URL('../templates/byline/routes.ts', import.meta.url)), 'utf8');
|
|
37
|
+
expect(canonical).toContain('This Source Code Form is subject');
|
|
38
|
+
const installed = toLegacyNotice(canonical);
|
|
39
|
+
expect(installed).not.toBe(canonical);
|
|
40
|
+
expect(recognizeGeneratedRoutesSource(installed, canonical)).not.toBeNull();
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=template-path.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template-path.test.js","sourceRoot":"","sources":["../../src/lib/template-path.test.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAE7C,OAAO,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAA;AAE5D,MAAM,cAAc,GAAG;;;;IAInB,CAAA;AAEJ,MAAM,aAAa,GAAG;;;;IAIlB,CAAA;AAEJ,SAAS,cAAc,CAAC,MAAc;IACpC,OAAO,MAAM;SACV,OAAO,CAAC,kCAAkC,EAAE,6BAA6B,CAAC;SAC1E,OAAO,CAAC,8BAA8B,EAAE,6BAA6B,CAAC,CAAA;AAC3E,CAAC;AAED,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACvC,EAAE,CAAC,+DAA+D,EAAE,GAAG,EAAE;QACvE,MAAM,CAAC,uBAAuB,CAAC,GAAG,aAAa,eAAe,CAAC,CAAC,CAAC,IAAI,CACnE,uBAAuB,CAAC,GAAG,cAAc,eAAe,CAAC,CAC1D,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,4DAA4D,EAAE,GAAG,EAAE;QACpE,MAAM,CAAC,uBAAuB,CAAC,GAAG,aAAa,wBAAwB,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAChF,uBAAuB,CAAC,GAAG,cAAc,wBAAwB,CAAC,CACnE,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,yEAAyE,EAAE,GAAG,EAAE;QACjF,MAAM,SAAS,GAAG,YAAY,CAC5B,aAAa,CAAC,IAAI,GAAG,CAAC,+BAA+B,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EACxE,MAAM,CACP,CAAA;QACD,MAAM,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,kCAAkC,CAAC,CAAA;QAC/D,MAAM,SAAS,GAAG,cAAc,CAAC,SAAS,CAAC,CAAA;QAC3C,MAAM,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;QACrC,MAAM,CAAC,8BAA8B,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAA;IAC7E,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
package/dist/manifest/deps.js
CHANGED
|
@@ -159,9 +159,9 @@ export const DEP_SPECS = [
|
|
|
159
159
|
},
|
|
160
160
|
{
|
|
161
161
|
name: 'nitro',
|
|
162
|
-
version: '
|
|
162
|
+
version: '3.0.261029-rc',
|
|
163
163
|
group: 'runtime',
|
|
164
|
-
note: 'Nitro plugin that drives TanStack Start SSR builds (vite.config.ts plugin);
|
|
164
|
+
note: 'Nitro plugin that drives TanStack Start SSR builds (vite.config.ts plugin); pinned exactly to the release Byline is tested against, because Nitro release candidates change behaviour between builds. Applies only when the host declares no `nitro`: the deps phase keeps any spec the host already declares, so a host scaffolded by TanStack Start keeps its `nitro-nightly` alias. vite.config.ts disables srvx FastResponse through bylineNitroFeatures() (h3js/srvx#343)',
|
|
165
165
|
},
|
|
166
166
|
// ---- Dev ---------------------------------------------------------------
|
|
167
167
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deps.js","sourceRoot":"","sources":["../../src/manifest/deps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EACL,oB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AAI,EAAE,YAAY;QAClB,OAAO,EAAE,QAAQ;QACjB,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,YAAY;QACtB,IAAI,EAAE,wFAAwF;KAC/F;IACD;QACE,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE,QAAQ;QACjB,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,YAAY;QACtB,IAAI,EAAE,mGAAmG;KAC1G;IACD;QACE,IAAI,EAAE,sBAAsB;QAC5B,OAAO,EAAE,QAAQ;QACjB,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,YAAY;QACtB,IAAI,EAAE,+DAA+D;KACtE;CACO,CAAA;AAEV,MAAM,UAAU,kBAAkB,CAAC,OAAgB;IACjD,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAA;IACjC,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,CAAA;IACvB,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE;QAC/B,IAAI,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC;YAAE,OAAO,KAAK,CAAA;QACnE,IAAI,IAAI,CAAC,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,IAAI;YAAE,OAAO,KAAK,CAAA;QAClE,OAAO,IAAI,CAAA;IACb,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/phases/wire/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/phases/wire/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAa,KAAK,EAA2B,MAAM,gBAAgB,CAAA;AAgB/E,eAAO,MAAM,SAAS,EAAE,KA0DvB,CAAA"}
|
|
@@ -21,8 +21,14 @@ export const wirePhase = {
|
|
|
21
21
|
defaultMode: 'confirm',
|
|
22
22
|
async detect(ctx) {
|
|
23
23
|
const results = await Promise.all(SUB_EDITS.map((sub) => sub.preview(ctx)));
|
|
24
|
-
|
|
24
|
+
const blocked = SUB_EDITS.flatMap((sub, i) => results[i]?.status === 'blocked' ? [{ key: sub.key, result: results[i] }] : []);
|
|
25
|
+
if (blocked.length > 0) {
|
|
26
|
+
// The runner stops on a blocked detect without planning, so this is the
|
|
27
|
+
// only place the reason and the required configuration can reach the user.
|
|
28
|
+
for (const { key, result } of blocked)
|
|
29
|
+
reportBlocked(ctx, key, result);
|
|
25
30
|
return 'blocked';
|
|
31
|
+
}
|
|
26
32
|
return results.every((result) => result.status === 'skipped') ? 'done' : 'pending';
|
|
27
33
|
},
|
|
28
34
|
async plan(ctx) {
|
|
@@ -56,18 +62,22 @@ export const wirePhase = {
|
|
|
56
62
|
}
|
|
57
63
|
break;
|
|
58
64
|
case 'blocked':
|
|
59
|
-
ctx
|
|
60
|
-
// A blocked sub-edit halts the run, so this note is the user's only
|
|
61
|
-
// instruction for how to unblock it — always show it when present.
|
|
62
|
-
if (r.snippet) {
|
|
63
|
-
ctx.prompter.note(r.snippet, `${sub.key}: required configuration`);
|
|
64
|
-
}
|
|
65
|
+
reportBlocked(ctx, sub.key, r);
|
|
65
66
|
break;
|
|
66
67
|
}
|
|
67
68
|
}
|
|
68
69
|
return { state: aggregateState(results.map((r) => r.result)) };
|
|
69
70
|
},
|
|
70
71
|
};
|
|
72
|
+
/**
|
|
73
|
+
* A blocked sub-edit halts the run, so its message and snippet are the user's
|
|
74
|
+
* only instruction for how to unblock it — always show both when present.
|
|
75
|
+
*/
|
|
76
|
+
function reportBlocked(ctx, key, r) {
|
|
77
|
+
ctx.logger.error(` ${key}: ${r.message}`);
|
|
78
|
+
if (r.snippet)
|
|
79
|
+
ctx.prompter.note(r.snippet, `${key}: required configuration`);
|
|
80
|
+
}
|
|
71
81
|
function formatNote(key, r) {
|
|
72
82
|
const tag = r.status === 'done' ? '+' : r.status === 'skipped' ? '✓' : r.status === 'manual' ? '!' : '✗';
|
|
73
83
|
return ` ${tag} ${key}: ${r.message}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/phases/wire/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/phases/wire/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAKjD,mEAAmE;AACnE,4EAA4E;AAC5E,0EAA0E;AAC1E,sEAAsE;AACtE,oDAAoD;AACpD,MAAM,SAAS,GAAc;IAC3B,YAAY;IACZ,iBAAiB;IACjB,WAAW;IACX,YAAY;IACZ,cAAc;CACf,CAAA;AAED,MAAM,CAAC,MAAM,SAAS,GAAU;IAC9B,EAAE,EAAE,MAAM;IACV,KAAK,EAAE,+DAA+D;IACtE,WAAW,EAAE,SAAS;IAEtB,KAAK,CAAC,MAAM,CAAC,GAAG;QACd,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,GA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;QAAE,OAAO,SAAS,CAAA;IAChE,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This Source Code is subject to the terms of the Mozilla Public
|
|
2
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
3
3
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
4
|
-
* file, You can obtain one at
|
|
4
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
5
|
*
|
|
6
6
|
* Copyright (c) Infonomic Company Limited
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This Source Code is subject to the terms of the Mozilla Public
|
|
2
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
3
3
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
4
|
-
* file, You can obtain one at
|
|
4
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
5
|
*
|
|
6
6
|
* Copyright (c) Infonomic Company Limited
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This Source Code is subject to the terms of the Mozilla Public
|
|
2
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
3
3
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
4
|
-
* file, You can obtain one at
|
|
4
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
5
|
*
|
|
6
6
|
* Copyright (c) Infonomic Company Limited
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This Source Code is subject to the terms of the Mozilla Public
|
|
2
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
3
3
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
4
|
-
* file, You can obtain one at
|
|
4
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
5
|
*
|
|
6
6
|
* Copyright (c) Infonomic Company Limited
|
|
7
7
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite-config-apply-error.test.d.ts","sourceRoot":"","sources":["../../../src/phases/wire/vite-config-apply-error.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { afterEach, describe, expect, it, vi } from 'vitest';
|
|
3
|
+
import { createTestContext } from '../../test-helpers.js';
|
|
4
|
+
import { wireViteConfig } from './vite-config.js';
|
|
5
|
+
// A merge that throws while being applied must come back as a clear blocked
|
|
6
|
+
// result, not escape as an exception. No real config throws after the
|
|
7
|
+
// in-place update fix, so the failure is injected.
|
|
8
|
+
vi.mock('./vite-config-merge.js', async (importActual) => {
|
|
9
|
+
const actual = await importActual();
|
|
10
|
+
return {
|
|
11
|
+
...actual,
|
|
12
|
+
analyzeUserConfig: () => ({
|
|
13
|
+
kind: 'mergeable',
|
|
14
|
+
plan: {
|
|
15
|
+
changes: ['update nitro rolldownConfig'],
|
|
16
|
+
unplaced: [],
|
|
17
|
+
apply() {
|
|
18
|
+
throw new Error('Manipulation error: A syntax error was inserted.\n\nvite.config.ts:1:1');
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
}),
|
|
22
|
+
};
|
|
23
|
+
});
|
|
24
|
+
const contexts = [];
|
|
25
|
+
afterEach(() => {
|
|
26
|
+
for (const ctx of contexts.splice(0))
|
|
27
|
+
rmSync(ctx.cwd, { recursive: true, force: true });
|
|
28
|
+
});
|
|
29
|
+
describe('Vite config merge failure', () => {
|
|
30
|
+
it('blocks with the reason and the canonical snippet, leaving the config untouched', async () => {
|
|
31
|
+
const ctx = createTestContext();
|
|
32
|
+
contexts.push(ctx);
|
|
33
|
+
const host = "import { defineConfig } from 'vite'\nexport default defineConfig({ plugins: [] })\n";
|
|
34
|
+
writeFileSync(ctx.resolve('vite.config.ts'), host);
|
|
35
|
+
const preview = await wireViteConfig.preview(ctx);
|
|
36
|
+
expect(preview.status).toBe('blocked');
|
|
37
|
+
expect(preview.message).toContain('could not be merged into it');
|
|
38
|
+
expect(preview.message).toContain('A syntax error was inserted.');
|
|
39
|
+
expect(preview.message).not.toContain('vite.config.ts:1:1');
|
|
40
|
+
expect(preview.message).toContain('byline init --from wire');
|
|
41
|
+
expect(preview.snippet).toBe(readFileSync(`${ctx.templatesDir()}/host/vite.config.ts`, 'utf8'));
|
|
42
|
+
expect(preview.writes).toBeUndefined();
|
|
43
|
+
expect(readFileSync(ctx.resolve('vite.config.ts'), 'utf8')).toBe(host);
|
|
44
|
+
expect(readdirSync(ctx.cwd).some((name) => name.startsWith('vite.config.ts.bak-'))).toBe(false);
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=vite-config-apply-error.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite-config-apply-error.test.js","sourceRoot":"","sources":["../../../src/phases/wire/vite-config-apply-error.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAE1E,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAE5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAGjD,4EAA4E;AAC5E,sEAAsE;AACtE,mDAAmD;AACnD,EAAE,CAAC,IAAI,CAAC,wBAAwB,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE;IACvD,MAAM,MAAM,GAAG,MAAM,YAAY,EAA2C,CAAA;IAC5E,OAAO;QACL,GAAG,MAAM;QACT,iBAAiB,EAAE,GAAG,EAAE,CAAC,CAAC;YACxB,IAAI,EAAE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OAAO,CAAC,CAAC,SAAS,CAAC,yBAAyB,CAAC,CAAA;QAC5D,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,GAAG,CAAC,YAAY,EAAE,sBAAsB,EAAE,MAAM,CAAC,CAAC,CAAA;QAC/F,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,aAAa,EAAE,CAAA;QACtC,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACtE,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACjG,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fingerprints of every value Byline's canonical `vite.config.ts` has held for
|
|
3
|
+
* the keys Byline manages in a host config.
|
|
4
|
+
*
|
|
5
|
+
* `byline init` replaces a managed value automatically only when the host's
|
|
6
|
+
* value is Byline's current one or matches a fingerprint listed here — that
|
|
7
|
+
* is, when an earlier release wrote it verbatim. Any other value has been
|
|
8
|
+
* changed by the host and is left untouched, so host additions such as an
|
|
9
|
+
* extra Nitro external are never silently dropped.
|
|
10
|
+
*
|
|
11
|
+
* Fingerprints come from `fingerprintValue()` in `vite-config-merge.ts`: the
|
|
12
|
+
* value's syntax tree without comments, whitespace, quote style or trailing
|
|
13
|
+
* commas. Each entry names the template commit that first shipped the value.
|
|
14
|
+
*
|
|
15
|
+
* When you change a managed value in `templates/host/vite.config.ts`, the
|
|
16
|
+
* contract test in `vite-config-merge.test.ts` fails. Move the key's old
|
|
17
|
+
* fingerprint from `CURRENT_MANAGED_VALUES` into this list, and record the new
|
|
18
|
+
* one there.
|
|
19
|
+
*/
|
|
20
|
+
/** A Byline-managed key in a host `vite.config.ts`; `nitro.` keys sit in the `nitro({...})` call. */
|
|
21
|
+
export type ManagedKey = 'environments' | 'ssr' | 'optimizeDeps' | 'nitro.noExternals' | 'nitro.rolldownConfig' | 'nitro.features';
|
|
22
|
+
export declare const KNOWN_MANAGED_VALUES: Readonly<Record<ManagedKey, readonly string[]>>;
|
|
23
|
+
/**
|
|
24
|
+
* Fingerprints of the current canonical values, pinned so that changing one
|
|
25
|
+
* fails a test until its previous fingerprint is added to the known list.
|
|
26
|
+
*/
|
|
27
|
+
export declare const CURRENT_MANAGED_VALUES: Readonly<Record<ManagedKey, string>>;
|
|
28
|
+
//# sourceMappingURL=vite-config-known-values.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite-config-known-values.d.ts","sourceRoot":"","sources":["../../../src/phases/wire/vite-config-known-values.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,qGAAqG;AACrG,MAAM,MAAM,UAAU,GAClB,cAAc,GACd,KAAK,GACL,cAAc,GACd,mBAAmB,GACnB,sBAAsB,GACtB,gBAAgB,CAAA;AAEpB,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC,CAyBhF,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAOvE,CAAA"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fingerprints of every value Byline's canonical `vite.config.ts` has held for
|
|
3
|
+
* the keys Byline manages in a host config.
|
|
4
|
+
*
|
|
5
|
+
* `byline init` replaces a managed value automatically only when the host's
|
|
6
|
+
* value is Byline's current one or matches a fingerprint listed here — that
|
|
7
|
+
* is, when an earlier release wrote it verbatim. Any other value has been
|
|
8
|
+
* changed by the host and is left untouched, so host additions such as an
|
|
9
|
+
* extra Nitro external are never silently dropped.
|
|
10
|
+
*
|
|
11
|
+
* Fingerprints come from `fingerprintValue()` in `vite-config-merge.ts`: the
|
|
12
|
+
* value's syntax tree without comments, whitespace, quote style or trailing
|
|
13
|
+
* commas. Each entry names the template commit that first shipped the value.
|
|
14
|
+
*
|
|
15
|
+
* When you change a managed value in `templates/host/vite.config.ts`, the
|
|
16
|
+
* contract test in `vite-config-merge.test.ts` fails. Move the key's old
|
|
17
|
+
* fingerprint from `CURRENT_MANAGED_VALUES` into this list, and record the new
|
|
18
|
+
* one there.
|
|
19
|
+
*/
|
|
20
|
+
export const KNOWN_MANAGED_VALUES = {
|
|
21
|
+
environments: [
|
|
22
|
+
'b391f04a8768da3d', // ca756eba 2026-05-04
|
|
23
|
+
'7212c4d354863c26', // 4480ec21 2026-05-05
|
|
24
|
+
'804a50f00ba4a608', // d89c63db 2026-05-05
|
|
25
|
+
'fe6849ad53880b6f', // b5a771ab 2026-05-05
|
|
26
|
+
'4c491439ccff077c', // e0e4cb8e 2026-05-18
|
|
27
|
+
'60567e6cb34b5e26', // 74214970 2026-06-13
|
|
28
|
+
],
|
|
29
|
+
ssr: [
|
|
30
|
+
'4d5fff8b081c0af8', // 8f1b250d 2026-05-04
|
|
31
|
+
],
|
|
32
|
+
optimizeDeps: [
|
|
33
|
+
'38a7b8b3963c2d94', // 8f1b250d 2026-05-04
|
|
34
|
+
'64eccb3ce1e0c72e', // ca756eba 2026-05-04
|
|
35
|
+
],
|
|
36
|
+
'nitro.noExternals': [
|
|
37
|
+
'77049b458ee9a15d', // ca756eba 2026-05-04
|
|
38
|
+
],
|
|
39
|
+
'nitro.rolldownConfig': [
|
|
40
|
+
'8e10d8e9d8129d4c', // d89c63db 2026-05-05
|
|
41
|
+
'97e7093cd35ec77d', // f711e27f 2026-05-22
|
|
42
|
+
'5167f45021036e10', // eccf2efd 2026-05-23
|
|
43
|
+
],
|
|
44
|
+
'nitro.features': [],
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Fingerprints of the current canonical values, pinned so that changing one
|
|
48
|
+
* fails a test until its previous fingerprint is added to the known list.
|
|
49
|
+
*/
|
|
50
|
+
export const CURRENT_MANAGED_VALUES = {
|
|
51
|
+
environments: 'c6c2d8551a3deceb',
|
|
52
|
+
ssr: 'cc13e6456f315cde',
|
|
53
|
+
optimizeDeps: 'd6735dd480e8b5de',
|
|
54
|
+
'nitro.noExternals': 'ca65f9d7f863e1b4',
|
|
55
|
+
'nitro.rolldownConfig': '75d7e4182c816520',
|
|
56
|
+
'nitro.features': 'f10af2cc672233dc',
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=vite-config-known-values.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite-config-known-values.js","sourceRoot":"","sources":["../../../src/phases/wire/vite-config-known-values.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAWH,MAAM,CAAC,MAAM,oBAAoB,GAAoD;IACnF,YAAY,EAAE;QACZ,kBAAkB,EAAE,sBAAsB;QAC1C,kBAAkB,EAAE,sBAAsB;QAC1C,kBAAkB,EAAE,sBAAsB;QAC1C,kBAAkB,EAAE,sBAAsB;QAC1C,kBAAkB,EAAE,sBAAsB;QAC1C,kBAAkB,EAAE,sBAAsB;KAC3C;IACD,GAAG,EAAE;QACH,kBAAkB,EAAE,sBAAsB;KAC3C;IACD,YAAY,EAAE;QACZ,kBAAkB,EAAE,sBAAsB;QAC1C,kBAAkB,EAAE,sBAAsB;KAC3C;IACD,mBAAmB,EAAE;QACnB,kBAAkB,EAAE,sBAAsB;KAC3C;IACD,sBAAsB,EAAE;QACtB,kBAAkB,EAAE,sBAAsB;QAC1C,kBAAkB,EAAE,sBAAsB;QAC1C,kBAAkB,EAAE,sBAAsB;KAC3C;IACD,gBAAgB,EAAE,EAAE;CACrB,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAyC;IAC1E,YAAY,EAAE,kBAAkB;IAChC,GAAG,EAAE,kBAAkB;IACvB,YAAY,EAAE,kBAAkB;IAChC,mBAAmB,EAAE,kBAAkB;IACvC,sBAAsB,EAAE,kBAAkB;IAC1C,gBAAgB,EAAE,kBAAkB;CACrC,CAAA"}
|
|
@@ -15,6 +15,14 @@
|
|
|
15
15
|
* failure from install time, where the CLI can explain it, to a confusing
|
|
16
16
|
* runtime or production-build failure.
|
|
17
17
|
*/
|
|
18
|
+
import { type ManagedKey } from './vite-config-known-values.js';
|
|
19
|
+
/**
|
|
20
|
+
* The fingerprint of each managed value in a config, keyed like
|
|
21
|
+
* {@link KNOWN_MANAGED_VALUES}. Keys the config does not set are absent. Used
|
|
22
|
+
* to pin the canonical values, so that changing one forces its previous
|
|
23
|
+
* fingerprint into the known list.
|
|
24
|
+
*/
|
|
25
|
+
export declare function managedValueFingerprints(configSource: string): Map<ManagedKey, string>;
|
|
18
26
|
export interface CanonicalPieces {
|
|
19
27
|
/** Source text of each module-level statement, keyed by declaration name. */
|
|
20
28
|
statements: Map<string, string>;
|
|
@@ -22,6 +30,10 @@ export interface CanonicalPieces {
|
|
|
22
30
|
configProps: Map<string, string>;
|
|
23
31
|
/** Source text of each `nitro()` option, keyed by property name. */
|
|
24
32
|
nitroProps: Map<string, string>;
|
|
33
|
+
/** Source text of each managed value, without its key, for in-place updates. */
|
|
34
|
+
values: Map<ManagedKey, string>;
|
|
35
|
+
/** Structural fingerprint of each managed value. */
|
|
36
|
+
fingerprints: Map<ManagedKey, string>;
|
|
25
37
|
}
|
|
26
38
|
export interface MergePlan {
|
|
27
39
|
/** Human-readable description of each edit, for the phase preview. */
|
|
@@ -36,6 +48,11 @@ export type MergeAnalysis = {
|
|
|
36
48
|
} | {
|
|
37
49
|
kind: 'mergeable';
|
|
38
50
|
plan: MergePlan;
|
|
51
|
+
}
|
|
52
|
+
/** Nothing to apply, but some managed values were customized by the host. */
|
|
53
|
+
| {
|
|
54
|
+
kind: 'customized';
|
|
55
|
+
notes: string[];
|
|
39
56
|
} | {
|
|
40
57
|
kind: 'unrecognized';
|
|
41
58
|
reason: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite-config-merge.d.ts","sourceRoot":"","sources":["../../../src/phases/wire/vite-config-merge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;
|
|
1
|
+
{"version":3,"file":"vite-config-merge.d.ts","sourceRoot":"","sources":["../../../src/phases/wire/vite-config-merge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAcH,OAAO,EAAwB,KAAK,UAAU,EAAE,MAAM,+BAA+B,CAAA;AA+HrF;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,YAAY,EAAE,MAAM,GAAG,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,CAiBtF;AAED,MAAM,WAAW,eAAe;IAC9B,6EAA6E;IAC7E,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,2EAA2E;IAC3E,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAChC,oEAAoE;IACpE,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,gFAAgF;IAChF,MAAM,EAAE,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,CAAA;IAC/B,oDAAoD;IACpD,YAAY,EAAE,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,CAAA;CACtC;AAED,MAAM,WAAW,SAAS;IACxB,sEAAsE;IACtE,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,iFAAiF;IACjF,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,2DAA2D;IAC3D,KAAK,IAAI,MAAM,CAAA;CAChB;AAED,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,WAAW,CAAA;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