Skip to content

Commit b88efd8

Browse files
Update from Copier (2026-08-14T19-11-14Z)
Signed-off-by: python-templates-copier-update[bot] <python-templates-copier-update[bot]@users.noreply.github.com>
1 parent 252ad61 commit b88efd8

12 files changed

Lines changed: 103 additions & 82 deletions

File tree

.copier-answers.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changes here will be overwritten by Copier
2-
_commit: 84508d6
2+
_commit: ebda788
33
_src_path: https://github.com/python-project-templates/base.git
44
add_docs: true
55
add_extension: cppjswasm

.vscode/settings.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/wiki/contribute/Build-from-Source.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ make build
7171
| Python | `ruff` | `ruff` | Style |
7272
| Python | `ruff` | `ruff` | Imports |
7373
| C++ | `clang-format` | `clang-format` | Style |
74-
| JavaScript | `prettier` | `prettier` | Style |
74+
| JavaScript | `oxlint` | `oxfmt` | Style |
7575
| Markdown | `mdformat` | `mdformat` | Style |
7676
| Markdown | `codespell` | | Spelling |
7777

js/.oxfmtrc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"$schema": "./node_modules/oxfmt/configuration_schema.json",
3+
"printWidth": 80,
4+
"sortPackageJson": false
5+
}

js/.oxlintrc.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
"env": {
4+
"browser": true,
5+
"es6": true,
6+
"node": true
7+
},
8+
"rules": {
9+
"unicorn/no-empty-file": "off"
10+
}
11+
}

js/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@
3232
"build": "npm-run-all build:cpp build:prod",
3333
"clean": "rm -rf dist lib playwright-report ../python_template_cppjswasm/extension",
3434
"dev": "npm-run-all -p start watch",
35-
"lint:js": "prettier --check \"src/**/*.{js,ts,jsx,tsx,css}\" \"tests/**/*.{js,ts,jsx,tsx}\" \"*.mjs\" \"*.json\"",
35+
"lint:js": "oxlint . && oxfmt --check \"src/**/*.{js,ts,jsx,tsx,css}\" \"tests/**/*.{js,ts,jsx,tsx}\" \"*.mjs\" \"*.json\"",
3636
"lint:cpp": "clang-format --dry-run -Werror -style=file:../.clang-format src/cpp/*.cpp",
3737
"lint": "npm-run-all lint:*",
38-
"fix:js": "prettier --write \"src/**/*.{js,ts,jsx,tsx,css}\" \"tests/**/*.{js,ts,jsx,tsx}\" \"*.mjs\" \"*.json\"",
38+
"fix:js": "oxlint --fix . && oxfmt --write \"src/**/*.{js,ts,jsx,tsx,css}\" \"tests/**/*.{js,ts,jsx,tsx}\" \"*.mjs\" \"*.json\"",
3939
"fix:cpp": "clang-format -i -style=file:../.clang-format src/cpp/*.cpp",
4040
"fix": "npm-run-all fix:*",
4141
"preinstall": "npx only-allow pnpm",
@@ -55,7 +55,8 @@
5555
"http-server": "^14.1.1",
5656
"nodemon": "^3.1.10",
5757
"npm-run-all": "^4.1.5",
58-
"prettier": "^3.9.6",
58+
"oxfmt": "^0.63.0",
59+
"oxlint": "^1.78.0",
5960
"typescript": "^7.0.2"
6061
}
6162
}

js/tests/index.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { test, expect } from "@playwright/test";
22

