Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions mise.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pnpm = "11.9.0"
vale = "3.15.1"
go = "1.26.4"
git-lfs = "3.7.1"
hugo = "0.152.2"

[tasks.clean]
run = [
Expand Down
530 changes: 0 additions & 530 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ allowBuilds:
'@parcel/watcher': true
bun: true
esbuild: true
hugo-bin: true
lmdb: true
msgpackr-extract: true
rs-module-lexer: true
Expand Down
2 changes: 1 addition & 1 deletion projects/internals/BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ The following are the repo wide tools that apply to all source code and projects

- [mise](https://mise.en.dev/)

mise installs and activates the repository toolchain from `mise.toml`, including Node.js, pnpm, Vale, Go, and Git LFS. CI uses the same manifest through the shared setup action.
mise installs and activates the repository toolchain from `mise.toml`, including Node.js, pnpm, Vale, Go, Git LFS, and Hugo. CI uses the same manifest through the shared setup action.

- [pnpm Package Manager](https://pnpm.io/)

Expand Down
2 changes: 1 addition & 1 deletion projects/internals/ci/ci-validate.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { readFileSync } from 'node:fs';

const read = path => readFileSync(path, 'utf-8');
const requiredTools = ['node', 'pnpm', 'vale', 'go', 'git-lfs'];
const requiredTools = ['node', 'pnpm', 'vale', 'go', 'git-lfs', 'hugo'];
const packageJson = JSON.parse(read('package.json'));
const toolsTable = read('mise.toml').match(/^\[tools]\n([\s\S]*?)(?=^\[|(?![\s\S]))/m)?.[1] ?? '';
const tools = Object.fromEntries(
Expand Down
39 changes: 39 additions & 0 deletions projects/internals/tools/src/project/starters.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,45 @@ describe('removeWireitScripts', () => {
expect(result.wireit).toBeUndefined();
});

it('should remove mise from exported wireit scripts', () => {
const packageJson = {
scripts: {
build: 'wireit',
dev: 'wireit'
},
wireit: {
build: {
command: 'mise exec -- hugo'
},
dev: {
command: 'mise exec -- hugo server'
}
}
};
const result = removeWireitScripts(packageJson);

expect(result.scripts.build).toBe('hugo');
expect(result.scripts.dev).toBe('hugo server');
expect(result.wireit).toBeUndefined();
});

it('should remove exported wireit scripts without commands', () => {
const packageJson = {
scripts: {
ci: 'wireit'
},
wireit: {
ci: {
dependencies: ['build']
}
}
};
const result = removeWireitScripts(packageJson);

expect(result.scripts.ci).toBeUndefined();
expect(result.wireit).toBeUndefined();
});

it('should handle package.json with mixed wireit and regular scripts', () => {
const packageJson = {
scripts: {
Expand Down
16 changes: 13 additions & 3 deletions projects/internals/tools/src/project/starters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,19 +245,29 @@ async function exportPackageFromWorkspace(projectDir: string) {
const manifest = await readProjectManifestOnly(projectDir);
let exportable = await createExportableManifest(projectDir, manifest, { catalogs });
exportable = removeWireitScripts(
exportable as unknown as { scripts: Record<string, string>; wireit?: Record<string, { command: string }> }
exportable as unknown as {
scripts: Record<string, string>;
wireit?: Record<string, { command?: string }>;
}
);
return exportable;
}

export function removeWireitScripts(exportable: {
scripts: Record<string, string>;
wireit?: Record<string, { command: string }>;
wireit?: Record<string, { command?: string }>;
}) {
Object.keys(exportable.scripts)
.filter(key => exportable.scripts[key] === 'wireit' && exportable.wireit?.[key])
.forEach(key => {
exportable.scripts[key] = exportable.wireit![key]!.command;
const command = exportable.wireit![key]!.command;
if (!command) {
exportable.scripts = Object.fromEntries(
Object.entries(exportable.scripts).filter(([script]) => script !== key)
);
return;
}
exportable.scripts[key] = command.replace(/^mise exec -- /, '');

const scriptValue = exportable.scripts[key];
if (scriptValue && scriptValue.match(/playwright-lock '(.*?)'/g)) {
Expand Down
2 changes: 1 addition & 1 deletion projects/starters/hugo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This starter uses Hugo templates with the prebuilt JavaScript and CSS bundles fr

## Getting started

Install the package dependencies to use the starter's pinned Hugo binary:
Install Hugo before installing the package dependencies. At the Elements repository root, `mise install` installs the pinned version from `mise.toml`. If you downloaded this starter, follow the [Hugo installation guide](https://gohugo.io/installation/).

```shell
npm install
Expand Down
13 changes: 4 additions & 9 deletions projects/starters/hugo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,14 @@
"@nvidia-elements/themes": "workspace:*",
"@nvidia-elements/code": "workspace:*"
},
"devDependencies": {
"hugo-bin": "0.149.2"
},
"hugo-bin": {
"version": "0.152.2"
},
"wireit": {
"ci": {
"dependencies": [
"build"
]
},
"build": {
"command": "hugo --baseURL \"${PAGES_BASE_URL:-/}\"",
"command": "mise exec -- hugo --baseURL \"${PAGES_BASE_URL:-/}\"",
"files": [
"../../core/dist/**/*.js",
"../../styles/dist/**/*.css",
Expand All @@ -37,7 +31,8 @@
"content/**",
"layouts/**",
"static/**",
"hugo.toml"
"hugo.toml",
"../../../mise.toml"
],
"output": [
"dist/**"
Expand Down Expand Up @@ -68,7 +63,7 @@
}
},
"dev": {
"command": "hugo server",
"command": "mise exec -- hugo server",
"service": true
}
}
Expand Down