@kirchdev/duxt 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/app/components/DuxtBrand.vue +1 -1
- package/app/components/DuxtBrunoEntries.vue +1 -1
- package/app/components/DuxtCopyPage.vue +1 -1
- package/app/components/DuxtLandingShowcase.vue +1 -1
- package/app/components/DuxtOpenApiCallbacks.vue +1 -1
- package/app/components/DuxtOpenApiClient.vue +1 -1
- package/app/components/DuxtOpenApiMedia.vue +1 -1
- package/app/components/DuxtOpenApiParameters.vue +1 -1
- package/app/components/DuxtOpenApiResponses.vue +1 -1
- package/app/components/DuxtOpenApiSchema.vue +1 -1
- package/app/components/DuxtOpenApiSecurity.vue +1 -1
- package/app/components/content/BrunoOverview.vue +4 -1
- package/app/components/content/BrunoRequest.vue +2 -2
- package/app/components/content/OpenApiOperation.vue +1 -1
- package/app/components/content/OpenApiOperations.vue +1 -1
- package/app/components/content/OpenApiOverview.vue +1 -1
- package/app/components/content/Partial.vue +1 -1
- package/app/components/content/ProseImg.vue +1 -1
- package/app/composables/useDuxtCollection.ts +1 -1
- package/app/composables/useDuxtNavigation.ts +1 -1
- package/app/composables/useDuxtSearch.ts +1 -1
- package/app/types/duxt.d.ts +17 -0
- package/app/utils/duxt-config.ts +5 -5
- package/app/utils/openapi.ts +1 -1
- package/app/utils/search-scope.ts +1 -1
- package/app/utils/version-choices.ts +8 -5
- package/app/utils/version-paths.ts +1 -1
- package/bin/duxt-cache-key.mjs +3 -2
- package/bin/duxt-og-cache.mjs +3 -1
- package/bin/duxt.mjs +2 -2
- package/{bruno-parse.ts → build/bruno/bruno-parse.ts} +1 -1
- package/{bruno-zip.ts → build/bruno/bruno-zip.ts} +1 -1
- package/{report.ts → build/cli/report.ts} +7 -7
- package/{validate-report.ts → build/cli/validate-report.ts} +3 -3
- package/{duxt-app-config.ts → build/config/duxt-app-config.ts} +5 -2
- package/{git-contributors.ts → build/git/git-contributors.ts} +64 -31
- package/{search-records.ts → build/search/search-records.ts} +3 -3
- package/{section-reports.ts → build/sections/section-reports.ts} +2 -2
- package/{sections-bruno.ts → build/sections/sections-bruno.ts} +4 -4
- package/{sections-changelog.ts → build/sections/sections-changelog.ts} +4 -4
- package/{sections-openapi.ts → build/sections/sections-openapi.ts} +3 -3
- package/{sections-resolve.ts → build/sections/sections-resolve.ts} +2 -2
- package/{sections.ts → build/sections/sections.ts} +4 -4
- package/{sources-cache.ts → build/sources/sources-cache.ts} +2 -2
- package/{sources-git.ts → build/sources/sources-git.ts} +46 -31
- package/{sources-resolve.ts → build/sources/sources-resolve.ts} +107 -17
- package/content.config.ts +4 -4
- package/modules/bruno.ts +12 -6
- package/modules/config.ts +9 -6
- package/modules/git-meta.ts +9 -6
- package/modules/redirects.ts +7 -4
- package/modules/search-records.ts +4 -4
- package/modules/validate.ts +9 -6
- package/nuxt.config.ts +1 -1
- package/package.json +22 -85
- package/server/devtools/content.ts +2 -2
- package/server/devtools/preview.ts +3 -3
- package/server/devtools/render/content.ts +2 -2
- package/server/devtools/render/sources.ts +4 -1
- package/server/devtools/sources.ts +1 -1
- package/server/mcp/tools/read-page.ts +1 -1
- package/server/middleware/raw-markdown.ts +2 -2
- package/server/routes/llms-full.txt.get.ts +1 -1
- package/server/utils/llms-pages.ts +1 -1
- package/server/utils/mcp-docs.ts +2 -2
- /package/{bruno-model.ts → build/bruno/bruno-model.ts} +0 -0
- /package/{cli.ts → build/cli/cli.ts} +0 -0
- /package/{content-cache.ts → build/content/content-cache.ts} +0 -0
- /package/{frontmatter.ts → build/content/frontmatter.ts} +0 -0
- /package/{highlight-langs.ts → build/content/highlight-langs.ts} +0 -0
- /package/{og-image-cache.ts → build/og-image/og-image-cache.ts} +0 -0
- /package/{openapi-model.ts → build/openapi/openapi-model.ts} +0 -0
- /package/{openapi-parse.ts → build/openapi/openapi-parse.ts} +0 -0
- /package/{section-input.ts → build/sections/section-input.ts} +0 -0
- /package/{section-markdown.ts → build/sections/section-markdown.ts} +0 -0
- /package/{repository-root.ts → build/sources/repository-root.ts} +0 -0
- /package/{sources.ts → build/sources/sources.ts} +0 -0
- /package/{tfplugindocs.ts → build/sources/tfplugindocs.ts} +0 -0
|
@@ -29,16 +29,16 @@
|
|
|
29
29
|
* in Bruno" clone of today's HEAD can offer.
|
|
30
30
|
*/
|
|
31
31
|
import { stringify as stringifyYaml } from 'yaml';
|
|
32
|
-
import { frontmatterBlock } from '
|
|
32
|
+
import { frontmatterBlock } from '../content/frontmatter';
|
|
33
33
|
import { firstLine, pageOrder, urlSegment } from './section-markdown';
|
|
34
34
|
import type {
|
|
35
35
|
DuxtBrunoCollection,
|
|
36
36
|
DuxtBrunoEntry,
|
|
37
37
|
DuxtBrunoFolder,
|
|
38
38
|
DuxtBrunoRequest
|
|
39
|
-
} from '
|
|
40
|
-
import { parseBrunoCollection } from '
|
|
41
|
-
import { brunoZipPath } from '
|
|
39
|
+
} from '../bruno/bruno-model';
|
|
40
|
+
import { parseBrunoCollection } from '../bruno/bruno-parse';
|
|
41
|
+
import { brunoZipPath } from '../bruno/bruno-zip';
|
|
42
42
|
import type {
|
|
43
43
|
DuxtSectionContext,
|
|
44
44
|
DuxtSectionInput,
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
* two components this file writes calls to.
|
|
33
33
|
*/
|
|
34
34
|
import { stringify as stringifyYaml } from 'yaml';
|
|
35
|
-
import { frontmatterBlock } from '
|
|
36
|
-
import type { DuxtContributor } from '
|
|
35
|
+
import { frontmatterBlock } from '../content/frontmatter';
|
|
36
|
+
import type { DuxtContributor } from '../git/git-contributors';
|
|
37
37
|
import {
|
|
38
38
|
contributorsForVersion,
|
|
39
39
|
releaseContributors
|
|
40
|
-
} from '
|
|
40
|
+
} from '../git/git-contributors';
|
|
41
41
|
import type {
|
|
42
42
|
DuxtSectionContext,
|
|
43
43
|
DuxtSectionInput,
|
|
@@ -45,7 +45,7 @@ import type {
|
|
|
45
45
|
DuxtSectionPage,
|
|
46
46
|
DuxtSectionType
|
|
47
47
|
} from './sections-resolve';
|
|
48
|
-
import { slugify } from '
|
|
48
|
+
import { slugify } from '../sources/sources-resolve';
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
51
|
* The names this type binds — PUBLIC SURFACE, so renaming one is a `feat!:`.
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* responses, the try-it client — travels as props.
|
|
25
25
|
*/
|
|
26
26
|
import { stringify as stringifyYaml } from 'yaml';
|
|
27
|
-
import { frontmatterBlock } from '
|
|
27
|
+
import { frontmatterBlock } from '../content/frontmatter';
|
|
28
28
|
import { firstLine, pageOrder, urlSegment } from './section-markdown';
|
|
29
29
|
import type {
|
|
30
30
|
DuxtOpenApiOperation,
|
|
@@ -32,8 +32,8 @@ import type {
|
|
|
32
32
|
DuxtOpenApiServer,
|
|
33
33
|
DuxtOpenApiSpec,
|
|
34
34
|
DuxtOpenApiTag
|
|
35
|
-
} from '
|
|
36
|
-
import { compactOpenApi, parseOpenApiDocument } from '
|
|
35
|
+
} from '../openapi/openapi-model';
|
|
36
|
+
import { compactOpenApi, parseOpenApiDocument } from '../openapi/openapi-parse';
|
|
37
37
|
import type {
|
|
38
38
|
DuxtSectionContext,
|
|
39
39
|
DuxtSectionInput,
|
|
@@ -20,14 +20,14 @@ import type {
|
|
|
20
20
|
DuxtSource,
|
|
21
21
|
DuxtSourceStatus,
|
|
22
22
|
DuxtSourcesOptions
|
|
23
|
-
} from '
|
|
23
|
+
} from '../sources/sources-resolve';
|
|
24
24
|
import {
|
|
25
25
|
assertCollectionIdentities,
|
|
26
26
|
expandSources,
|
|
27
27
|
identifier,
|
|
28
28
|
resolveSources,
|
|
29
29
|
slugify
|
|
30
|
-
} from '
|
|
30
|
+
} from '../sources/sources-resolve';
|
|
31
31
|
import { brunoSectionType } from './sections-bruno';
|
|
32
32
|
import { changelogSectionType } from './sections-changelog';
|
|
33
33
|
import { openapiSectionType } from './sections-openapi';
|
|
@@ -23,7 +23,7 @@ import type {
|
|
|
23
23
|
DuxtResolvedSource,
|
|
24
24
|
DuxtSource,
|
|
25
25
|
DuxtSourcesOptions
|
|
26
|
-
} from '
|
|
26
|
+
} from '../sources/sources-resolve';
|
|
27
27
|
import type {
|
|
28
28
|
DuxtSectionPage,
|
|
29
29
|
DuxtSectionType,
|
|
@@ -41,9 +41,9 @@ import {
|
|
|
41
41
|
sectionArtefactExists,
|
|
42
42
|
sectionInputKind
|
|
43
43
|
} from './section-input';
|
|
44
|
-
import { resolveLatestRefs } from '
|
|
45
|
-
import { localHistoryFor } from '
|
|
46
|
-
import { pageSchema, repositoryRoot } from '
|
|
44
|
+
import { resolveLatestRefs } from '../sources/sources-git';
|
|
45
|
+
import { localHistoryFor } from '../git/git-contributors';
|
|
46
|
+
import { pageSchema, repositoryRoot } from '../sources/sources';
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
49
|
* One collection per declared section.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createHash } from 'node:crypto';
|
|
2
2
|
import { join, relative, resolve } from 'node:path';
|
|
3
|
-
import { readDuxtBuildConfig } from '
|
|
3
|
+
import { readDuxtBuildConfig } from '../config/duxt-app-config';
|
|
4
4
|
import { resolveLatestRefs } from './sources-git';
|
|
5
5
|
import type { DuxtSource, DuxtSourcesOptions } from './sources-resolve';
|
|
6
6
|
import {
|
|
@@ -296,7 +296,7 @@ export function duxtSourcesCache(
|
|
|
296
296
|
options: DuxtSourcesCacheOptions = {}
|
|
297
297
|
): DuxtSourcesCacheKey {
|
|
298
298
|
// ABSOLUTE, always. `readDuxtBuildConfig` hands the path to a module loader,
|
|
299
|
-
// which resolves a bare `www/app/app.config.ts` as a PACKAGE specifier and
|
|
299
|
+
// which resolves a bare `apps/www/app/app.config.ts` as a PACKAGE specifier and
|
|
300
300
|
// reports a missing module — a site whose config was found reads identically
|
|
301
301
|
// to one whose sources are all local, and the cache silently never fires.
|
|
302
302
|
const rootDir = resolve(options.rootDir ?? process.cwd());
|
|
@@ -2,16 +2,19 @@ import { execFileSync } from 'node:child_process';
|
|
|
2
2
|
import type {
|
|
3
3
|
DuxtRef,
|
|
4
4
|
DuxtSource,
|
|
5
|
-
DuxtSourceReleases
|
|
5
|
+
DuxtSourceReleases,
|
|
6
|
+
DuxtVersionTag
|
|
6
7
|
} from './sources-resolve';
|
|
7
8
|
import {
|
|
8
9
|
compareVersionTags,
|
|
9
10
|
expandSources,
|
|
10
11
|
isLatestRef,
|
|
11
12
|
newestTag,
|
|
13
|
+
parseVersionTag,
|
|
12
14
|
refIsTag,
|
|
13
15
|
refName,
|
|
14
|
-
repoUrl
|
|
16
|
+
repoUrl,
|
|
17
|
+
tagBelongsTo
|
|
15
18
|
} from './sources-resolve';
|
|
16
19
|
|
|
17
20
|
/**
|
|
@@ -153,32 +156,34 @@ function tagsFor(source: DuxtSource, what: string): string[] {
|
|
|
153
156
|
return found.tags;
|
|
154
157
|
}
|
|
155
158
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
159
|
+
/**
|
|
160
|
+
* The version tags a source may publish from: every tag that reads as a
|
|
161
|
+
* version and belongs to the source's `tagComponent`, when it names one.
|
|
162
|
+
*/
|
|
163
|
+
function versionTags(
|
|
164
|
+
tags: string[],
|
|
165
|
+
component: string | undefined
|
|
166
|
+
): { tag: string; version: DuxtVersionTag }[] {
|
|
167
|
+
return tags
|
|
168
|
+
.map((tag) => ({ tag, version: parseVersionTag(tag) }))
|
|
169
|
+
.filter(
|
|
170
|
+
(entry): entry is { tag: string; version: DuxtVersionTag } =>
|
|
171
|
+
Boolean(entry.version) && tagBelongsTo(entry.version!, component)
|
|
172
|
+
);
|
|
160
173
|
}
|
|
161
174
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
return {
|
|
167
|
-
major: Number(match[1]),
|
|
168
|
-
minor: Number(match[2]),
|
|
169
|
-
prerelease: Boolean(match[3])
|
|
170
|
-
};
|
|
171
|
-
}
|
|
175
|
+
/** How a source's tag restriction reads in an error, or nothing without one. */
|
|
176
|
+
const componentClause = (source: DuxtSource) =>
|
|
177
|
+
source.tagComponent ? ` for the component "${source.tagComponent}"` : '';
|
|
172
178
|
|
|
173
179
|
/** Tags selected by a source's explicit release policy, newest first. */
|
|
174
|
-
function releaseTags(
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
)
|
|
180
|
+
function releaseTags(
|
|
181
|
+
tags: string[],
|
|
182
|
+
releases: DuxtSourceReleases,
|
|
183
|
+
component: string | undefined
|
|
184
|
+
): string[] {
|
|
185
|
+
const parsed = versionTags(tags, component)
|
|
186
|
+
.filter((entry) => releases.prereleases || !entry.version.pre)
|
|
182
187
|
.sort((left, right) => compareVersionTags(left.tag, right.tag));
|
|
183
188
|
|
|
184
189
|
if (releases.select === 'all') return parsed.map((entry) => entry.tag);
|
|
@@ -186,10 +191,9 @@ function releaseTags(tags: string[], releases: DuxtSourceReleases): string[] {
|
|
|
186
191
|
const selected = new Set<string>();
|
|
187
192
|
const result: string[] = [];
|
|
188
193
|
for (const entry of parsed) {
|
|
194
|
+
const [major, minor] = entry.version.numbers;
|
|
189
195
|
const line =
|
|
190
|
-
releases.select === 'major'
|
|
191
|
-
? String(entry.version.major)
|
|
192
|
-
: `${entry.version.major}.${entry.version.minor}`;
|
|
196
|
+
releases.select === 'major' ? String(major) : `${major}.${minor}`;
|
|
193
197
|
if (selected.has(line)) continue;
|
|
194
198
|
selected.add(line);
|
|
195
199
|
result.push(entry.tag);
|
|
@@ -206,12 +210,14 @@ function resolveReleaseRefs(source: DuxtSource): DuxtSource {
|
|
|
206
210
|
|
|
207
211
|
const tags = releaseTags(
|
|
208
212
|
tagsFor(source, `releases selection "${source.releases.select}"`),
|
|
209
|
-
source.releases
|
|
213
|
+
source.releases,
|
|
214
|
+
source.tagComponent
|
|
210
215
|
);
|
|
211
216
|
if (!tags.length) {
|
|
212
217
|
throw new Error(
|
|
213
218
|
`duxt: releases selection "${source.releases.select}" on ` +
|
|
214
|
-
`${source.repo ?? 'this repository'} found no SemVer tags to publish
|
|
219
|
+
`${source.repo ?? 'this repository'} found no SemVer tags to publish` +
|
|
220
|
+
`${componentClause(source)}.`
|
|
215
221
|
);
|
|
216
222
|
}
|
|
217
223
|
|
|
@@ -248,12 +254,21 @@ export function resolveLatestRefs(sources: DuxtSource[]): DuxtSource[] {
|
|
|
248
254
|
return discovered.map((source) => {
|
|
249
255
|
if (!source.refs?.some(isLatestRef)) return source;
|
|
250
256
|
|
|
251
|
-
const
|
|
257
|
+
const tags = tagsFor(source, "refs: ['latest']");
|
|
258
|
+
|
|
259
|
+
// Restricted only when a component is named: an unrestricted source keeps
|
|
260
|
+
// choosing among every tag, exactly as before component tags existed.
|
|
261
|
+
const newest = newestTag(
|
|
262
|
+
source.tagComponent
|
|
263
|
+
? versionTags(tags, source.tagComponent).map((entry) => entry.tag)
|
|
264
|
+
: tags
|
|
265
|
+
);
|
|
252
266
|
|
|
253
267
|
if (!newest) {
|
|
254
268
|
throw new Error(
|
|
255
269
|
`duxt: refs: ['latest'] on ${source.repo ?? 'this repository'} found ` +
|
|
256
|
-
|
|
270
|
+
`no tags to choose from${componentClause(source)}. Name a tag ` +
|
|
271
|
+
'explicitly, or drop the entry.'
|
|
257
272
|
);
|
|
258
273
|
}
|
|
259
274
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import type {
|
|
4
4
|
DuxtGeneratedMeta,
|
|
5
5
|
DuxtGeneratedSection
|
|
6
|
-
} from '
|
|
6
|
+
} from '../sections/sections-resolve';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* A documentation source: a folder, in this repository or another, at the
|
|
@@ -49,6 +49,19 @@ export interface DuxtSource {
|
|
|
49
49
|
* label, lifecycle, default and locales.
|
|
50
50
|
*/
|
|
51
51
|
releases?: DuxtSourceReleases;
|
|
52
|
+
/**
|
|
53
|
+
* The one package whose tags this source publishes from.
|
|
54
|
+
*
|
|
55
|
+
* A release-please monorepo tags every published package on its own —
|
|
56
|
+
* `duxt@v0.4.0` beside `duxt-typesense@v0.1.0` — so "the newest tag" means
|
|
57
|
+
* nothing until it says whose. Naming a component restricts `latest` and
|
|
58
|
+
* `releases` to that package's `<component>@…` tags. Plain `vX.Y.Z` tags
|
|
59
|
+
* still count: they are the history from before the repository adopted
|
|
60
|
+
* component tags, and dropping them would unpublish every earlier release.
|
|
61
|
+
*
|
|
62
|
+
* Unset, every tag that reads as a version is a candidate, prefixed or not.
|
|
63
|
+
*/
|
|
64
|
+
tagComponent?: string;
|
|
52
65
|
/**
|
|
53
66
|
* Languages this source is available in, beyond the one written in `path`.
|
|
54
67
|
*
|
|
@@ -655,7 +668,15 @@ export function resolveSources(
|
|
|
655
668
|
(ref && typeof ref === 'object' ? ref.label : undefined) ?? source.label;
|
|
656
669
|
const code = locale ? localeCode(locale) : defaultLocale;
|
|
657
670
|
const isDefaultLocale = !code || code === defaultLocale;
|
|
658
|
-
|
|
671
|
+
// A component-prefixed tag is shown and addressed by its version:
|
|
672
|
+
// `duxt@v0.4.0` reads `v0.4.0` in the switcher and the URL, while `ref`
|
|
673
|
+
// below keeps the full tag git knows. A branch's name is never touched —
|
|
674
|
+
// `release@1.0.0` as a BRANCH is a name, not a release.
|
|
675
|
+
const shown =
|
|
676
|
+
effectiveRef && refIsTag(effectiveRef) && name
|
|
677
|
+
? versionTagName(name)
|
|
678
|
+
: name;
|
|
679
|
+
const version = name ? slugify(label ?? shown!) : undefined;
|
|
659
680
|
const isDefault =
|
|
660
681
|
!name ||
|
|
661
682
|
(ref && typeof ref === 'object' && Boolean(ref.default)) ||
|
|
@@ -816,6 +837,85 @@ export function duxtSourceManifest(
|
|
|
816
837
|
return resolveSources(sources, options);
|
|
817
838
|
}
|
|
818
839
|
|
|
840
|
+
/** A version tag, taken apart. */
|
|
841
|
+
export interface DuxtVersionTag {
|
|
842
|
+
/**
|
|
843
|
+
* The package a monorepo release tool named in front of the version —
|
|
844
|
+
* `duxt` in `duxt@v0.4.0`. Absent on a plain `v0.4.0`.
|
|
845
|
+
*/
|
|
846
|
+
component?: string;
|
|
847
|
+
/** The version itself, as written: `v0.4.0`, `1.2.0-rc.1`. */
|
|
848
|
+
version: string;
|
|
849
|
+
numbers: [number, number, number];
|
|
850
|
+
pre?: string;
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
/**
|
|
854
|
+
* Read a tag as a version, or answer `undefined` for anything that is not one.
|
|
855
|
+
*
|
|
856
|
+
* TWO SHAPES, because release tooling writes two. A single-package repository
|
|
857
|
+
* tags `v1.2.3`; a release-please monorepo tags `<component>@v1.2.3`, one
|
|
858
|
+
* component per published package. Everything that orders or selects releases
|
|
859
|
+
* reads a tag through this one function, so `latest`, release discovery and
|
|
860
|
+
* the switcher's order cannot disagree about which tags are versions — the
|
|
861
|
+
* drift that would let a site's `latest` stay on the last plain tag, silently,
|
|
862
|
+
* after the first component tag was cut.
|
|
863
|
+
*
|
|
864
|
+
* The component is everything before the LAST `@`, so a scoped package name
|
|
865
|
+
* (`@acme/sdk@v1.0.0`) keeps its own.
|
|
866
|
+
*
|
|
867
|
+
* SPLIT BY INDEX, NOT BY ONE PATTERN. A tag name is input from whatever
|
|
868
|
+
* repository a site points at, and a single expression with a component and a
|
|
869
|
+
* pre-release that could each take the other's `@` gave the engine overlapping
|
|
870
|
+
* ways to split one string — CodeQL's js/polynomial-redos. Cutting at the last
|
|
871
|
+
* `@` first leaves the pattern nothing to choose between, and the pre-release
|
|
872
|
+
* keeps to semver's own characters, so an `@` after the version makes the tag
|
|
873
|
+
* not a version rather than part of its pre-release.
|
|
874
|
+
*/
|
|
875
|
+
export function parseVersionTag(value: string): DuxtVersionTag | undefined {
|
|
876
|
+
const tag = value.trim();
|
|
877
|
+
const at = tag.lastIndexOf('@');
|
|
878
|
+
if (at === 0) return undefined;
|
|
879
|
+
|
|
880
|
+
const match = /^(v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.+-]+))?)$/.exec(
|
|
881
|
+
tag.slice(at + 1)
|
|
882
|
+
);
|
|
883
|
+
if (!match) return undefined;
|
|
884
|
+
|
|
885
|
+
return {
|
|
886
|
+
component: at > 0 ? tag.slice(0, at) : undefined,
|
|
887
|
+
version: match[1]!,
|
|
888
|
+
numbers: [Number(match[2]), Number(match[3]), Number(match[4])],
|
|
889
|
+
pre: match[5]
|
|
890
|
+
};
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
/**
|
|
894
|
+
* The version a tag names, without the component in front of it.
|
|
895
|
+
*
|
|
896
|
+
* What a reader sees and what a URL carries: `duxt@v0.4.0` is the name git
|
|
897
|
+
* knows and Content downloads, `v0.4.0` is the release. Anything that is not a
|
|
898
|
+
* version tag comes back unchanged.
|
|
899
|
+
*/
|
|
900
|
+
export const versionTagName = (tag: string): string =>
|
|
901
|
+
parseVersionTag(tag)?.version ?? tag;
|
|
902
|
+
|
|
903
|
+
/**
|
|
904
|
+
* Does a tag belong to `component`?
|
|
905
|
+
*
|
|
906
|
+
* A plain tag always does. In a repository that adopted component tags it is
|
|
907
|
+
* the release history from before the switch — release-please's own migration
|
|
908
|
+
* leaves exactly that — and without it a source restricted to one component
|
|
909
|
+
* would lose every release it already published. Another component's tag
|
|
910
|
+
* never does.
|
|
911
|
+
*/
|
|
912
|
+
export function tagBelongsTo(
|
|
913
|
+
tag: DuxtVersionTag,
|
|
914
|
+
component: string | undefined
|
|
915
|
+
): boolean {
|
|
916
|
+
return !component || !tag.component || tag.component === component;
|
|
917
|
+
}
|
|
918
|
+
|
|
819
919
|
/**
|
|
820
920
|
* Order two version-ish tag names the way a release list is ordered.
|
|
821
921
|
*
|
|
@@ -825,18 +925,8 @@ export function duxtSourceManifest(
|
|
|
825
925
|
* and anything that is not a version at all sorts last so it can never win.
|
|
826
926
|
*/
|
|
827
927
|
export function compareVersionTags(a: string, b: string): number {
|
|
828
|
-
const
|
|
829
|
-
|
|
830
|
-
if (!match) return undefined;
|
|
831
|
-
|
|
832
|
-
return {
|
|
833
|
-
numbers: [Number(match[1]), Number(match[2]), Number(match[3])],
|
|
834
|
-
pre: match[4]
|
|
835
|
-
};
|
|
836
|
-
};
|
|
837
|
-
|
|
838
|
-
const left = parse(a);
|
|
839
|
-
const right = parse(b);
|
|
928
|
+
const left = parseVersionTag(a);
|
|
929
|
+
const right = parseVersionTag(b);
|
|
840
930
|
|
|
841
931
|
if (!left || !right) return left ? -1 : right ? 1 : a.localeCompare(b);
|
|
842
932
|
|
|
@@ -917,9 +1007,9 @@ export function versionRelation(
|
|
|
917
1007
|
if (!version || !preferred) return 'unknown';
|
|
918
1008
|
if (version === preferred) return 'same';
|
|
919
1009
|
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
1010
|
+
if (!parseVersionTag(version) || !parseVersionTag(preferred)) {
|
|
1011
|
+
return 'unknown';
|
|
1012
|
+
}
|
|
923
1013
|
|
|
924
1014
|
const order = compareVersionTags(version, preferred);
|
|
925
1015
|
|
package/content.config.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { fileURLToPath } from 'node:url';
|
|
2
2
|
import { defineContentConfig } from '@nuxt/content';
|
|
3
|
-
import { readDuxtBuildConfig } from './duxt-app-config';
|
|
4
|
-
import { duxtSectionTypes } from './sections-resolve';
|
|
5
|
-
import { duxtGeneratedCollections } from './sections';
|
|
6
|
-
import { duxtSources } from './sources';
|
|
3
|
+
import { readDuxtBuildConfig } from './build/config/duxt-app-config';
|
|
4
|
+
import { duxtSectionTypes } from './build/sections/sections-resolve';
|
|
5
|
+
import { duxtGeneratedCollections } from './build/sections/sections';
|
|
6
|
+
import { duxtSources } from './build/sources/sources';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* The collections, generated from the site's own `app.config.ts`.
|
package/modules/bruno.ts
CHANGED
|
@@ -29,12 +29,18 @@ import {
|
|
|
29
29
|
brunoZipEntries,
|
|
30
30
|
brunoZipName,
|
|
31
31
|
zipStore
|
|
32
|
-
} from '../bruno-zip';
|
|
33
|
-
import { readDuxtBuildConfig } from '../duxt-app-config';
|
|
34
|
-
import {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
} from '../build/bruno/bruno-zip';
|
|
33
|
+
import { readDuxtBuildConfig } from '../build/config/duxt-app-config';
|
|
34
|
+
import {
|
|
35
|
+
duxtManifest,
|
|
36
|
+
duxtSectionTypes
|
|
37
|
+
} from '../build/sections/sections-resolve';
|
|
38
|
+
import {
|
|
39
|
+
diskSectionInput,
|
|
40
|
+
sectionArtefactExists
|
|
41
|
+
} from '../build/sections/section-input';
|
|
42
|
+
import { repositoryRoot } from '../build/sources/repository-root';
|
|
43
|
+
import { resolveLatestRefs } from '../build/sources/sources-git';
|
|
38
44
|
|
|
39
45
|
export default function duxtBruno(_options: unknown, nuxt: Nuxt) {
|
|
40
46
|
const dirs = nuxt.options._layers
|
package/modules/config.ts
CHANGED
|
@@ -3,16 +3,19 @@ import { join } from 'node:path';
|
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
4
|
import type { Nuxt } from '@nuxt/schema';
|
|
5
5
|
import { bundledLanguagesInfo } from 'shiki/langs';
|
|
6
|
-
import { enableWriteAheadLog } from '../content-cache';
|
|
7
|
-
import type { DuxtBuildConfig } from '../duxt-app-config';
|
|
8
|
-
import { readDuxtBuildConfig } from '../duxt-app-config';
|
|
6
|
+
import { enableWriteAheadLog } from '../build/content/content-cache';
|
|
7
|
+
import type { DuxtBuildConfig } from '../build/config/duxt-app-config';
|
|
8
|
+
import { readDuxtBuildConfig } from '../build/config/duxt-app-config';
|
|
9
9
|
import {
|
|
10
10
|
duxtDefaultRequestSamples,
|
|
11
11
|
duxtRequestSamples
|
|
12
12
|
} from '../app/utils/request-samples';
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
import {
|
|
14
|
+
duxtManifest,
|
|
15
|
+
duxtSectionTypes
|
|
16
|
+
} from '../build/sections/sections-resolve';
|
|
17
|
+
import { readSectionReports } from '../build/sections/section-reports';
|
|
18
|
+
import { resolveLatestRefs } from '../build/sources/sources-git';
|
|
16
19
|
|
|
17
20
|
/**
|
|
18
21
|
* The build-time half of duxt's config, read from the site's `app.config.ts`.
|
package/modules/git-meta.ts
CHANGED
|
@@ -2,12 +2,15 @@ import { execFileSync } from 'node:child_process';
|
|
|
2
2
|
import { dirname, relative, sep } from 'node:path';
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
4
|
import type { Nuxt } from '@nuxt/schema';
|
|
5
|
-
import type { DuxtContributor } from '../git-contributors';
|
|
6
|
-
import { contributorsOf } from '../git-contributors';
|
|
7
|
-
import { readDuxtBuildConfig } from '../duxt-app-config';
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
import type { DuxtContributor } from '../build/git/git-contributors';
|
|
6
|
+
import { contributorsOf } from '../build/git/git-contributors';
|
|
7
|
+
import { readDuxtBuildConfig } from '../build/config/duxt-app-config';
|
|
8
|
+
import {
|
|
9
|
+
duxtManifest,
|
|
10
|
+
duxtSectionTypes
|
|
11
|
+
} from '../build/sections/sections-resolve';
|
|
12
|
+
import { resolveLatestRefs } from '../build/sources/sources-git';
|
|
13
|
+
import { normaliseTfplugindocsPage } from '../build/sources/tfplugindocs';
|
|
11
14
|
|
|
12
15
|
/**
|
|
13
16
|
* "Last updated" and the contributor list, from the git history the file
|
package/modules/redirects.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { fileURLToPath } from 'node:url';
|
|
2
2
|
import type { Nuxt } from '@nuxt/schema';
|
|
3
|
-
import { readDuxtBuildConfig } from '../duxt-app-config';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import { readDuxtBuildConfig } from '../build/config/duxt-app-config';
|
|
4
|
+
import {
|
|
5
|
+
duxtManifest,
|
|
6
|
+
duxtSectionTypes
|
|
7
|
+
} from '../build/sections/sections-resolve';
|
|
8
|
+
import { resolveLatestRefs } from '../build/sources/sources-git';
|
|
9
|
+
import { readContentCache } from '../build/content/content-cache';
|
|
7
10
|
|
|
8
11
|
/**
|
|
9
12
|
* `redirectFrom` in a page's frontmatter, turned into route rules.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Nuxt } from '@nuxt/schema';
|
|
2
|
-
import { readContentCache } from '../content-cache';
|
|
3
|
-
import { duxtSearchRecords } from '../search-records';
|
|
4
|
-
import type { DuxtSearchRecordOptions } from '../search-records';
|
|
5
|
-
import type { DuxtResolvedSource } from '../sources-resolve';
|
|
2
|
+
import { readContentCache } from '../build/content/content-cache';
|
|
3
|
+
import { duxtSearchRecords } from '../build/search/search-records';
|
|
4
|
+
import type { DuxtSearchRecordOptions } from '../build/search/search-records';
|
|
5
|
+
import type { DuxtResolvedSource } from '../build/sources/sources-resolve';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* duxt's one build-time extension point, and the whole of it.
|
package/modules/validate.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { fileURLToPath } from 'node:url';
|
|
2
2
|
import type { Nuxt } from '@nuxt/schema';
|
|
3
|
-
import { readDuxtBuildConfig } from '../duxt-app-config';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import {
|
|
3
|
+
import { readDuxtBuildConfig } from '../build/config/duxt-app-config';
|
|
4
|
+
import {
|
|
5
|
+
duxtManifest,
|
|
6
|
+
duxtSectionTypes
|
|
7
|
+
} from '../build/sections/sections-resolve';
|
|
8
|
+
import { resolveLatestRefs } from '../build/sources/sources-git';
|
|
9
|
+
import { readContentCache } from '../build/content/content-cache';
|
|
10
|
+
import type { Collected, PageRecord } from '../build/cli/validate-report';
|
|
11
|
+
import { report, walk } from '../build/cli/validate-report';
|
|
9
12
|
|
|
10
13
|
/**
|
|
11
14
|
* Catch the silent failures.
|
package/nuxt.config.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { dirname, join } from 'node:path';
|
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
4
|
import { defineNuxtConfig } from 'nuxt/config';
|
|
5
5
|
import tailwindcss from '@tailwindcss/vite';
|
|
6
|
-
import { highlightLangs } from './highlight-langs';
|
|
6
|
+
import { highlightLangs } from './build/content/highlight-langs';
|
|
7
7
|
|
|
8
8
|
/** Resolve against this layer, not the project extending it. */
|
|
9
9
|
const layer = (path: string) => fileURLToPath(new URL(path, import.meta.url));
|