33
test.describe("Basics", () => {
4-
test("basic", async ({ page }) => {
4+
test("basic", async () => {
55
await expect("").toBe("");
66
});
77
});

js/tools/bundle.mjs

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -11,49 +11,49 @@ const COMMON_DEFINE = {
1111
};
1212

1313
const COMMON_LOADER = {
14-
".css": "text",
15-
".html": "text",
16-
".jsx": "jsx",
17-
".png": "file",
18-
".ttf": "file",
19-
".wasm": "file",
14+
".css": "text",
15+
".html": "text",
16+
".jsx": "jsx",
17+
".png": "file",
18+
".ttf": "file",
19+
".wasm": "file",
2020
};
2121

2222
const DEFAULT_BUILD = {
23-
target: ["es2022"],
24-
bundle: true,
25-
format: "esm",
26-
minify: DEBUG,
27-
sourcemap: true,
28-
metafile: true,
29-
entryNames: "[name]",
30-
chunkNames: "[name]",
31-
assetNames: "[name]",
32-
define: COMMON_DEFINE,
33-
loader: COMMON_LOADER,
34-
plugins: [],
23+
target: ["es2022"],
24+
bundle: true,
25+
format: "esm",
26+
minify: DEBUG,
27+
sourcemap: true,
28+
metafile: true,
29+
entryNames: "[name]",
30+
chunkNames: "[name]",
31+
assetNames: "[name]",
32+
define: COMMON_DEFINE,
33+
loader: COMMON_LOADER,
34+
plugins: [],
3535
};
3636

3737
export const bundle = async (config) => {
38-
const result = await esbuild.build({
39-
...DEFAULT_BUILD,
40-
...config,
41-
});
42-
43-
if (result.metafile) {
44-
for (const output of Object.keys(result.metafile.outputs)) {
45-
const { inputs, bytes } = result.metafile.outputs[output];
46-
for (const input of Object.keys(inputs)) {
47-
if (inputs[input].bytesInOutput / bytes < CUTOFF_PERCENT) {
48-
delete inputs[input];
49-
}
50-
}
38+
const result = await esbuild.build({
39+
...DEFAULT_BUILD,
40+
...config,
41+
});
42+
43+
if (result.metafile) {
44+
for (const output of Object.keys(result.metafile.outputs)) {
45+
const { inputs, bytes } = result.metafile.outputs[output];
46+
for (const input of Object.keys(inputs)) {
47+
if (inputs[input].bytesInOutput / bytes < CUTOFF_PERCENT) {
48+
delete inputs[input];
5149
}
50+
}
51+
}
5252

53-
const text = await esbuild.analyzeMetafile(result.metafile, {
54-
color: true,
55-
});
53+
const text = await esbuild.analyzeMetafile(result.metafile, {
54+
color: true,
55+
});
5656

57-
console.log(text);
58-
}
57+
console.log(text);
58+
}
5959
};

js/tools/css.mjs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ const bundle_one = async (file, resolver) => {
3939
fs.writeFileSync(path.join("./dist/css", outName), code);
4040
};
4141

42-
export const bundle_css = async (root = "src/css/index.css", resolver = null) => {
42+
export const bundle_css = async (
43+
root = "src/css/index.css",
44+
resolver = null,
45+
) => {
4346
const resolved = path.resolve(root);
4447
if (fs.statSync(resolved).isDirectory()) {
4548
const files = fs.readdirSync(resolved).filter((f) => f.endsWith(".css"));
@@ -49,4 +52,4 @@ export const bundle_css = async (root = "src/css/index.css", resolver = null) =>
4952
} else {
5053
await bundle_one(root, resolver);
5154
}
52-
}
55+
};

js/tools/externals.mjs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
export const node_modules_external = (whitelist) => {
2-
function setup(build) {
3-
build.onResolve({ filter: /^[A-Za-z0-9\@]/ }, (args) => {
4-
if (!whitelist || !args.path.startsWith(whitelist)) {
5-
return {
6-
path: args.path,
7-
external: true,
8-
namespace: "skip-node-modules",
9-
};
10-
}
11-
});
12-
}
2+
function setup(build) {
3+
build.onResolve({ filter: /^[A-Za-z0-9@]/ }, (args) => {
4+
if (!whitelist || !args.path.startsWith(whitelist)) {
5+
return {
6+
path: args.path,
7+
external: true,
8+
namespace: "skip-node-modules",
9+
};
10+
}
11+
});
12+
}
1313

14-
return {
15-
name: "node_modules_external",
16-
setup,
17-
};
14+
return {
15+
name: "node_modules_external",
16+
setup,
17+
};
1818
};

0 commit comments

Comments
 (0)