From 7f8352222bb60b5026d632e24fba1222ea80062b Mon Sep 17 00:00:00 2001 From: Jiahan Chen Date: Wed, 12 Aug 2026 17:10:35 +0800 Subject: [PATCH 01/11] refactor(cli): centralize command help (#331) --- packages/rstack/src/cli/commandHelp.ts | 477 ++++++++++++++++++++++++ packages/rstack/src/cli/commands.ts | 485 ++----------------------- packages/rstack/src/cli/help.ts | 61 +--- packages/rstack/src/fmt/cli.ts | 31 +- packages/rstack/src/setup/index.ts | 21 +- packages/rstack/src/staged.ts | 33 +- 6 files changed, 514 insertions(+), 594 deletions(-) create mode 100644 packages/rstack/src/cli/commandHelp.ts diff --git a/packages/rstack/src/cli/commandHelp.ts b/packages/rstack/src/cli/commandHelp.ts new file mode 100644 index 00000000..87ebab93 --- /dev/null +++ b/packages/rstack/src/cli/commandHelp.ts @@ -0,0 +1,477 @@ +import { color } from 'rslog'; + +declare global { + const RSTACK_VERSION: string; +} + +type HelpItem = readonly [label: string, description: string]; + +type HelpSection = + | { + title: string; + items: readonly HelpItem[]; + } + | { + content: string; + dim?: boolean; + }; + +type HelpDefinition = { + usage: string; + description?: string; + sections?: readonly HelpSection[]; +}; + +export type HelpTopic = + | 'root' + | 'check' + | 'dev' + | 'build' + | 'preview' + | 'doc' + | 'doc build' + | 'doc preview' + | 'doc eject' + | 'test' + | 'test run' + | 'test watch' + | 'test list' + | 'test merge-reports' + | 'test init' + | 'lib' + | 'lib build' + | 'lib inspect' + | 'lib mf-dev' + | 'lint' + | 'fmt' + | 'staged' + | 'setup'; + +const CONFIG_OPTION: HelpItem = ['-c, --config ', 'Specify Rstack config file path']; +const HELP_OPTION: HelpItem = ['-h, --help', 'Display this help message']; +const VERSION_OPTION: HelpItem = ['-v, --version', 'Display version number']; +const CONFIG_HELP_OPTIONS = [CONFIG_OPTION, HELP_OPTION]; + +const OPEN_OPTION: HelpItem = ['-o, --open [url]', 'Open the page in browser on startup']; +const PORT_OPTION: HelpItem = ['--port ', 'Set the port number for the server']; +const STRICT_PORT_OPTION: HelpItem = [ + '--strict-port', + 'Exit if the specified port is already in use', +]; +const HOST_OPTION: HelpItem = ['--host [host]', 'Set the host that the server listens to']; +const BASE_OPTION: HelpItem = ['--base ', 'Set the base path and override config.base']; +const SERVER_OPTIONS = [OPEN_OPTION, PORT_OPTION, STRICT_PORT_OPTION, HOST_OPTION]; + +const TEST_UPDATE_OPTION: HelpItem = ['-u, --update', 'Update snapshot files']; +const TEST_COVERAGE_OPTION: HelpItem = ['--coverage', 'Enable code coverage']; +const TEST_PROJECT_OPTION: HelpItem = ['--project ', 'Filter test projects by name']; +const TEST_NAME_OPTION: HelpItem = [ + '-t, --test-name-pattern ', + 'Run tests with names matching the pattern', +]; +const TEST_OPTIONS = [ + TEST_UPDATE_OPTION, + TEST_COVERAGE_OPTION, + TEST_PROJECT_OPTION, + TEST_NAME_OPTION, +]; + +const LIB_WATCH_OPTION: HelpItem = ['-w, --watch', 'Enable watch mode and rebuild on changes']; +const LIB_DTS_OPTION: HelpItem = ['--dts', 'Emit declaration files (use --no-dts to disable)']; +const LIB_BUILD_OPTIONS = [LIB_WATCH_OPTION, LIB_DTS_OPTION]; + +const commandHint = (command: string): HelpSection => ({ + content: `For command-specific options, run: + $ rs ${command} -h`, + dim: true, +}); + +const HELP_DEFINITIONS = { + root: { + usage: 'rs [command] [options]', + sections: [ + { + title: 'Commands', + items: [ + ['dev', 'Run the app dev server'], + ['build', 'Build the app for production'], + ['preview', 'Preview the app production build'], + ['lib', 'Build library'], + ['doc', 'Serve or build docs'], + ['fmt, format', 'Format code'], + ['lint', 'Lint code'], + ['check', 'Run static checks, including lint and format'], + ['test', 'Run tests'], + ['staged', 'Run tasks on staged Git files'], + ['setup', 'Install Git hooks'], + ], + }, + { + content: `For command-specific options, run: + $ rs -h`, + dim: true, + }, + { + title: 'Options', + items: [CONFIG_OPTION, HELP_OPTION, VERSION_OPTION], + }, + ], + }, + check: { + usage: 'rs check [options]', + description: 'Run static checks, including lint and format', + sections: [ + { + title: 'Options', + items: [['--type-check', 'Enable TypeScript type checking'], ...CONFIG_HELP_OPTIONS], + }, + ], + }, + dev: { + usage: 'rs dev [options]', + description: 'Run the app dev server', + sections: [ + { + title: 'Options', + items: [...SERVER_OPTIONS, ...CONFIG_HELP_OPTIONS], + }, + ], + }, + build: { + usage: 'rs build [options]', + description: 'Build the app for production', + sections: [ + { + title: 'Options', + items: [ + ['-w, --watch', 'Enable watch mode to automatically rebuild on file changes'], + ['--dist-path ', 'Set the root directory of output files'], + ['--source-map', 'Enable source map'], + ...CONFIG_HELP_OPTIONS, + ], + }, + ], + }, + preview: { + usage: 'rs preview [options]', + description: 'Preview the app production build', + sections: [ + { + title: 'Options', + items: [...SERVER_OPTIONS, ...CONFIG_HELP_OPTIONS], + }, + ], + }, + doc: { + usage: 'rs doc [command] [root] [options]', + sections: [ + { + title: 'Commands', + items: [ + ['[root]', 'Run the docs dev server (default)'], + ['build [root]', 'Build docs for production'], + ['preview [root]', 'Preview the docs production build'], + ['eject [component]', 'Eject a theme component'], + ], + }, + commandHint('doc'), + { + title: 'Options', + items: [PORT_OPTION, HOST_OPTION, BASE_OPTION, ...CONFIG_HELP_OPTIONS], + }, + ], + }, + 'doc build': { + usage: 'rs doc build [root] [options]', + description: 'Build docs for production', + sections: [ + { + title: 'Options', + items: [BASE_OPTION, ...CONFIG_HELP_OPTIONS], + }, + ], + }, + 'doc preview': { + usage: 'rs doc preview [root] [options]', + description: 'Preview the docs production build', + sections: [ + { + title: 'Options', + items: [PORT_OPTION, HOST_OPTION, BASE_OPTION, ...CONFIG_HELP_OPTIONS], + }, + ], + }, + 'doc eject': { + usage: 'rs doc eject [component] [options]', + description: 'Eject a theme component', + sections: [ + { + title: 'Options', + items: [HELP_OPTION], + }, + ], + }, + test: { + usage: 'rs test [command] [...filters] [options]', + sections: [ + { + title: 'Commands', + items: [ + ['[...filters]', 'Run tests (default)'], + ['run [...filters]', 'Run tests once'], + ['watch [...filters]', 'Run tests in watch mode'], + ['list [...filters]', 'List matching tests'], + ['merge-reports [path]', 'Merge blob reports'], + ['init [project]', 'Initialize Rstest configuration'], + ], + }, + commandHint('test'), + { + title: 'Options', + items: [['-w, --watch', 'Enable watch mode'], ...TEST_OPTIONS, ...CONFIG_HELP_OPTIONS], + }, + ], + }, + 'test run': { + usage: 'rs test run [...filters] [options]', + description: 'Run tests once', + sections: [ + { + title: 'Options', + items: [ + ['--related', 'Run tests related to source files'], + ['--changed [commit]', 'Run tests related to changed files'], + ['--shard ', 'Split tests into shards'], + ...TEST_OPTIONS, + ...CONFIG_HELP_OPTIONS, + ], + }, + ], + }, + 'test watch': { + usage: 'rs test watch [...filters] [options]', + description: 'Run tests in watch mode', + sections: [ + { + title: 'Options', + items: [...TEST_OPTIONS, ...CONFIG_HELP_OPTIONS], + }, + ], + }, + 'test list': { + usage: 'rs test list [...filters] [options]', + description: 'List matching tests', + sections: [ + { + title: 'Options', + items: [ + ['--related', 'List tests related to source files'], + ['--changed [commit]', 'List tests related to changed files'], + ['--files-only', 'List matching test files only'], + ['--json [path]', 'Print JSON or write it to a file'], + ['--include-suites', 'Include test suites'], + ['--print-location', 'Print test locations'], + ['--summary', 'Print a summary'], + TEST_PROJECT_OPTION, + ['-t, --test-name-pattern ', 'List tests with names matching the pattern'], + ...CONFIG_HELP_OPTIONS, + ], + }, + ], + }, + 'test merge-reports': { + usage: 'rs test merge-reports [path] [options]', + description: 'Merge blob reports', + sections: [ + { + title: 'Options', + items: [ + ['--coverage', 'Generate coverage reports'], + ['--reporters, --reporter ', 'Specify test reporters'], + ['--cleanup', 'Remove blob reports after merging'], + ...CONFIG_HELP_OPTIONS, + ], + }, + ], + }, + 'test init': { + usage: 'rs test init [project] [options]', + description: 'Initialize Rstest configuration', + sections: [ + { + title: 'Options', + items: [['--yes', 'Use default options without prompts'], HELP_OPTION], + }, + ], + }, + lib: { + usage: 'rs lib [command] [options]', + sections: [ + { + title: 'Commands', + items: [ + ['build', 'Build the library for production (default)'], + ['inspect', 'Inspect Rslib, Rsbuild, and Rspack configs'], + ['mf-dev', 'Start Rsbuild dev server for Module Federation'], + ], + }, + commandHint('lib'), + { + title: 'Options', + items: [...LIB_BUILD_OPTIONS, ...CONFIG_HELP_OPTIONS], + }, + ], + }, + 'lib build': { + usage: 'rs lib build [options]', + description: 'Build the library for production', + sections: [ + { + title: 'Options', + items: [...LIB_BUILD_OPTIONS, ...CONFIG_HELP_OPTIONS], + }, + ], + }, + 'lib inspect': { + usage: 'rs lib inspect [options]', + description: 'Inspect Rslib, Rsbuild, and Rspack configs', + sections: [ + { + title: 'Options', + items: [ + ['--output ', 'Set the output path for inspection results (default: .rsbuild)'], + ['--verbose', 'Show complete function definitions in output'], + ...CONFIG_HELP_OPTIONS, + ], + }, + ], + }, + 'lib mf-dev': { + usage: 'rs lib mf-dev [options]', + description: 'Start Rsbuild dev server for Module Federation', + sections: [ + { + title: 'Options', + items: [...CONFIG_HELP_OPTIONS], + }, + ], + }, + lint: { + usage: 'rs lint [options] [files...]', + description: 'Lint code', + sections: [ + { + title: 'Options', + items: [ + ['--fix', 'Automatically fix problems'], + ['--type-check', 'Enable TypeScript type checking'], + ['--type-check-only', 'Run only TypeScript type checking'], + ['--format ', 'Set output format (default | jsonline | github | gitlab)'], + ['--quiet', 'Report errors only'], + ['--timing [all|N]', 'Print a per-rule timing table (all rules or top N)'], + ['--max-warnings ', 'Set the maximum number of warnings'], + ['--rule ', 'Override a rule (repeatable)'], + ['--no-color', 'Disable colored output'], + ['--force-color', 'Force colored output'], + ...CONFIG_HELP_OPTIONS, + ], + }, + ], + }, + fmt: { + usage: 'rs fmt [options] [files/globs...]', + description: 'Format code', + sections: [ + { + title: 'Options', + items: [ + ['-w, --write', 'Write formatted files in place (default)'], + ['--check', 'Check whether files are formatted'], + ['-l, --list-different', 'Print paths of unformatted files'], + ['--ignore-path ', 'Path to an additional ignore file (repeatable)'], + ['-u, --ignore-unknown', 'Ignore unknown files'], + ['--no-cache', 'Disable the formatting cache'], + ['--cache-location ', 'Path to the formatting cache directory'], + ['--no-error-on-unmatched-pattern', 'Do not error when no files match'], + ['--with-node-modules', 'Process files inside node_modules'], + ['--parallel-workers ', 'Number of parallel workers'], + ['--stdin-filepath ', 'Format stdin as if it were saved at '], + ['--lsp', 'Run a language server on stdio'], + ...CONFIG_HELP_OPTIONS, + ], + }, + ], + }, + staged: { + usage: 'rs staged [options]', + description: 'Run tasks on staged Git files', + sections: [ + { + title: 'Options', + items: [ + ['--allow-empty', 'Allow empty commits when tasks revert all staged changes'], + [ + '-p, --concurrent ', + 'The number of tasks to run concurrently, or false for serial', + ], + ['--cwd ', 'Working directory to run all tasks in'], + ['-d, --debug', 'Print additional debug information'], + ['--no-stash', 'Disable backup stash and automatic revert'], + ['-q, --quiet', "Disable lint-staged's own console output"], + ['-r, --relative', 'Pass relative filepaths to tasks'], + [ + '-v, --verbose', + 'Show task output even when tasks succeed; by default only failed output is shown', + ], + ...CONFIG_HELP_OPTIONS, + ], + }, + ], + }, + setup: { + usage: 'rs setup [options]', + description: 'Install Git hooks in the current repository', + sections: [ + { + title: 'Options', + items: [ + ['--hooks-dir ', 'Specify hooks directory relative to the Git repository root'], + HELP_OPTION, + ], + }, + ], + }, +} satisfies Record; + +const renderItems = (items: readonly HelpItem[]): string => { + const labelWidth = items.reduce((width, [label]) => Math.max(width, label.length), 0); + + return items + .map(([label, description]) => ` ${label.padEnd(labelWidth)} ${description}`) + .join('\n'); +}; + +const renderSection = (section: HelpSection): string => { + if ('items' in section) { + return `${color.cyan(section.title)}:\n${renderItems(section.items)}`; + } + + return section.dim ? color.dim(section.content) : section.content; +}; + +const renderHelp = ({ usage, description, sections = [] }: HelpDefinition): string => { + const blocks = [ + color.bold(`Rstack v${RSTACK_VERSION}`), + `${color.cyan('Usage')}:\n${color.yellow(` $ ${usage}`)}`, + ]; + + if (description) { + blocks.push(description); + } + + blocks.push(...sections.map(renderSection)); + + return blocks.join('\n\n'); +}; + +export const renderCommandHelp = (topic: HelpTopic): string => renderHelp(HELP_DEFINITIONS[topic]); diff --git a/packages/rstack/src/cli/commands.ts b/packages/rstack/src/cli/commands.ts index e6708d92..07ed732e 100644 --- a/packages/rstack/src/cli/commands.ts +++ b/packages/rstack/src/cli/commands.ts @@ -1,441 +1,17 @@ import { join, resolve } from 'node:path'; import { getConfigState } from '../config.ts'; import { insertConfigArg, parseArgs, parseCliArgs } from './args.ts'; -import { hasHelpFlag, renderHelp } from './help.ts'; - -const renderRootHelp = (): string => - renderHelp({ - usage: 'rs [command] [options]', - sections: [ - { - title: 'Commands', - items: [ - ['dev', 'Run the app dev server'], - ['build', 'Build the app for production'], - ['preview', 'Preview the app production build'], - ['lib', 'Build library'], - ['doc', 'Serve or build docs'], - ['fmt, format', 'Format code'], - ['lint', 'Lint code'], - ['check', 'Run static checks, including lint and format'], - ['test', 'Run tests'], - ['staged', 'Run tasks on staged Git files'], - ['setup', 'Install Git hooks'], - ], - }, - { - content: `For command-specific options, run: - $ rs -h`, - dim: true, - }, - { - title: 'Options', - items: [ - ['-c, --config ', 'Specify Rstack config file path'], - ['-h, --help', 'Display this help message'], - ['-v, --version', 'Display version number'], - ], - }, - ], - }); - -const renderCheckHelp = (): string => - renderHelp({ - usage: 'rs check [options]', - description: 'Run static checks, including lint and format', - sections: [ - { - title: 'Options', - items: [ - ['--type-check', 'Enable TypeScript type checking'], - ['-c, --config ', 'Specify Rstack config file path'], - ['-h, --help', 'Display this help message'], - ], - }, - ], - }); - -const renderDevHelp = (): string => - renderHelp({ - usage: 'rs dev [options]', - description: 'Run the app dev server', - sections: [ - { - title: 'Options', - items: [ - ['-o, --open [url]', 'Open the page in browser on startup'], - ['--port ', 'Set the port number for the server'], - ['--strict-port', 'Exit if the specified port is already in use'], - ['--host [host]', 'Set the host that the server listens to'], - ['-c, --config ', 'Specify Rstack config file path'], - ['-h, --help', 'Display this help message'], - ], - }, - ], - }); - -const renderBuildHelp = (): string => - renderHelp({ - usage: 'rs build [options]', - description: 'Build the app for production', - sections: [ - { - title: 'Options', - items: [ - ['-w, --watch', 'Enable watch mode to automatically rebuild on file changes'], - ['--dist-path ', 'Set the root directory of output files'], - ['--source-map', 'Enable source map'], - ['-c, --config ', 'Specify Rstack config file path'], - ['-h, --help', 'Display this help message'], - ], - }, - ], - }); - -const renderPreviewHelp = (): string => - renderHelp({ - usage: 'rs preview [options]', - description: 'Preview the app production build', - sections: [ - { - title: 'Options', - items: [ - ['-o, --open [url]', 'Open the page in browser on startup'], - ['--port ', 'Set the port number for the server'], - ['--strict-port', 'Exit if the specified port is already in use'], - ['--host [host]', 'Set the host that the server listens to'], - ['-c, --config ', 'Specify Rstack config file path'], - ['-h, --help', 'Display this help message'], - ], - }, - ], - }); - -const renderDocHelp = (): string => - renderHelp({ - usage: 'rs doc [command] [root] [options]', - sections: [ - { - title: 'Commands', - items: [ - ['[root]', 'Run the docs dev server (default)'], - ['build [root]', 'Build docs for production'], - ['preview [root]', 'Preview the docs production build'], - ['eject [component]', 'Eject a theme component'], - ], - }, - { - content: `For command-specific options, run: - $ rs doc -h`, - dim: true, - }, - { - title: 'Options', - items: [ - ['--port ', 'Set the port number for the server'], - ['--host [host]', 'Set the host that the server listens to'], - ['--base ', 'Set the base path and override config.base'], - ['-c, --config ', 'Specify Rstack config file path'], - ['-h, --help', 'Display this help message'], - ], - }, - ], - }); - -const renderDocBuildHelp = (): string => - renderHelp({ - usage: 'rs doc build [root] [options]', - description: 'Build docs for production', - sections: [ - { - title: 'Options', - items: [ - ['--base ', 'Set the base path and override config.base'], - ['-c, --config ', 'Specify Rstack config file path'], - ['-h, --help', 'Display this help message'], - ], - }, - ], - }); - -const renderDocPreviewHelp = (): string => - renderHelp({ - usage: 'rs doc preview [root] [options]', - description: 'Preview the docs production build', - sections: [ - { - title: 'Options', - items: [ - ['--port ', 'Set the port number for the server'], - ['--host [host]', 'Set the host that the server listens to'], - ['--base ', 'Set the base path and override config.base'], - ['-c, --config ', 'Specify Rstack config file path'], - ['-h, --help', 'Display this help message'], - ], - }, - ], - }); - -const renderDocEjectHelp = (): string => - renderHelp({ - usage: 'rs doc eject [component] [options]', - description: 'Eject a theme component', - sections: [ - { - title: 'Options', - items: [['-h, --help', 'Display this help message']], - }, - ], - }); - -const renderTestHelp = (): string => - renderHelp({ - usage: 'rs test [command] [...filters] [options]', - sections: [ - { - title: 'Commands', - items: [ - ['[...filters]', 'Run tests (default)'], - ['run [...filters]', 'Run tests once'], - ['watch [...filters]', 'Run tests in watch mode'], - ['list [...filters]', 'List matching tests'], - ['merge-reports [path]', 'Merge blob reports'], - ['init [project]', 'Initialize Rstest configuration'], - ], - }, - { - content: `For command-specific options, run: - $ rs test -h`, - dim: true, - }, - { - title: 'Options', - items: [ - ['-w, --watch', 'Enable watch mode'], - ['-u, --update', 'Update snapshot files'], - ['--coverage', 'Enable code coverage'], - ['--project ', 'Filter test projects by name'], - ['-t, --test-name-pattern ', 'Run tests with names matching the pattern'], - ['-c, --config ', 'Specify Rstack config file path'], - ['-h, --help', 'Display this help message'], - ], - }, - ], - }); - -const renderTestRunHelp = (): string => - renderHelp({ - usage: 'rs test run [...filters] [options]', - description: 'Run tests once', - sections: [ - { - title: 'Options', - items: [ - ['--related', 'Run tests related to source files'], - ['--changed [commit]', 'Run tests related to changed files'], - ['--shard ', 'Split tests into shards'], - ['-u, --update', 'Update snapshot files'], - ['--coverage', 'Enable code coverage'], - ['--project ', 'Filter test projects by name'], - ['-t, --test-name-pattern ', 'Run tests with names matching the pattern'], - ['-c, --config ', 'Specify Rstack config file path'], - ['-h, --help', 'Display this help message'], - ], - }, - ], - }); - -const renderTestWatchHelp = (): string => - renderHelp({ - usage: 'rs test watch [...filters] [options]', - description: 'Run tests in watch mode', - sections: [ - { - title: 'Options', - items: [ - ['-u, --update', 'Update snapshot files'], - ['--coverage', 'Enable code coverage'], - ['--project ', 'Filter test projects by name'], - ['-t, --test-name-pattern ', 'Run tests with names matching the pattern'], - ['-c, --config ', 'Specify Rstack config file path'], - ['-h, --help', 'Display this help message'], - ], - }, - ], - }); - -const renderTestListHelp = (): string => - renderHelp({ - usage: 'rs test list [...filters] [options]', - description: 'List matching tests', - sections: [ - { - title: 'Options', - items: [ - ['--related', 'List tests related to source files'], - ['--changed [commit]', 'List tests related to changed files'], - ['--files-only', 'List matching test files only'], - ['--json [path]', 'Print JSON or write it to a file'], - ['--include-suites', 'Include test suites'], - ['--print-location', 'Print test locations'], - ['--summary', 'Print a summary'], - ['--project ', 'Filter test projects by name'], - ['-t, --test-name-pattern ', 'List tests with names matching the pattern'], - ['-c, --config ', 'Specify Rstack config file path'], - ['-h, --help', 'Display this help message'], - ], - }, - ], - }); - -const renderTestMergeReportsHelp = (): string => - renderHelp({ - usage: 'rs test merge-reports [path] [options]', - description: 'Merge blob reports', - sections: [ - { - title: 'Options', - items: [ - ['--coverage', 'Generate coverage reports'], - ['--reporters, --reporter ', 'Specify test reporters'], - ['--cleanup', 'Remove blob reports after merging'], - ['-c, --config ', 'Specify Rstack config file path'], - ['-h, --help', 'Display this help message'], - ], - }, - ], - }); - -const renderTestInitHelp = (): string => - renderHelp({ - usage: 'rs test init [project] [options]', - description: 'Initialize Rstest configuration', - sections: [ - { - title: 'Options', - items: [ - ['--yes', 'Use default options without prompts'], - ['-h, --help', 'Display this help message'], - ], - }, - ], - }); - -const renderLibHelp = (): string => - renderHelp({ - usage: 'rs lib [command] [options]', - sections: [ - { - title: 'Commands', - items: [ - ['build', 'Build the library for production (default)'], - ['inspect', 'Inspect Rslib, Rsbuild, and Rspack configs'], - ['mf-dev', 'Start Rsbuild dev server for Module Federation'], - ], - }, - { - content: `For command-specific options, run: - $ rs lib -h`, - dim: true, - }, - { - title: 'Options', - items: [ - ['-w, --watch', 'Enable watch mode and rebuild on changes'], - ['--dts', 'Emit declaration files (use --no-dts to disable)'], - ['-c, --config ', 'Specify Rstack config file path'], - ['-h, --help', 'Display this help message'], - ], - }, - ], - }); - -const renderLibBuildHelp = (): string => - renderHelp({ - usage: 'rs lib build [options]', - description: 'Build the library for production', - sections: [ - { - title: 'Options', - items: [ - ['-w, --watch', 'Enable watch mode and rebuild on changes'], - ['--dts', 'Emit declaration files (use --no-dts to disable)'], - ['-c, --config ', 'Specify Rstack config file path'], - ['-h, --help', 'Display this help message'], - ], - }, - ], - }); - -const renderLibInspectHelp = (): string => - renderHelp({ - usage: 'rs lib inspect [options]', - description: 'Inspect Rslib, Rsbuild, and Rspack configs', - sections: [ - { - title: 'Options', - items: [ - ['--output ', 'Set the output path for inspection results (default: .rsbuild)'], - ['--verbose', 'Show complete function definitions in output'], - ['-c, --config ', 'Specify Rstack config file path'], - ['-h, --help', 'Display this help message'], - ], - }, - ], - }); - -const renderLibMfDevHelp = (): string => - renderHelp({ - usage: 'rs lib mf-dev [options]', - description: 'Start Rsbuild dev server for Module Federation', - sections: [ - { - title: 'Options', - items: [ - ['-c, --config ', 'Specify Rstack config file path'], - ['-h, --help', 'Display this help message'], - ], - }, - ], - }); - -const renderLintHelp = (): string => - renderHelp({ - usage: 'rs lint [options] [files...]', - description: 'Lint code', - sections: [ - { - title: 'Options', - items: [ - ['--fix', 'Automatically fix problems'], - ['--type-check', 'Enable TypeScript type checking'], - ['--type-check-only', 'Run only TypeScript type checking'], - ['--format ', 'Set output format (default | jsonline | github | gitlab)'], - ['--quiet', 'Report errors only'], - ['--timing [all|N]', 'Print a per-rule timing table (all rules or top N)'], - ['--max-warnings ', 'Set the maximum number of warnings'], - ['--rule ', 'Override a rule (repeatable)'], - ['--no-color', 'Disable colored output'], - ['--force-color', 'Force colored output'], - ['-c, --config ', 'Specify Rstack config file path'], - ['-h, --help', 'Display this help message'], - ], - }, - ], - }); +import { hasHelpFlag, printCommandHelp } from './help.ts'; async function runRsbuildCLI(args: string[]): Promise { if (hasHelpFlag(args)) { switch (args[0]) { case 'dev': - console.log(renderDevHelp()); - return; + return printCommandHelp('dev'); case 'build': - console.log(renderBuildHelp()); - return; + return printCommandHelp('build'); case 'preview': - console.log(renderPreviewHelp()); - return; + return printCommandHelp('preview'); } } @@ -453,23 +29,17 @@ async function runRstestCLI(args: string[]): Promise { if (hasHelpFlag(args)) { switch (args[0]) { case 'run': - console.log(renderTestRunHelp()); - return; + return printCommandHelp('test run'); case 'watch': - console.log(renderTestWatchHelp()); - return; + return printCommandHelp('test watch'); case 'list': - console.log(renderTestListHelp()); - return; + return printCommandHelp('test list'); case 'merge-reports': - console.log(renderTestMergeReportsHelp()); - return; + return printCommandHelp('test merge-reports'); case 'init': - console.log(renderTestInitHelp()); - return; + return printCommandHelp('test init'); default: - console.log(renderTestHelp()); - return; + return printCommandHelp('test'); } } @@ -487,17 +57,13 @@ async function runRslibCLI(args: string[]): Promise { if (hasHelpFlag(args)) { switch (args[0]) { case 'build': - console.log(renderLibBuildHelp()); - return; + return printCommandHelp('lib build'); case 'inspect': - console.log(renderLibInspectHelp()); - return; + return printCommandHelp('lib inspect'); case 'mf-dev': - console.log(renderLibMfDevHelp()); - return; + return printCommandHelp('lib mf-dev'); default: - console.log(renderLibHelp()); - return; + return printCommandHelp('lib'); } } @@ -524,17 +90,13 @@ async function runRspressCLI(args: string[]): Promise { if (hasHelpFlag(args)) { switch (args[0]) { case 'build': - console.log(renderDocBuildHelp()); - return; + return printCommandHelp('doc build'); case 'preview': - console.log(renderDocPreviewHelp()); - return; + return printCommandHelp('doc preview'); case 'eject': - console.log(renderDocEjectHelp()); - return; + return printCommandHelp('doc eject'); default: - console.log(renderDocHelp()); - return; + return printCommandHelp('doc'); } } @@ -560,8 +122,7 @@ async function runRspressCLI(args: string[]): Promise { async function runRslintCLI(args: string[]): Promise { if (hasHelpFlag(args)) { - console.log(renderLintHelp()); - return; + return printCommandHelp('lint'); } const argv = [ @@ -586,8 +147,7 @@ async function runCheckCLI(args: string[]): Promise { }); if (values.help) { - console.log(renderCheckHelp()); - return; + return printCommandHelp('check'); } await runRslintCLI(values.typeCheck ? ['--type-check'] : []); @@ -614,8 +174,7 @@ export async function setupCommands(): Promise { getConfigState().configPath = configPath === undefined ? undefined : resolve(configPath); if (!command || command === '-h' || command === '--help') { - console.log(renderRootHelp()); - return; + return printCommandHelp('root'); } if (command === '-v' || command === '--version') { @@ -671,7 +230,7 @@ export async function setupCommands(): Promise { /* rspackChunkName: 'setup' */ '../setup/index.ts' ); - runSetupCLI(args.slice(1)); + await runSetupCLI(args.slice(1)); return; } diff --git a/packages/rstack/src/cli/help.ts b/packages/rstack/src/cli/help.ts index 1936ecfa..e595e139 100644 --- a/packages/rstack/src/cli/help.ts +++ b/packages/rstack/src/cli/help.ts @@ -1,27 +1,3 @@ -import { color } from 'rslog'; - -declare global { - const RSTACK_VERSION: string; -} - -export type HelpItem = readonly [label: string, description: string]; - -export type HelpSection = - | { - title: string; - items: readonly HelpItem[]; - } - | { - content: string; - dim?: boolean; - }; - -export type HelpDefinition = { - usage: string; - description?: string; - sections?: readonly HelpSection[]; -}; - export const hasHelpFlag = (args: readonly string[]): boolean => { const end = args.indexOf('--'); const flags = end === -1 ? args : args.slice(0, end); @@ -29,33 +5,12 @@ export const hasHelpFlag = (args: readonly string[]): boolean => { return flags.some((flag) => flag === '-h' || flag === '--help'); }; -const renderItems = (items: readonly HelpItem[]): string => { - const labelWidth = items.reduce((width, [label]) => Math.max(width, label.length), 0); - - return items - .map(([label, description]) => ` ${label.padEnd(labelWidth)} ${description}`) - .join('\n'); -}; - -const renderSection = (section: HelpSection): string => { - if ('items' in section) { - return `${color.cyan(section.title)}:\n${renderItems(section.items)}`; - } - - return section.dim ? color.dim(section.content) : section.content; -}; - -export const renderHelp = ({ usage, description, sections = [] }: HelpDefinition): string => { - const blocks = [ - color.bold(`Rstack v${RSTACK_VERSION}`), - `${color.cyan('Usage')}:\n${color.yellow(` $ ${usage}`)}`, - ]; - - if (description) { - blocks.push(description); - } - - blocks.push(...sections.map(renderSection)); - - return blocks.join('\n\n'); +export const printCommandHelp = async ( + topic: import('./commandHelp.ts').HelpTopic, +): Promise => { + const { renderCommandHelp } = await import( + /* rspackChunkName: 'commandHelp' */ + './commandHelp.ts' + ); + console.log(renderCommandHelp(topic)); }; diff --git a/packages/rstack/src/fmt/cli.ts b/packages/rstack/src/fmt/cli.ts index 7728440e..6bd314f2 100644 --- a/packages/rstack/src/fmt/cli.ts +++ b/packages/rstack/src/fmt/cli.ts @@ -2,7 +2,7 @@ import path from 'node:path'; import { performance } from 'node:perf_hooks'; import { color, logger } from 'rslog'; import { parseArgs } from '../cli/args.ts'; -import { renderHelp } from '../cli/help.ts'; +import { printCommandHelp } from '../cli/help.ts'; import { loadRstackConfig } from '../config.ts'; import { ensureProjectCacheDir } from '../projectCache.ts'; import { fmtCacheFileName } from './cacheStore.ts'; @@ -29,33 +29,6 @@ interface ParsedFmtCLIArgs { lsp: boolean; } -const renderFmtHelp = (): string => - renderHelp({ - usage: 'rs fmt [options] [files/globs...]', - description: 'Format code', - sections: [ - { - title: 'Options', - items: [ - ['-w, --write', 'Write formatted files in place (default)'], - ['--check', 'Check whether files are formatted'], - ['-l, --list-different', 'Print paths of unformatted files'], - ['--ignore-path ', 'Path to an additional ignore file (repeatable)'], - ['-u, --ignore-unknown', 'Ignore unknown files'], - ['--no-cache', 'Disable the formatting cache'], - ['--cache-location ', 'Path to the formatting cache directory'], - ['--no-error-on-unmatched-pattern', 'Do not error when no files match'], - ['--with-node-modules', 'Process files inside node_modules'], - ['--parallel-workers ', 'Number of parallel workers'], - ['--stdin-filepath ', 'Format stdin as if it were saved at '], - ['--lsp', 'Run a language server on stdio'], - ['-c, --config ', 'Specify Rstack config file path'], - ['-h, --help', 'Display this help message'], - ], - }, - ], - }); - const parseMaxWorkers = (value: string | undefined): number | undefined => { if (value === undefined) { return undefined; @@ -294,7 +267,7 @@ const runFmtCLI = async (args: string[]): Promise => { withNodeModules, } = parseFmtArgs(args); if (help) { - logger.log(renderFmtHelp()); + await printCommandHelp('fmt'); return; } diff --git a/packages/rstack/src/setup/index.ts b/packages/rstack/src/setup/index.ts index 5272ab98..c090404f 100644 --- a/packages/rstack/src/setup/index.ts +++ b/packages/rstack/src/setup/index.ts @@ -1,24 +1,9 @@ import { color, logger } from 'rslog'; import { parseArgs } from '../cli/args.ts'; -import { renderHelp } from '../cli/help.ts'; +import { printCommandHelp } from '../cli/help.ts'; import { installHooks } from './install.ts'; -const renderSetupHelp = (): string => - renderHelp({ - usage: 'rs setup [options]', - description: 'Install Git hooks in the current repository', - sections: [ - { - title: 'Options', - items: [ - ['--hooks-dir ', 'Specify hooks directory relative to the Git repository root'], - ['-h, --help', 'Display this help message'], - ], - }, - ], - }); - -export const runSetupCLI = (args: string[]): void => { +export const runSetupCLI = async (args: string[]): Promise => { const { values } = parseArgs({ args, options: { @@ -37,7 +22,7 @@ export const runSetupCLI = (args: string[]): void => { const hooksDir = hooksDirs?.[0]; if (values.help) { - console.log(renderSetupHelp()); + await printCommandHelp('setup'); return; } diff --git a/packages/rstack/src/staged.ts b/packages/rstack/src/staged.ts index 339ddccd..b1a8e6dc 100644 --- a/packages/rstack/src/staged.ts +++ b/packages/rstack/src/staged.ts @@ -1,6 +1,6 @@ import lintStaged from 'lint-staged'; import { parseArgs } from './cli/args.ts'; -import { renderHelp } from './cli/help.ts'; +import { printCommandHelp } from './cli/help.ts'; import { loadRstackConfig } from './config.ts'; export type StagedSyncTaskGenerator = (stagedFileNames: readonly string[]) => string | string[]; @@ -21,35 +21,6 @@ export type StagedTask = export type StagedConfig = Record | StagedTaskGenerator; -const renderStagedHelp = (): string => - renderHelp({ - usage: 'rs staged [options]', - description: 'Run tasks on staged Git files', - sections: [ - { - title: 'Options', - items: [ - ['--allow-empty', 'Allow empty commits when tasks revert all staged changes'], - [ - '-p, --concurrent ', - 'The number of tasks to run concurrently, or false for serial', - ], - ['--cwd ', 'Working directory to run all tasks in'], - ['-d, --debug', 'Print additional debug information'], - ['--no-stash', 'Disable backup stash and automatic revert'], - ['-q, --quiet', "Disable lint-staged's own console output"], - ['-r, --relative', 'Pass relative filepaths to tasks'], - [ - '-v, --verbose', - 'Show task output even when tasks succeed; by default only failed output is shown', - ], - ['-c, --config ', 'Specify Rstack config file path'], - ['-h, --help', 'Display this help message'], - ], - }, - ], - }); - export async function runStagedCLI(args: string[]): Promise { const { values } = parseArgs({ args, @@ -69,7 +40,7 @@ export async function runStagedCLI(args: string[]): Promise { }); if (values.help) { - console.log(renderStagedHelp()); + await printCommandHelp('staged'); return; } From 535d19796a5472ea580f3ee06e85fd2e4e6a8bfd Mon Sep 17 00:00:00 2001 From: Jiahan Chen Date: Wed, 12 Aug 2026 19:52:07 +0800 Subject: [PATCH 02/11] chore(deps): upgrade Rslint to v0.8.0 (#332) --- package.json | 1 + pnpm-lock.yaml | 88 +++++++++++++++++++++++++-------------------- pnpm-workspace.yaml | 3 +- rstack.config.ts | 13 +++++++ 4 files changed, 66 insertions(+), 39 deletions(-) diff --git a/package.json b/package.json index 9c823b40..682f4b0a 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "devDependencies": { "@types/node": "catalog:", "cspell-ban-words": "catalog:", + "globals": "catalog:", "heading-case": "catalog:", "prettier": "catalog:", "rstack": "workspace:*", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b1d9b06d..c3ad4f86 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -23,8 +23,8 @@ catalogs: specifier: ~1.0.0-beta.2 version: 1.0.0-beta.2 '@rslint/core': - specifier: ~0.7.3 - version: 0.7.3 + specifier: ~0.8.0 + version: 0.8.0 '@rspress/core': specifier: ^2.0.19 version: 2.0.19 @@ -85,6 +85,9 @@ catalogs: fast-json-stable-stringify: specifier: 2.1.0 version: 2.1.0 + globals: + specifier: ^17.7.0 + version: 17.9.0 happy-dom: specifier: ^20.11.2 version: 20.11.2 @@ -159,6 +162,9 @@ importers: cspell-ban-words: specifier: 'catalog:' version: 0.0.4 + globals: + specifier: 'catalog:' + version: 17.9.0 heading-case: specifier: 'catalog:' version: 1.1.5 @@ -366,7 +372,7 @@ importers: version: 1.0.0-beta.2(typescript@7.0.2) '@rslint/core': specifier: 'catalog:' - version: 0.7.3 + version: 0.8.0 '@rstest/core': specifier: 'catalog:' version: 0.11.6(happy-dom@20.11.2) @@ -1298,8 +1304,8 @@ packages: typescript: optional: true - '@rslint/core@0.7.3': - resolution: {integrity: sha512-vRg6dOzyTie/fMOfvQ+4v3CoZ+IMyAfWyFC9bYf2QiKOV+csE/JHTV+yvh68YAEZvsDuQr35+8yerJFYLaFMPw==} + '@rslint/core@0.8.0': + resolution: {integrity: sha512-MfMC6lxiXoKPWsYRu9fuAxWA9mCD/I4E5Aa6Sl20a6q5w8r2C12fJM+bceC01AMGYuvWygKHqS3QBJdJHjniRw==} hasBin: true peerDependencies: jiti: ^2.7.0 @@ -1307,47 +1313,47 @@ packages: jiti: optional: true - '@rslint/native-darwin-arm64@0.7.3': - resolution: {integrity: sha512-BJOWoF5lD+6Kyigxfo38rXviS5cvHgZwQJ2zOjAal2Xiv2mn8Il88KGs8M/KwWNryFcQPGp5wjk6i6uPHwYb1w==} + '@rslint/native-darwin-arm64@0.8.0': + resolution: {integrity: sha512-Bo6kXL1/TkjVUl6maZ3Sw+JEnZUkgpUD35v06jyBTcjpxlXE6yqFj66NAzB/G2CVu220ADp/FEE7l2Kocrefhg==} cpu: [arm64] os: [darwin] - '@rslint/native-darwin-x64@0.7.3': - resolution: {integrity: sha512-3WIJocfinQs9YkzqgNXBIQNOylpz4IUI6LPzARE4tUJz9GgZF9Q7IEuscpVgkVUkh/P+Pr4CUplivggzXiBFBw==} + '@rslint/native-darwin-x64@0.8.0': + resolution: {integrity: sha512-F5pabdH7dluxoj7PGuQjPYuoNU+yxnctcJzqrb/CZ122FLP3uJPrbiLufh+ZF9e5ui700rNyb7macJqnHlBV2w==} cpu: [x64] os: [darwin] - '@rslint/native-linux-arm64-gnu@0.7.3': - resolution: {integrity: sha512-lLKQ+A/GiTvzOjtiK0euWul40nmQziR925JXznqcXgT0g1UdU7FwWdcy6l/UCQW8aVgzycV8yJMdaKmz+6H7Vg==} + '@rslint/native-linux-arm64-gnu@0.8.0': + resolution: {integrity: sha512-SSgSjyaeXI032Wk8bq6VmkLQTWOEqHZH5MWAk3831pd/G2rWr2XcoDi5Wf6w0o2rSCeYzkYbIejOePYwIKT4Lg==} cpu: [arm64] os: [linux] libc: [glibc] - '@rslint/native-linux-arm64-musl@0.7.3': - resolution: {integrity: sha512-i6jVTIii8eIHFfb/UNMNRvZGPiW/yH4ZgfX/+77kxAnAYHm0wx2qXakW9M8LDTdtCz1UBqV0UL7NB4gBQyDPwQ==} + '@rslint/native-linux-arm64-musl@0.8.0': + resolution: {integrity: sha512-50VDZQFAc9kp6rbOUOjyppVjC3d3AdbOJyA6JxlhK3mp8a/8sPIqWG0BlfcN/7ZpwdZrFsQt2Ds+0yMXITfu5A==} cpu: [arm64] os: [linux] libc: [musl] - '@rslint/native-linux-x64-gnu@0.7.3': - resolution: {integrity: sha512-Qta8uiB4c3zuLK/1pCgx9DzhtCvQ/i31TDoNSA3WpY17Tsa82CGXho1l6bCA1/9dbuOz5lwCsYALQLVe8/o/rQ==} + '@rslint/native-linux-x64-gnu@0.8.0': + resolution: {integrity: sha512-wfc/UfnuTBAofwLPK5MLB2Hus1YYnsxP2MVchp380fUvMfQuGFPzz1WOAUY66zqrsrDKpUJsh3V1bx7c8DTlJA==} cpu: [x64] os: [linux] libc: [glibc] - '@rslint/native-linux-x64-musl@0.7.3': - resolution: {integrity: sha512-urpqLlJISIFAtiXCGGwRZgfnSYpFDi5lzk6ibSgBPvJmv94yhxMpDoutpHTA3UyVDeH33axYGRonImLf7UfBSA==} + '@rslint/native-linux-x64-musl@0.8.0': + resolution: {integrity: sha512-MTYcAMz6IZWb6ZmLo12pakCBA8mS3EW9cOI0jd3At6vs0Yia9YbeOAUiWbIC4Z9yyp75b8ZQCQMRSnY6rDnbaA==} cpu: [x64] os: [linux] libc: [musl] - '@rslint/native-win32-arm64-msvc@0.7.3': - resolution: {integrity: sha512-jcxjgUPMl725p0wjXLPIPMeARK41FwHXiWVmg4AqIHJBfpXpwM+xozVn4Dd5GL3TO38zjmP881bKOvtPwnFl0Q==} + '@rslint/native-win32-arm64-msvc@0.8.0': + resolution: {integrity: sha512-hids2jgNWBxZf2mSBLZJxubWRLWlJapEfeJHVokzjpRpBZZNv7O06enoyXSb4Lswff9WaHssIqu1sfZIc9lC2g==} cpu: [arm64] os: [win32] - '@rslint/native-win32-x64-msvc@0.7.3': - resolution: {integrity: sha512-R87nmvTUZry9DPF8Cz6TGLLAikIyUxHDPwzonrYaJ0kTLeJAgDMfVIY1s5pUxF3heQD6G2QXjhpU/uPwqnvmzg==} + '@rslint/native-win32-x64-msvc@0.8.0': + resolution: {integrity: sha512-bun7uURKl6NdChwmw/i2mk3Yj9klZQyh1uRbIQG0RDEJ9oTIbU5M3c7K5sd/Rukat0TVCGgbBAzR+YB0DAXPZQ==} cpu: [x64] os: [win32] @@ -2141,6 +2147,10 @@ packages: git-hooks-list@4.2.1: resolution: {integrity: sha512-WNvqJjOxxs/8ZP9+DWdwWJ7cDsd60NHf39XnD82pDVrKO5q7xfPqpkK6hwEAmBa/ZSEE4IOoR75EzbbIuwGlMw==} + globals@17.9.0: + resolution: {integrity: sha512-m/MvAW61QVU5VDNF1Vj8axt016h8w7L5TU1e9zlab7XIttAT2YAlCwl75K1fOqvMM9apmD7lbCIRhpfkhmxhCg==} + engines: {node: '>=18'} + happy-dom@20.11.2: resolution: {integrity: sha512-7MB+bJLkxu3SowAfBJbjW+c55kNz5tkR45gu2qzrxznezhLeN5YIlJbwUgSzlGc+qWoZ8Ykg71H5ezz69xixrw==} engines: {node: '>=20.0.0'} @@ -3786,41 +3796,41 @@ snapshots: - '@module-federation/runtime-tools' - core-js - '@rslint/core@0.7.3': + '@rslint/core@0.8.0': dependencies: picomatch: 4.0.5 optionalDependencies: - '@rslint/native-darwin-arm64': 0.7.3 - '@rslint/native-darwin-x64': 0.7.3 - '@rslint/native-linux-arm64-gnu': 0.7.3 - '@rslint/native-linux-arm64-musl': 0.7.3 - '@rslint/native-linux-x64-gnu': 0.7.3 - '@rslint/native-linux-x64-musl': 0.7.3 - '@rslint/native-win32-arm64-msvc': 0.7.3 - '@rslint/native-win32-x64-msvc': 0.7.3 + '@rslint/native-darwin-arm64': 0.8.0 + '@rslint/native-darwin-x64': 0.8.0 + '@rslint/native-linux-arm64-gnu': 0.8.0 + '@rslint/native-linux-arm64-musl': 0.8.0 + '@rslint/native-linux-x64-gnu': 0.8.0 + '@rslint/native-linux-x64-musl': 0.8.0 + '@rslint/native-win32-arm64-msvc': 0.8.0 + '@rslint/native-win32-x64-msvc': 0.8.0 - '@rslint/native-darwin-arm64@0.7.3': + '@rslint/native-darwin-arm64@0.8.0': optional: true - '@rslint/native-darwin-x64@0.7.3': + '@rslint/native-darwin-x64@0.8.0': optional: true - '@rslint/native-linux-arm64-gnu@0.7.3': + '@rslint/native-linux-arm64-gnu@0.8.0': optional: true - '@rslint/native-linux-arm64-musl@0.7.3': + '@rslint/native-linux-arm64-musl@0.8.0': optional: true - '@rslint/native-linux-x64-gnu@0.7.3': + '@rslint/native-linux-x64-gnu@0.8.0': optional: true - '@rslint/native-linux-x64-musl@0.7.3': + '@rslint/native-linux-x64-musl@0.8.0': optional: true - '@rslint/native-win32-arm64-msvc@0.7.3': + '@rslint/native-win32-arm64-msvc@0.8.0': optional: true - '@rslint/native-win32-x64-msvc@0.7.3': + '@rslint/native-win32-x64-msvc@0.8.0': optional: true '@rspack/binding-darwin-arm64@2.1.8': @@ -4492,6 +4502,8 @@ snapshots: git-hooks-list@4.2.1: {} + globals@17.9.0: {} + happy-dom@20.11.2: dependencies: '@types/node': 24.13.3 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index d91cd99d..460655d2 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -17,7 +17,7 @@ catalog: '@rsbuild/plugin-react': '^2.1.0' '@rsbuild/plugin-sass': '^2.0.1' '@rslib/core': '~1.0.0-beta.2' - '@rslint/core': '~0.7.3' + '@rslint/core': '~0.8.0' '@rspress/core': '^2.0.19' '@rspress/plugin-client-redirects': '^2.0.19' '@rspress/plugin-sitemap': '^2.0.19' @@ -38,6 +38,7 @@ catalog: '@shikijs/transformers': '^4.4.2' 'cspell-ban-words': '^0.0.4' 'fast-json-stable-stringify': '2.1.0' + globals: '^17.7.0' 'happy-dom': '^20.11.2' 'heading-case': '^1.1.5' 'import-meta-resolve': '4.2.0' diff --git a/rstack.config.ts b/rstack.config.ts index 9ffac863..0ad535cf 100644 --- a/rstack.config.ts +++ b/rstack.config.ts @@ -2,10 +2,23 @@ import { define } from 'rstack'; define.lint(async () => { + const { default: globals } = await import('globals'); const { js, ts } = await import('rstack/lint'); return [ js.configs.recommended, ts.configs.recommended, + { + files: ['**/*.{js,jsx,cjs,mjs}'], + languageOptions: { + globals: { + ...globals.browser, + ...globals.nodeBuiltin, + DEFINE_APP_TEST_VALUE: 'readonly', + DEFINE_LIB_TEST_VALUE: 'readonly', + DEFINE_VALUE: 'readonly', + }, + }, + }, // Source imports use .ts for Node.js native TypeScript execution; builds rewrite them to .js. { files: ['packages/rstack/src/**/*.ts'], From 98552d5c3c8f96ddbe976d4f305ca288b1b79f1f Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Thu, 13 Aug 2026 01:51:05 +0000 Subject: [PATCH 03/11] docs: improve generated llms.txt summaries (#335) --- website/docs/en/guide/cli/doc.mdx | 4 ++++ website/docs/en/guide/formatting.mdx | 4 ++++ website/docs/zh/guide/cli/doc.mdx | 4 ++++ website/docs/zh/guide/formatting.mdx | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/website/docs/en/guide/cli/doc.mdx b/website/docs/en/guide/cli/doc.mdx index 08877b45..fb6494af 100644 --- a/website/docs/en/guide/cli/doc.mdx +++ b/website/docs/en/guide/cli/doc.mdx @@ -1,3 +1,7 @@ +--- +description: 'Develop, build, and preview Rspress documentation sites with the rs doc command.' +--- + # doc import { PackageManagerTabs } from '@rspress/core/theme'; diff --git a/website/docs/en/guide/formatting.mdx b/website/docs/en/guide/formatting.mdx index a6c60054..9090f666 100644 --- a/website/docs/en/guide/formatting.mdx +++ b/website/docs/en/guide/formatting.mdx @@ -1,3 +1,7 @@ +--- +description: 'Format files with Rstack CLI using Prettier-compatible options, plugins, parallel formatting, and a persistent cache.' +--- + # Formatting import { PackageManagerTabs } from '@rspress/core/theme'; diff --git a/website/docs/zh/guide/cli/doc.mdx b/website/docs/zh/guide/cli/doc.mdx index 647184de..cfe4c138 100644 --- a/website/docs/zh/guide/cli/doc.mdx +++ b/website/docs/zh/guide/cli/doc.mdx @@ -1,3 +1,7 @@ +--- +description: '使用 rs doc 命令开发、构建和预览 Rspress 文档站点。' +--- + # doc import { PackageManagerTabs } from '@rspress/core/theme'; diff --git a/website/docs/zh/guide/formatting.mdx b/website/docs/zh/guide/formatting.mdx index 8659e673..7f2f8b7b 100644 --- a/website/docs/zh/guide/formatting.mdx +++ b/website/docs/zh/guide/formatting.mdx @@ -1,3 +1,7 @@ +--- +description: '使用 Rstack CLI 格式化文件,支持与 Prettier 兼容的选项、插件、并行格式化和持久化缓存。' +--- + # 格式化 \{#formatting} import { PackageManagerTabs } from '@rspress/core/theme'; From b6e8661f65942871ef8ea38e0d7c74062a67c92f Mon Sep 17 00:00:00 2001 From: Jiahan Chen Date: Thu, 13 Aug 2026 10:02:34 +0800 Subject: [PATCH 04/11] refactor(fmt): centralize per-file resolution (#334) --- packages/rstack/src/fmt/discovery.ts | 42 ++----------- packages/rstack/src/fmt/fileResolver.ts | 28 +++++++++ packages/rstack/src/fmt/lsp/server.ts | 20 ++----- packages/rstack/src/fmt/stdin.ts | 12 +--- packages/rstack/tests/fmt/discovery.test.ts | 54 ----------------- .../rstack/tests/fmt/fileResolver.test.ts | 59 +++++++++++++++++++ 6 files changed, 97 insertions(+), 118 deletions(-) create mode 100644 packages/rstack/src/fmt/fileResolver.ts create mode 100644 packages/rstack/tests/fmt/fileResolver.test.ts diff --git a/packages/rstack/src/fmt/discovery.ts b/packages/rstack/src/fmt/discovery.ts index 6eca1d83..cf1c3472 100644 --- a/packages/rstack/src/fmt/discovery.ts +++ b/packages/rstack/src/fmt/discovery.ts @@ -1,38 +1,9 @@ import path from 'node:path'; -import { createOptionsResolver, type FmtOptionsResolver } from './config.ts'; import { discoverFmtPaths } from './discoverPaths.ts'; +import { createFmtFileResolver } from './fileResolver.ts'; import { createIgnoreMatcher } from './ignore.ts'; -import type { FmtPluginResolver } from './plugins.ts'; import type { DiscoverFmtFilesOptions, FmtFileRequest } from './types.ts'; -const createFileRequest = ( - filePath: string, - resolveOptions: FmtOptionsResolver, -): FmtFileRequest => ({ - path: filePath, - options: resolveOptions(filePath), -}); - -/** Imports the plugin chunk on first use and shares the resolver across calls. */ -const createLazyPluginResolver = (rootPath: string): (() => Promise) => { - let resolver: Promise | undefined; - - return () => - (resolver ??= import( - /* rspackChunkName: 'fmtPlugins' */ - './plugins.ts' - ).then(({ createPluginResolver }) => createPluginResolver(rootPath))); -}; - -/** Resolves the plugin specifiers of a request whose options configure plugins. */ -const resolveFileRequestPlugins = async ( - file: FmtFileRequest, - getPluginResolver: () => Promise, -): Promise => - file.options.plugins?.length - ? { ...file, options: (await getPluginResolver())(file.options) } - : file; - const createDirMatcher = (dirPath: string): ((filePath: string) => boolean) => { const prefix = dirPath.endsWith(path.sep) ? dirPath : `${dirPath}${path.sep}`; return (filePath) => filePath === dirPath || filePath.startsWith(prefix); @@ -63,14 +34,9 @@ const discoverFmtFiles = async ({ return []; } - const resolveOptions = createOptionsResolver(config); - const getPluginResolver = createLazyPluginResolver(config.rootPath); + const resolveFile = createFmtFileResolver(config); - return Promise.all( - filePaths.map((filePath) => - resolveFileRequestPlugins(createFileRequest(filePath, resolveOptions), getPluginResolver), - ), - ); + return Promise.all(filePaths.map((filePath) => resolveFile(filePath))); }; -export { createFileRequest, createLazyPluginResolver, discoverFmtFiles, resolveFileRequestPlugins }; +export { discoverFmtFiles }; diff --git a/packages/rstack/src/fmt/fileResolver.ts b/packages/rstack/src/fmt/fileResolver.ts new file mode 100644 index 00000000..d6cc0abf --- /dev/null +++ b/packages/rstack/src/fmt/fileResolver.ts @@ -0,0 +1,28 @@ +import { createOptionsResolver } from './config.ts'; +import type { FmtPluginResolver } from './plugins.ts'; +import type { FmtFileRequest, ResolvedFmtConfig } from './types.ts'; + +type FmtFileResolver = (filePath: string) => Promise; + +/** Applies per-file overrides and resolves configured plugin specifiers. */ +const createFmtFileResolver = (config: ResolvedFmtConfig): FmtFileResolver => { + const resolveOptions = createOptionsResolver(config); + let pluginResolver: Promise | undefined; + + return async (filePath) => { + let options = resolveOptions(filePath); + + if (options.plugins?.length) { + pluginResolver ??= import( + /* rspackChunkName: 'fmtPlugins' */ + './plugins.ts' + ).then(({ createPluginResolver }) => createPluginResolver(config.rootPath)); + options = (await pluginResolver)(options); + } + + return { path: filePath, options }; + }; +}; + +export { createFmtFileResolver }; +export type { FmtFileResolver }; diff --git a/packages/rstack/src/fmt/lsp/server.ts b/packages/rstack/src/fmt/lsp/server.ts index d1e1348c..7dfddf68 100644 --- a/packages/rstack/src/fmt/lsp/server.ts +++ b/packages/rstack/src/fmt/lsp/server.ts @@ -9,15 +9,9 @@ import { type InitializeParams, type TextEdit, } from 'vscode-languageserver/node'; -import { createOptionsResolver, type FmtOptionsResolver } from '../config.ts'; -import { - createFileRequest, - createLazyPluginResolver, - resolveFileRequestPlugins, -} from '../discovery.ts'; +import { createFmtFileResolver, type FmtFileResolver } from '../fileResolver.ts'; import { formatFmtSource } from '../format.ts'; import { createIgnoreMatcher, type IgnorePredicate } from '../ignore.ts'; -import type { FmtPluginResolver } from '../plugins.ts'; import type { ResolvedFmtConfig } from '../types.ts'; import { computeMinimalTextEdit } from './minimalEdit.ts'; @@ -35,9 +29,7 @@ type FmtLspSessionOptions = RunFmtLspOptions & { root: string }; interface FmtLspSession { isIgnored: IgnorePredicate; - resolveOptions: FmtOptionsResolver; - /** Resolves plugin specifiers through the file system; cached per session. */ - getPluginResolver: () => Promise; + resolveFile: FmtFileResolver; } const toFilePath = (uri: string): string | undefined => { @@ -122,8 +114,7 @@ const createFmtLspSession = async ({ return { isIgnored, - resolveOptions: createOptionsResolver(config), - getPluginResolver: createLazyPluginResolver(config.rootPath), + resolveFile: createFmtFileResolver(config), }; }; @@ -137,10 +128,7 @@ const formatDocumentSource = async ( return undefined; } - const file = await resolveFileRequestPlugins( - createFileRequest(filePath, session.resolveOptions), - session.getPluginResolver, - ); + const file = await session.resolveFile(filePath); const result = await formatFmtSource(file, () => source); return result.status === 'formatted' ? result.formatted : undefined; diff --git a/packages/rstack/src/fmt/stdin.ts b/packages/rstack/src/fmt/stdin.ts index 90062709..6501ba73 100644 --- a/packages/rstack/src/fmt/stdin.ts +++ b/packages/rstack/src/fmt/stdin.ts @@ -1,10 +1,5 @@ import { resolve } from 'node:path'; -import { createOptionsResolver } from './config.ts'; -import { - createFileRequest, - createLazyPluginResolver, - resolveFileRequestPlugins, -} from './discovery.ts'; +import { createFmtFileResolver } from './fileResolver.ts'; import { formatFmtSource } from './format.ts'; import { createIgnoreMatcher } from './ignore.ts'; import type { ResolvedFmtConfig } from './types.ts'; @@ -83,10 +78,7 @@ const runFmtStdin = async ({ return; } - const file = await resolveFileRequestPlugins( - createFileRequest(absolutePath, createOptionsResolver(config)), - createLazyPluginResolver(config.rootPath), - ); + const file = await createFmtFileResolver(config)(absolutePath); const result = await formatFmtSource(file, () => source); if (result.status === 'unsupported') { diff --git a/packages/rstack/tests/fmt/discovery.test.ts b/packages/rstack/tests/fmt/discovery.test.ts index 171fbaae..4dfd1937 100644 --- a/packages/rstack/tests/fmt/discovery.test.ts +++ b/packages/rstack/tests/fmt/discovery.test.ts @@ -1,6 +1,5 @@ import { mkdirSync } from 'node:fs'; import path from 'node:path'; -import { pathToFileURL } from 'node:url'; import { expect, test } from 'rstack/test'; import { normalizeFmtConfig } from '../../src/fmt/config.ts'; import { discoverFmtFiles } from '../../src/fmt/discovery.ts'; @@ -128,56 +127,3 @@ test('defers parser inference to workers and preserves an explicit parser', asyn }); }); }); - -test('resolves plugins after applying matching overrides', async () => { - await withTempProject(async (rootPath) => { - const pluginEntry = writeProjectFile( - rootPath, - 'node_modules/prettier-plugin-fixture/index.mjs', - `export default { - languages: [ - { name: 'Fixture JSON', parsers: ['json'], extensions: ['.fixture'] }, - { name: 'Fixture TypeScript', parsers: ['babel'], extensions: ['.ts'] }, - ], -}; -`, - ); - writeProjectFile( - rootPath, - 'node_modules/prettier-plugin-fixture/package.json', - JSON.stringify({ name: 'prettier-plugin-fixture', exports: './index.mjs' }), - ); - writeProjectFile(rootPath, 'example.fixture'); - writeProjectFile(rootPath, 'example.ts'); - const config = { - overrides: [ - { - files: '*.fixture', - options: { plugins: ['prettier-plugin-fixture'] }, - }, - { - files: '*.ts', - options: { plugins: ['prettier-plugin-fixture'] }, - }, - { - files: '*.md', - options: { plugins: ['missing-plugin'] }, - }, - ], - }; - - const files = await discover(rootPath, ['example.fixture', 'example.ts'], config); - - expect(files).toHaveLength(2); - expect(files[0]).toMatchObject({ - options: { - plugins: [pathToFileURL(pluginEntry).href], - }, - }); - expect(files[1]).toMatchObject({ - options: { - plugins: [pathToFileURL(pluginEntry).href], - }, - }); - }); -}); diff --git a/packages/rstack/tests/fmt/fileResolver.test.ts b/packages/rstack/tests/fmt/fileResolver.test.ts new file mode 100644 index 00000000..98e1e486 --- /dev/null +++ b/packages/rstack/tests/fmt/fileResolver.test.ts @@ -0,0 +1,59 @@ +import path from 'node:path'; +import { pathToFileURL } from 'node:url'; +import { expect, test } from 'rstack/test'; +import { normalizeFmtConfig } from '../../src/fmt/config.ts'; +import { createFmtFileResolver } from '../../src/fmt/fileResolver.ts'; +import { withTempProject, writeProjectFile } from './helpers.ts'; + +test('applies matching overrides before resolving plugins', async () => { + await withTempProject(async (rootPath) => { + const pluginEntry = writeProjectFile( + rootPath, + 'node_modules/prettier-plugin-fixture/index.mjs', + `export default { + languages: [ + { name: 'Fixture JSON', parsers: ['json'], extensions: ['.fixture'] }, + { name: 'Fixture TypeScript', parsers: ['babel'], extensions: ['.ts'] }, + ], +}; +`, + ); + writeProjectFile( + rootPath, + 'node_modules/prettier-plugin-fixture/package.json', + JSON.stringify({ name: 'prettier-plugin-fixture', exports: './index.mjs' }), + ); + const config = normalizeFmtConfig( + { + overrides: [ + { + files: '*.{fixture,ts}', + options: { plugins: ['prettier-plugin-fixture'] }, + }, + { + files: '*.md', + options: { plugins: ['missing-plugin'] }, + }, + ], + }, + rootPath, + ); + const resolveFile = createFmtFileResolver(config); + + const files = await Promise.all([ + resolveFile(path.join(rootPath, 'example.fixture')), + resolveFile(path.join(rootPath, 'example.ts')), + ]); + + expect(files).toEqual([ + { + path: path.join(rootPath, 'example.fixture'), + options: { plugins: [pathToFileURL(pluginEntry).href] }, + }, + { + path: path.join(rootPath, 'example.ts'), + options: { plugins: [pathToFileURL(pluginEntry).href] }, + }, + ]); + }); +}); From 9873df34c44b25cea24bfd85d20f7ccd4a701220 Mon Sep 17 00:00:00 2001 From: Jiahan Chen Date: Thu, 13 Aug 2026 10:20:58 +0800 Subject: [PATCH 05/11] chore(ci): skip tests for docs-only changes (#337) --- .github/workflows/test.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3062f9f7..e41dfec6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,6 +12,7 @@ on: permissions: contents: read + pull-requests: read # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -26,28 +27,47 @@ jobs: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 + id: changes + with: + predicate-quantifier: 'every' + filters: | + changed: + - "!**/*.md" + - "!**/*.mdx" + - "!**/_meta.json" + - "!**/_nav.json" + - "!**/dictionary.txt" + - name: Setup Node.js + if: steps.changes.outputs.changed == 'true' uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7 with: node-version: 24.18.1 package-manager-cache: false - name: Install Pnpm + if: steps.changes.outputs.changed == 'true' uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10 with: run_install: true - name: Build Packages + if: steps.changes.outputs.changed == 'true' run: node --run build - name: Run Rust Tests + if: steps.changes.outputs.changed == 'true' run: cargo test --profile ci --workspace --locked - name: Build Native Binding + if: steps.changes.outputs.changed == 'true' run: pnpm --filter rstack build:native:ci - name: Check Generated Native Files + if: steps.changes.outputs.changed == 'true' run: git diff --exit-code -- packages/rstack/binding.cjs packages/rstack/binding.d.cts - name: Run Test + if: steps.changes.outputs.changed == 'true' run: node --run test From 8535fc252b07f4ae7a051440c46ef6ea4da7a72e Mon Sep 17 00:00:00 2001 From: Jiahan Chen Date: Thu, 13 Aug 2026 10:36:34 +0800 Subject: [PATCH 06/11] perf(fmt): reuse resolved options (#338) --- packages/rstack/src/fmt/config.ts | 29 +++++++++++++++++++---- packages/rstack/src/fmt/plugins.ts | 17 +++++++++---- packages/rstack/tests/fmt/config.test.ts | 23 ++++++++++++++++++ packages/rstack/tests/fmt/plugins.test.ts | 4 +++- 4 files changed, 62 insertions(+), 11 deletions(-) diff --git a/packages/rstack/src/fmt/config.ts b/packages/rstack/src/fmt/config.ts index 362a4527..ee0a5123 100644 --- a/packages/rstack/src/fmt/config.ts +++ b/packages/rstack/src/fmt/config.ts @@ -17,6 +17,20 @@ type ResolveFmtConfigOptions = { type PathMatcher = (filePath: string) => boolean; type FmtOptionsResolver = (filePath: string) => ResolvedFmtOptions; +/** + * Each path from the root represents an ordered sequence of matching overrides. + * A node stores the options merged along that path. + */ +type OptionsCacheNode = { + children: WeakMap; + options: ResolvedFmtOptions; +}; + +const createOptionsCacheNode = (options: ResolvedFmtOptions): OptionsCacheNode => ({ + children: new WeakMap(), + options, +}); + const neverMatches: PathMatcher = () => false; const compileMatchers = ( @@ -96,22 +110,27 @@ const createOptionsResolver = (config: ResolvedFmtConfig): FmtOptionsResolver => } const resolveRelativePath = createRelativePathResolver(config.rootPath); + const rootCacheNode = createOptionsCacheNode(config.baseOptions); return (filePath) => { - let options = config.baseOptions; + let cacheNode = rootCacheNode; const relativeFilePath = resolveRelativePath(filePath); for (const override of config.overrides) { if (!override.options || !override.matches(relativeFilePath)) { continue; } - if (options === config.baseOptions) { - options = { ...options }; + + // Reuse the merged result for this override after the current matched sequence. + let nextCacheNode = cacheNode.children.get(override.options); + if (!nextCacheNode) { + nextCacheNode = createOptionsCacheNode({ ...cacheNode.options, ...override.options }); + cacheNode.children.set(override.options, nextCacheNode); } - Object.assign(options, override.options); + cacheNode = nextCacheNode; } - return options; + return cacheNode.options; }; }; diff --git a/packages/rstack/src/fmt/plugins.ts b/packages/rstack/src/fmt/plugins.ts index 312dfbb1..e7a33e16 100644 --- a/packages/rstack/src/fmt/plugins.ts +++ b/packages/rstack/src/fmt/plugins.ts @@ -94,11 +94,12 @@ const createFingerprintResolver = (): FingerprintResolver => { /** Creates a project-root resolver for plugins in final per-file options. */ const createPluginResolver = (rootPath: string): FmtPluginResolver => { const parentUrl = pathToFileURL(join(rootPath, 'index.js')); - const cache = new Map(); + const pluginCache = new Map(); + const optionsCache = new WeakMap(); const resolvePlugin = (plugin: FmtPluginSpecifier): string => { const specifier = plugin instanceof URL ? plugin.href : plugin; - const cached = cache.get(specifier); + const cached = pluginCache.get(specifier); if (cached !== undefined) { return cached; } @@ -119,11 +120,16 @@ const createPluginResolver = (rootPath: string): FmtPluginResolver => { } } - cache.set(specifier, resolved); + pluginCache.set(specifier, resolved); return resolved; }; return (options) => { + const cached = optionsCache.get(options); + if (cached !== undefined) { + return cached; + } + const { plugins } = options; if (!plugins?.length) { return options; @@ -136,10 +142,11 @@ const createPluginResolver = (rootPath: string): FmtPluginResolver => { } const resolvedPlugins = plugins.map(resolvePlugin); - - return resolvedPlugins.every((plugin, index) => plugin === plugins[index]) + const resolvedOptions = resolvedPlugins.every((plugin, index) => plugin === plugins[index]) ? options : { ...options, plugins: resolvedPlugins }; + optionsCache.set(options, resolvedOptions); + return resolvedOptions; }; }; diff --git a/packages/rstack/tests/fmt/config.test.ts b/packages/rstack/tests/fmt/config.test.ts index c2f32844..fe85d292 100644 --- a/packages/rstack/tests/fmt/config.test.ts +++ b/packages/rstack/tests/fmt/config.test.ts @@ -50,6 +50,29 @@ test('applies basename and path overrides in declaration order', () => { expect(config.baseOptions).toEqual({ singleQuote: false }); }); +test('reuses options for the same override combination', () => { + const config = normalizeFmtConfig( + { + singleQuote: false, + overrides: [ + { files: '*.ts', options: { semi: false } }, + { files: 'src/**/*.ts', options: { singleQuote: true } }, + ], + }, + rootPath, + ); + const resolveOptions = createOptionsResolver(config); + + const first = resolveOptions(path.join(rootPath, 'src/first.ts')); + const second = resolveOptions(path.join(rootPath, 'src/second.ts')); + const outside = resolveOptions(path.join(rootPath, 'outside.ts')); + + expect(first).toBe(second); + expect(first).not.toBe(outside); + expect(first).toEqual({ semi: false, singleQuote: true }); + expect(outside).toEqual({ semi: false, singleQuote: false }); +}); + test('applies overrides outside the config root', () => { const config = normalizeFmtConfig( { diff --git a/packages/rstack/tests/fmt/plugins.test.ts b/packages/rstack/tests/fmt/plugins.test.ts index 80f998e8..162b3e69 100644 --- a/packages/rstack/tests/fmt/plugins.test.ts +++ b/packages/rstack/tests/fmt/plugins.test.ts @@ -40,7 +40,8 @@ test('resolves plugin specifiers from the config root', async () => { ], }; - const resolved = createPluginResolver(rootPath)(options); + const resolvePlugins = createPluginResolver(rootPath); + const resolved = resolvePlugins(options); expect(resolved.plugins).toEqual([ pathToFileURL(packageEntry).href, @@ -50,6 +51,7 @@ test('resolves plugin specifiers from the config root', async () => { 'data:text/javascript,export default {}', ]); expect(options.plugins[0]).toBe('prettier-plugin-packagejson'); + expect(resolvePlugins(options)).toBe(resolved); }); }); From 9c0f1aee25093f6541fbec361215af3ee5a5f452 Mon Sep 17 00:00:00 2001 From: Jiahan Chen Date: Thu, 13 Aug 2026 10:50:15 +0800 Subject: [PATCH 07/11] chore(lint): enable type-aware linting (#339) --- packages/rstack/src/fmt/lsp/server.ts | 2 +- packages/rstack/src/fmt/yukuPlugin.ts | 6 +----- packages/rstack/src/staged.ts | 5 ++++- packages/rstack/tests/cli/staged/index.test.ts | 4 ++-- packages/rstack/tests/fmt/helpers.ts | 2 +- packages/rstack/tests/fmt/lsp/server.test.ts | 12 ++++++------ packages/rstack/tests/fmt/plugins.test.ts | 2 +- packages/rstack/tests/setup/install.test.ts | 2 +- .../rstack/tests/types/resolution-bundler/index.ts | 2 +- .../rstack/tests/types/resolution-nodenext/index.ts | 2 +- rstack.config.ts | 2 +- 11 files changed, 20 insertions(+), 21 deletions(-) diff --git a/packages/rstack/src/fmt/lsp/server.ts b/packages/rstack/src/fmt/lsp/server.ts index 7dfddf68..ec0be83e 100644 --- a/packages/rstack/src/fmt/lsp/server.ts +++ b/packages/rstack/src/fmt/lsp/server.ts @@ -87,7 +87,7 @@ const redirectConsoleToConnection = (connection: Connection): void => { counters.set(key, count); connection.console.log(`${key}: ${count}`); }; - console.countReset = (label?: unknown): void => { + console.countReset = (label?: string): void => { if (label === undefined) { counters.clear(); } else { diff --git a/packages/rstack/src/fmt/yukuPlugin.ts b/packages/rstack/src/fmt/yukuPlugin.ts index 1fa2f646..a22ec9f2 100644 --- a/packages/rstack/src/fmt/yukuPlugin.ts +++ b/packages/rstack/src/fmt/yukuPlugin.ts @@ -423,11 +423,7 @@ const indexToPosition = (text: string, index: number): { column: number; line: n }; }; -const createParseError = (error: Diagnostic, text: string): Diagnostic | SyntaxError => { - if (typeof error?.start !== 'number' || typeof error?.end !== 'number') { - return error; - } - +const createParseError = (error: Diagnostic, text: string): SyntaxError => { const start = indexToPosition(text, error.start); const end = indexToPosition(text, error.end); diff --git a/packages/rstack/src/staged.ts b/packages/rstack/src/staged.ts index b1a8e6dc..4f6c78c2 100644 --- a/packages/rstack/src/staged.ts +++ b/packages/rstack/src/staged.ts @@ -57,7 +57,10 @@ export async function runStagedCLI(args: string[]): Promise { const success = await lintStaged({ allowEmpty: values.allowEmpty, - concurrent: values.concurrent === undefined ? undefined : JSON.parse(values.concurrent), + concurrent: + values.concurrent === undefined + ? undefined + : (JSON.parse(values.concurrent) as boolean | number), config: stagedConfig, cwd: values.cwd, debug: values.debug, diff --git a/packages/rstack/tests/cli/staged/index.test.ts b/packages/rstack/tests/cli/staged/index.test.ts index 5fb293f1..b43a928b 100644 --- a/packages/rstack/tests/cli/staged/index.test.ts +++ b/packages/rstack/tests/cli/staged/index.test.ts @@ -58,9 +58,9 @@ test('should pass default options to lint-staged', async ({ expect }) => { }); test('should set the staged environment', async ({ expect }) => { - mocks.lintStaged.mockImplementation(async () => { + mocks.lintStaged.mockImplementation(() => { expect(process.env.RSTACK_STAGED).toBe('1'); - return true; + return Promise.resolve(true); }); await runStagedCLI([]); diff --git a/packages/rstack/tests/fmt/helpers.ts b/packages/rstack/tests/fmt/helpers.ts index 2a6c8ac3..698708cb 100644 --- a/packages/rstack/tests/fmt/helpers.ts +++ b/packages/rstack/tests/fmt/helpers.ts @@ -17,7 +17,7 @@ export const createFmtCacheContext = (rootPath: string): FmtCacheContext => ({ }); export const withTempProject = async ( - callback: (rootPath: string) => Promise, + callback: (rootPath: string) => void | Promise, ): Promise => { const rootPath = mkdtempSync(path.join(import.meta.dirname, 'test-temp-fmt-')); // Prevent repository-level ignore rules from affecting the fixture. diff --git a/packages/rstack/tests/fmt/lsp/server.test.ts b/packages/rstack/tests/fmt/lsp/server.test.ts index c84475a8..597ca968 100644 --- a/packages/rstack/tests/fmt/lsp/server.test.ts +++ b/packages/rstack/tests/fmt/lsp/server.test.ts @@ -4,7 +4,7 @@ import { createDocumentEdits } from '../../../src/fmt/lsp/server.ts'; test('maps the edit onto the formatted document', async () => { const edits = await createDocumentEdits( () => 'const a = 1;\nconst b=2;\n', - async () => 'const a = 1;\nconst b = 2;\n', + () => Promise.resolve('const a = 1;\nconst b = 2;\n'), ); expect(edits).toEqual([ @@ -18,15 +18,15 @@ test('maps the edit onto the formatted document', async () => { test('returns no edits for an already formatted document', async () => { const getText = () => 'const a = 1;\n'; - expect(await createDocumentEdits(getText, async () => 'const a = 1;\n')).toEqual([]); - expect(await createDocumentEdits(getText, async () => undefined)).toEqual([]); + expect(await createDocumentEdits(getText, () => Promise.resolve('const a = 1;\n'))).toEqual([]); + expect(await createDocumentEdits(getText, () => Promise.resolve(undefined))).toEqual([]); }); test('returns no edits for a document that is not open', async () => { expect( await createDocumentEdits( () => undefined, - async () => '', + () => Promise.resolve(''), ), ).toEqual([]); }); @@ -38,10 +38,10 @@ test('returns no edits when the document changes while it is formatted', async ( const edits = await createDocumentEdits( () => text, - async (source) => { + (source) => { text = 'const b=2;\n'; - return source.replace('const b=2;', 'const b = 2;'); + return Promise.resolve(source.replace('const b=2;', 'const b = 2;')); }, ); diff --git a/packages/rstack/tests/fmt/plugins.test.ts b/packages/rstack/tests/fmt/plugins.test.ts index 162b3e69..842c6db4 100644 --- a/packages/rstack/tests/fmt/plugins.test.ts +++ b/packages/rstack/tests/fmt/plugins.test.ts @@ -4,7 +4,7 @@ import { createFingerprintResolver, createPluginResolver } from '../../src/fmt/p import { withTempProject, writeProjectFile } from './helpers.ts'; test('resolves plugin specifiers from the config root', async () => { - await withTempProject(async (rootPath) => { + await withTempProject((rootPath) => { const packageEntry = writeProjectFile( rootPath, 'node_modules/prettier-plugin-packagejson/import.mjs', diff --git a/packages/rstack/tests/setup/install.test.ts b/packages/rstack/tests/setup/install.test.ts index 355d77c7..a64ea7c7 100644 --- a/packages/rstack/tests/setup/install.test.ts +++ b/packages/rstack/tests/setup/install.test.ts @@ -79,7 +79,7 @@ test('resolves repository context with a single Git process when unchanged', () const starts = readFileSync(tracePath, 'utf8') .trim() .split('\n') - .map((line) => JSON.parse(line)) + .map((line) => JSON.parse(line) as { argv: string[]; event: string }) .filter((event) => event.event === 'start'); expect(starts).toHaveLength(1); expect(starts[0].argv).toContain('rev-parse'); diff --git a/packages/rstack/tests/types/resolution-bundler/index.ts b/packages/rstack/tests/types/resolution-bundler/index.ts index 44477318..c464b7f6 100644 --- a/packages/rstack/tests/types/resolution-bundler/index.ts +++ b/packages/rstack/tests/types/resolution-bundler/index.ts @@ -23,7 +23,7 @@ const configs: Configs = {}; void loadedConfig; void configs; -createRsbuild({ config: appConfig }); +void createRsbuild({ config: appConfig }); define.app(appConfig); define.lib(libConfig); define.doc({}); diff --git a/packages/rstack/tests/types/resolution-nodenext/index.ts b/packages/rstack/tests/types/resolution-nodenext/index.ts index 95bf176a..4b8d3f0a 100644 --- a/packages/rstack/tests/types/resolution-nodenext/index.ts +++ b/packages/rstack/tests/types/resolution-nodenext/index.ts @@ -23,7 +23,7 @@ const configs: Configs = {}; void loadedConfig; void configs; -createRsbuild({ config: appConfig }); +void createRsbuild({ config: appConfig }); define.app(appConfig); define.lib(libConfig); define.doc({}); diff --git a/rstack.config.ts b/rstack.config.ts index 0ad535cf..d6d1bce2 100644 --- a/rstack.config.ts +++ b/rstack.config.ts @@ -6,7 +6,7 @@ define.lint(async () => { const { js, ts } = await import('rstack/lint'); return [ js.configs.recommended, - ts.configs.recommended, + ts.configs.recommendedTypeChecked, { files: ['**/*.{js,jsx,cjs,mjs}'], languageOptions: { From 8b18ff6f5176a73ed5a171bab185cb379ec5359e Mon Sep 17 00:00:00 2001 From: Jiahan Chen Date: Thu, 13 Aug 2026 11:23:36 +0800 Subject: [PATCH 08/11] chore(create-rstack): enable type-aware linting in templates (#340) --- packages/create-rstack/template-app-lit-ts/rstack.config.ts | 2 +- .../create-rstack/template-app-preact-ts/rstack.config.ts | 2 +- .../create-rstack/template-app-react-ts/rstack.config.ts | 2 +- .../create-rstack/template-app-solid-ts/rstack.config.ts | 2 +- .../create-rstack/template-app-svelte-ts/rstack.config.ts | 2 +- .../create-rstack/template-app-vanilla-ts/rstack.config.ts | 2 +- packages/create-rstack/template-app-vue-ts/rstack.config.ts | 2 +- packages/create-rstack/template-app-vue-ts/src/env.d.ts | 6 ++++++ packages/create-rstack/template-doc-i18n/rstack.config.ts | 2 +- packages/create-rstack/template-doc/rstack.config.ts | 2 +- .../create-rstack/template-lib-node-ts/rstack.config.ts | 2 +- .../create-rstack/template-lib-react-ts/rstack.config.ts | 2 +- .../create-rstack/template-lib-solid-ts/rstack.config.ts | 2 +- .../create-rstack/template-lib-svelte-ts/rstack.config.ts | 2 +- packages/create-rstack/template-lib-vue-ts/rstack.config.ts | 2 +- packages/create-rstack/tests/create.test.ts | 3 +++ 16 files changed, 23 insertions(+), 14 deletions(-) create mode 100644 packages/create-rstack/template-app-vue-ts/src/env.d.ts diff --git a/packages/create-rstack/template-app-lit-ts/rstack.config.ts b/packages/create-rstack/template-app-lit-ts/rstack.config.ts index cdfe0ac0..1dac3261 100644 --- a/packages/create-rstack/template-app-lit-ts/rstack.config.ts +++ b/packages/create-rstack/template-app-lit-ts/rstack.config.ts @@ -19,7 +19,7 @@ define.test({ define.lint(async () => { const { js, ts } = await import('rstack/lint'); - return [js.configs.recommended, ts.configs.recommended]; + return [js.configs.recommended, ts.configs.recommendedTypeChecked]; }); define.fmt({ diff --git a/packages/create-rstack/template-app-preact-ts/rstack.config.ts b/packages/create-rstack/template-app-preact-ts/rstack.config.ts index 9ee763c8..8bf4f073 100644 --- a/packages/create-rstack/template-app-preact-ts/rstack.config.ts +++ b/packages/create-rstack/template-app-preact-ts/rstack.config.ts @@ -18,7 +18,7 @@ define.lint(async () => { return [ js.configs.recommended, - ts.configs.recommended, + ts.configs.recommendedTypeChecked, reactPlugin.configs.recommended, reactHooksPlugin.configs.recommended, ]; diff --git a/packages/create-rstack/template-app-react-ts/rstack.config.ts b/packages/create-rstack/template-app-react-ts/rstack.config.ts index 356c98e1..1cbfbf46 100644 --- a/packages/create-rstack/template-app-react-ts/rstack.config.ts +++ b/packages/create-rstack/template-app-react-ts/rstack.config.ts @@ -18,7 +18,7 @@ define.lint(async () => { return [ js.configs.recommended, - ts.configs.recommended, + ts.configs.recommendedTypeChecked, reactPlugin.configs.recommended, reactHooksPlugin.configs.recommended, ]; diff --git a/packages/create-rstack/template-app-solid-ts/rstack.config.ts b/packages/create-rstack/template-app-solid-ts/rstack.config.ts index 355d1b46..6aac365b 100644 --- a/packages/create-rstack/template-app-solid-ts/rstack.config.ts +++ b/packages/create-rstack/template-app-solid-ts/rstack.config.ts @@ -22,7 +22,7 @@ define.test({ define.lint(async () => { const { js, ts } = await import('rstack/lint'); - return [js.configs.recommended, ts.configs.recommended]; + return [js.configs.recommended, ts.configs.recommendedTypeChecked]; }); define.fmt({ diff --git a/packages/create-rstack/template-app-svelte-ts/rstack.config.ts b/packages/create-rstack/template-app-svelte-ts/rstack.config.ts index 66320b37..e834b53d 100644 --- a/packages/create-rstack/template-app-svelte-ts/rstack.config.ts +++ b/packages/create-rstack/template-app-svelte-ts/rstack.config.ts @@ -16,7 +16,7 @@ define.test({ define.lint(async () => { const { js, ts } = await import('rstack/lint'); - return [js.configs.recommended, ts.configs.recommended]; + return [js.configs.recommended, ts.configs.recommendedTypeChecked]; }); define.fmt({ diff --git a/packages/create-rstack/template-app-vanilla-ts/rstack.config.ts b/packages/create-rstack/template-app-vanilla-ts/rstack.config.ts index 349fcfae..5476c2c8 100644 --- a/packages/create-rstack/template-app-vanilla-ts/rstack.config.ts +++ b/packages/create-rstack/template-app-vanilla-ts/rstack.config.ts @@ -12,7 +12,7 @@ define.test({ define.lint(async () => { const { js, ts } = await import('rstack/lint'); - return [js.configs.recommended, ts.configs.recommended]; + return [js.configs.recommended, ts.configs.recommendedTypeChecked]; }); define.fmt({ diff --git a/packages/create-rstack/template-app-vue-ts/rstack.config.ts b/packages/create-rstack/template-app-vue-ts/rstack.config.ts index f2224449..12ea8e76 100644 --- a/packages/create-rstack/template-app-vue-ts/rstack.config.ts +++ b/packages/create-rstack/template-app-vue-ts/rstack.config.ts @@ -16,7 +16,7 @@ define.test({ define.lint(async () => { const { js, ts } = await import('rstack/lint'); - return [js.configs.recommended, ts.configs.recommended]; + return [js.configs.recommended, ts.configs.recommendedTypeChecked]; }); define.fmt({ diff --git a/packages/create-rstack/template-app-vue-ts/src/env.d.ts b/packages/create-rstack/template-app-vue-ts/src/env.d.ts new file mode 100644 index 00000000..8afcdfbb --- /dev/null +++ b/packages/create-rstack/template-app-vue-ts/src/env.d.ts @@ -0,0 +1,6 @@ +declare module '*.vue' { + import type { DefineComponent } from 'vue'; + + const component: DefineComponent; + export default component; +} diff --git a/packages/create-rstack/template-doc-i18n/rstack.config.ts b/packages/create-rstack/template-doc-i18n/rstack.config.ts index 2ab17eff..8e1f8435 100644 --- a/packages/create-rstack/template-doc-i18n/rstack.config.ts +++ b/packages/create-rstack/template-doc-i18n/rstack.config.ts @@ -28,7 +28,7 @@ define.lint(async () => { return [ js.configs.recommended, - ts.configs.recommended, + ts.configs.recommendedTypeChecked, reactPlugin.configs.recommended, reactHooksPlugin.configs.recommended, ]; diff --git a/packages/create-rstack/template-doc/rstack.config.ts b/packages/create-rstack/template-doc/rstack.config.ts index 466b9d5c..77378cff 100644 --- a/packages/create-rstack/template-doc/rstack.config.ts +++ b/packages/create-rstack/template-doc/rstack.config.ts @@ -12,7 +12,7 @@ define.lint(async () => { return [ js.configs.recommended, - ts.configs.recommended, + ts.configs.recommendedTypeChecked, reactPlugin.configs.recommended, reactHooksPlugin.configs.recommended, ]; diff --git a/packages/create-rstack/template-lib-node-ts/rstack.config.ts b/packages/create-rstack/template-lib-node-ts/rstack.config.ts index d0f94060..dc33795b 100644 --- a/packages/create-rstack/template-lib-node-ts/rstack.config.ts +++ b/packages/create-rstack/template-lib-node-ts/rstack.config.ts @@ -13,7 +13,7 @@ define.test({ define.lint(async () => { const { js, ts } = await import('rstack/lint'); - return [js.configs.recommended, ts.configs.recommended]; + return [js.configs.recommended, ts.configs.recommendedTypeChecked]; }); define.fmt({ diff --git a/packages/create-rstack/template-lib-react-ts/rstack.config.ts b/packages/create-rstack/template-lib-react-ts/rstack.config.ts index 89cb5d03..b131e4a8 100644 --- a/packages/create-rstack/template-lib-react-ts/rstack.config.ts +++ b/packages/create-rstack/template-lib-react-ts/rstack.config.ts @@ -28,7 +28,7 @@ define.lint(async () => { return [ js.configs.recommended, - ts.configs.recommended, + ts.configs.recommendedTypeChecked, reactPlugin.configs.recommended, reactHooksPlugin.configs.recommended, ]; diff --git a/packages/create-rstack/template-lib-solid-ts/rstack.config.ts b/packages/create-rstack/template-lib-solid-ts/rstack.config.ts index 25c187d5..02bc776f 100644 --- a/packages/create-rstack/template-lib-solid-ts/rstack.config.ts +++ b/packages/create-rstack/template-lib-solid-ts/rstack.config.ts @@ -78,7 +78,7 @@ define.test(async () => { define.lint(async () => { const { js, ts } = await import('rstack/lint'); - return [js.configs.recommended, ts.configs.recommended]; + return [js.configs.recommended, ts.configs.recommendedTypeChecked]; }); define.fmt({ diff --git a/packages/create-rstack/template-lib-svelte-ts/rstack.config.ts b/packages/create-rstack/template-lib-svelte-ts/rstack.config.ts index 3ac5f03d..0844c4e2 100644 --- a/packages/create-rstack/template-lib-svelte-ts/rstack.config.ts +++ b/packages/create-rstack/template-lib-svelte-ts/rstack.config.ts @@ -26,7 +26,7 @@ define.test({ define.lint(async () => { const { js, ts } = await import('rstack/lint'); - return [js.configs.recommended, ts.configs.recommended]; + return [js.configs.recommended, ts.configs.recommendedTypeChecked]; }); define.fmt({ diff --git a/packages/create-rstack/template-lib-vue-ts/rstack.config.ts b/packages/create-rstack/template-lib-vue-ts/rstack.config.ts index e9c37a60..a372eb1d 100644 --- a/packages/create-rstack/template-lib-vue-ts/rstack.config.ts +++ b/packages/create-rstack/template-lib-vue-ts/rstack.config.ts @@ -25,7 +25,7 @@ define.test({ define.lint(async () => { const { js, ts } = await import('rstack/lint'); - return [js.configs.recommended, ts.configs.recommended]; + return [js.configs.recommended, ts.configs.recommendedTypeChecked]; }); define.fmt({ diff --git a/packages/create-rstack/tests/create.test.ts b/packages/create-rstack/tests/create.test.ts index 32576411..08c23d7e 100644 --- a/packages/create-rstack/tests/create.test.ts +++ b/packages/create-rstack/tests/create.test.ts @@ -205,6 +205,9 @@ test.each(sourceTemplates)( if (template.startsWith('app-')) { files.push('README.md', '.gitignore'); } + if (template === 'app-vue-ts') { + files.push('src/env.d.ts'); + } await expectProjectSetup(projectDirectory, template, configExtension, hasTypeScript); await expectFiles(projectDirectory, files); From 11c56cd4ead1fd5110cb2aee3a2fa4855d89d6c6 Mon Sep 17 00:00:00 2001 From: Jiahan Chen Date: Thu, 13 Aug 2026 12:53:07 +0800 Subject: [PATCH 09/11] perf(fmt): optimize cache serialization (#341) --- packages/rstack/src/fmt/cacheIdentity.ts | 16 +- packages/rstack/src/fmt/cacheStore.ts | 226 +++++++++++++----- packages/rstack/src/fmt/runner.ts | 2 +- packages/rstack/src/fmt/worker.ts | 7 +- packages/rstack/tests/cli/fmt/cache.test.ts | 47 ++-- .../rstack/tests/fmt/cacheIdentity.test.ts | 11 +- packages/rstack/tests/fmt/cacheStore.test.ts | 98 +++++--- packages/rstack/tests/fmt/runnerCache.test.ts | 37 +-- .../tests/fmt/runnerWorkerPreflight.test.ts | 2 +- packages/rstack/tests/fmt/worker.test.ts | 14 +- 10 files changed, 304 insertions(+), 156 deletions(-) diff --git a/packages/rstack/src/fmt/cacheIdentity.ts b/packages/rstack/src/fmt/cacheIdentity.ts index 0bbdbbe1..f7ba278d 100644 --- a/packages/rstack/src/fmt/cacheIdentity.ts +++ b/packages/rstack/src/fmt/cacheIdentity.ts @@ -1,4 +1,4 @@ -import { hash } from 'node:crypto'; +import { hash as createDigest } from 'node:crypto'; import { isAbsolute } from 'node:path'; import stableStringify from 'fast-json-stable-stringify'; import { fmtCacheVersion } from './cacheStore.ts'; @@ -12,7 +12,9 @@ type CacheKeyResolver = (filePath: string) => string | undefined; type OptionsHasher = (options: ResolvedFmtOptions) => string | undefined; type PluginFingerprints = ReadonlyMap; -const sha256 = (content: string | Uint8Array): string => hash('sha256', content, 'hex'); +const cacheHashLength = 16; +const createCacheHash = (content: string | Uint8Array): string => + createDigest('sha256', content, 'base64url').slice(0, cacheHashLength); /** Identifies formatter behavior shared by all cache entries in this process. */ const cacheNamespace: string = JSON.stringify([fmtCacheVersion, RSTACK_VERSION, PRETTIER_VERSION]); @@ -55,7 +57,7 @@ const createOptionsHasher = (pluginFingerprints?: PluginFingerprints): OptionsHa } value = { ...options, plugins: fingerprints }; } - hash = sha256(stableStringify(value)); + hash = createCacheHash(stableStringify(value)); } catch { // Circular or unreadable options cannot be cached. } @@ -65,4 +67,10 @@ const createOptionsHasher = (pluginFingerprints?: PluginFingerprints): OptionsHa }; }; -export { cacheNamespace, createCacheKeyResolver, createOptionsHasher, sha256 }; +export { + cacheHashLength, + cacheNamespace, + createCacheHash, + createCacheKeyResolver, + createOptionsHasher, +}; diff --git a/packages/rstack/src/fmt/cacheStore.ts b/packages/rstack/src/fmt/cacheStore.ts index dfc47b60..0dcf3292 100644 --- a/packages/rstack/src/fmt/cacheStore.ts +++ b/packages/rstack/src/fmt/cacheStore.ts @@ -2,18 +2,40 @@ import { randomUUID } from 'node:crypto'; import { mkdir, readFile, rename, rm, writeFile } from 'node:fs/promises'; import path from 'node:path'; -const fmtCacheFileName = 'v1.json'; -const fmtCacheVersion = 1; +const fmtCacheFileName = 'cache.json'; +const fmtCacheVersion = 2; -type FmtCacheState = 'clean' | 'dirty' | 'unsupported'; -type FmtCacheEntry = - | readonly [contentHash: string, optionsHash: string, state: 'clean' | 'dirty'] - | readonly [contentHash: string | null, optionsHash: string, state: 'unsupported']; +const fileEntryWidth = 4; +const contentHashOffset = 1; +const optionsIndexOffset = 2; +const stateOffset = 3; + +const fmtCacheStates = ['clean', 'dirty', 'unsupported'] as const; +type FmtCacheState = (typeof fmtCacheStates)[number]; +type FmtCacheStateId = 0 | 1 | 2; + +const fmtCacheStateIds = { + clean: 0, + dirty: 1, + unsupported: 2, +} as const satisfies Record; + +type FmtCacheFileValue = string | number; +type FmtCacheEntry = readonly [contentHash: string, optionsHash: string, state: FmtCacheState]; interface FmtCacheFile { version: typeof fmtCacheVersion; namespace: string; - files: Record; + options: string[]; + /** Repeated tuples of file path, content hash, options index, and numeric state. */ + files: FmtCacheFileValue[]; +} + +interface ParsedFmtCacheFile { + cache: FmtCacheFile; + fileOffsets: Map; + optionsIndexes: Map; + optionsUseCounts: number[]; } interface FmtCacheStore { @@ -23,30 +45,19 @@ interface FmtCacheStore { save(): Promise; } -const createEmptyCache = (namespace: string): FmtCacheFile => ({ - version: fmtCacheVersion, - namespace, - files: Object.create(null) as Record, +const createEmptyCache = (namespace: string): ParsedFmtCacheFile => ({ + cache: { + version: fmtCacheVersion, + namespace, + options: [], + files: [], + }, + fileOffsets: new Map(), + optionsIndexes: new Map(), + optionsUseCounts: [], }); -const parseCacheEntry = (value: unknown): FmtCacheEntry | undefined => { - if (!Array.isArray(value) || value.length !== 3 || typeof value[1] !== 'string') { - return; - } - - if (value[2] === 'unsupported') { - return value[0] === null || typeof value[0] === 'string' - ? [value[0], value[1], value[2]] - : undefined; - } - if (typeof value[0] !== 'string' || (value[2] !== 'clean' && value[2] !== 'dirty')) { - return; - } - - return [value[0], value[1], value[2]]; -}; - -const parseCacheFile = (content: string): FmtCacheFile | undefined => { +const parseCacheFile = (content: string): ParsedFmtCacheFile | undefined => { let value: unknown; try { value = JSON.parse(content); @@ -54,35 +65,41 @@ const parseCacheFile = (content: string): FmtCacheFile | undefined => { return; } + if (typeof value !== 'object' || value === null || Array.isArray(value)) { + return; + } + + const cache = value as FmtCacheFile; + const { version, namespace, options, files } = cache; if ( - typeof value !== 'object' || - value === null || - Array.isArray(value) || - !('version' in value) || - value.version !== fmtCacheVersion || - !('namespace' in value) || - typeof value.namespace !== 'string' || - !('files' in value) || - typeof value.files !== 'object' || - value.files === null || - Array.isArray(value.files) + version !== fmtCacheVersion || + typeof namespace !== 'string' || + !Array.isArray(options) || + !Array.isArray(files) || + files.length % fileEntryWidth !== 0 ) { return; } - const files = Object.create(null) as Record; - for (const [filePath, rawEntry] of Object.entries(value.files)) { - const entry = parseCacheEntry(rawEntry); - if (!entry) { - return; - } - files[filePath] = entry; + const optionsIndexes = new Map(); + for (let index = 0; index < options.length; index++) { + optionsIndexes.set(options[index], index); + } + + const fileOffsets = new Map(); + const optionsUseCounts = new Array(options.length).fill(0); + for (let offset = 0; offset < files.length; offset += fileEntryWidth) { + const filePath = files[offset] as string; + const optionsIndex = files[offset + optionsIndexOffset] as number; + fileOffsets.set(filePath, offset); + optionsUseCounts[optionsIndex]++; } return { - version: fmtCacheVersion, - namespace: value.namespace, - files, + cache, + fileOffsets, + optionsIndexes, + optionsUseCounts, }; }; @@ -100,43 +117,124 @@ const getTemporaryPath = (filePath: string): string => class FmtCacheStoreImpl implements FmtCacheStore { readonly #filePath: string; readonly #cache: FmtCacheFile; + readonly #fileOffsets: Map; + readonly #optionsIndexes: Map; + readonly #optionsUseCounts: number[]; #savedContent: string | undefined; #changed: boolean; constructor( filePath: string, - cache: FmtCacheFile, + parsed: ParsedFmtCacheFile, savedContent: string | undefined, changed: boolean, ) { this.#filePath = filePath; - this.#cache = cache; + this.#cache = parsed.cache; + this.#fileOffsets = parsed.fileOffsets; + this.#optionsIndexes = parsed.optionsIndexes; + this.#optionsUseCounts = parsed.optionsUseCounts; this.#savedContent = savedContent; this.#changed = changed; } get(filePath: string): FmtCacheEntry | undefined { - return this.#cache.files[filePath]; + const offset = this.#fileOffsets.get(filePath); + if (offset === undefined) { + return; + } + + const { files, options } = this.#cache; + const contentHash = files[offset + contentHashOffset] as string; + const optionsHash = options[files[offset + optionsIndexOffset] as number]; + const state = fmtCacheStates[files[offset + stateOffset] as FmtCacheStateId]; + return [contentHash, optionsHash, state]; } set(filePath: string, entry: FmtCacheEntry): void { - const current = this.#cache.files[filePath]; - if (current?.[0] === entry[0] && current[1] === entry[1] && current[2] === entry[2]) { - return; + const { files, options } = this.#cache; + const [contentHash, optionsHash, state] = entry; + const stateId = fmtCacheStateIds[state]; + const offset = this.#fileOffsets.get(filePath); + + if (offset !== undefined) { + const currentOptionsIndex = files[offset + optionsIndexOffset] as number; + if ( + files[offset + contentHashOffset] === contentHash && + options[currentOptionsIndex] === optionsHash && + files[offset + stateOffset] === stateId + ) { + return; + } + + const optionsIndex = this.#getOrCreateOptionsIndex(optionsHash); + if (currentOptionsIndex !== optionsIndex) { + this.#optionsUseCounts[currentOptionsIndex]--; + this.#optionsUseCounts[optionsIndex]++; + files[offset + optionsIndexOffset] = optionsIndex; + } + files[offset + contentHashOffset] = contentHash; + files[offset + stateOffset] = stateId; + } else { + const optionsIndex = this.#getOrCreateOptionsIndex(optionsHash); + const nextOffset = files.length; + files.push(filePath, contentHash, optionsIndex, stateId); + this.#fileOffsets.set(filePath, nextOffset); + this.#optionsUseCounts[optionsIndex]++; } - this.#cache.files[filePath] = - entry[2] === 'unsupported' - ? [entry[0], entry[1], 'unsupported'] - : [entry[0], entry[1], entry[2]]; this.#changed = true; } + #getOrCreateOptionsIndex(optionsHash: string): number { + const current = this.#optionsIndexes.get(optionsHash); + if (current !== undefined) { + return current; + } + + const index = this.#cache.options.length; + this.#cache.options.push(optionsHash); + this.#optionsIndexes.set(optionsHash, index); + this.#optionsUseCounts.push(0); + return index; + } + + #compactUnusedOptions(): void { + if (!this.#optionsUseCounts.includes(0)) { + return; + } + + const { files, options } = this.#cache; + const nextOptions: string[] = []; + const nextUseCounts: number[] = []; + const remappedIndexes = new Int32Array(options.length).fill(-1); + for (let index = 0; index < options.length; index++) { + const useCount = this.#optionsUseCounts[index]; + if (useCount > 0) { + remappedIndexes[index] = nextOptions.length; + nextOptions.push(options[index]); + nextUseCounts.push(useCount); + } + } + for (let offset = 0; offset < files.length; offset += fileEntryWidth) { + const currentIndex = files[offset + optionsIndexOffset] as number; + files[offset + optionsIndexOffset] = remappedIndexes[currentIndex]; + } + + options.splice(0, options.length, ...nextOptions); + this.#optionsUseCounts.splice(0, this.#optionsUseCounts.length, ...nextUseCounts); + this.#optionsIndexes.clear(); + for (let index = 0; index < options.length; index++) { + this.#optionsIndexes.set(options[index], index); + } + } + async save(): Promise { if (!this.#changed) { return false; } + this.#compactUnusedOptions(); const content = serializeCache(this.#cache); if (content === this.#savedContent) { this.#changed = false; @@ -164,13 +262,13 @@ const loadFmtCacheStore = async (filePath: string, namespace: string): Promise { return false; } return ( - cache.entry[0] === null && + cache.entry[0] === '' && cache.entry[1] === cache.optionsHash && cache.entry[2] === 'unsupported' && hasDottedBasename(file.path) diff --git a/packages/rstack/src/fmt/worker.ts b/packages/rstack/src/fmt/worker.ts index 1befd4ce..6e6505aa 100644 --- a/packages/rstack/src/fmt/worker.ts +++ b/packages/rstack/src/fmt/worker.ts @@ -12,7 +12,8 @@ interface FormatFileTask { cache?: FmtFileCache; } -const hashContent = (content: string | Uint8Array): string => hash('sha256', content, 'hex'); +const hashContent = (content: string | Uint8Array): string => + hash('sha256', content, 'base64url').slice(0, 16); /** * Use synchronous direct I/O inside the dedicated worker to avoid libuv @@ -44,7 +45,7 @@ const formatFile = async ({ if (cache?.entry && cache.entry[1] === cache.optionsHash) { const { entry } = cache; if (entry[2] === 'unsupported') { - if (entry[0] === null) { + if (entry[0] === '') { if (hasDottedBasename(file.path)) { return { status: 'unsupported' }; } @@ -72,7 +73,7 @@ const formatFile = async ({ status: 'unsupported', cacheEntry: [ hasDottedBasename(file.path) - ? null + ? '' : (contentHash ?? hashContent(sourceBuffer ?? readFileSync(file.path))), cache.optionsHash, 'unsupported', diff --git a/packages/rstack/tests/cli/fmt/cache.test.ts b/packages/rstack/tests/cli/fmt/cache.test.ts index 15e51dea..12c112e2 100644 --- a/packages/rstack/tests/cli/fmt/cache.test.ts +++ b/packages/rstack/tests/cli/fmt/cache.test.ts @@ -4,6 +4,27 @@ import { expectWriteSummary, normalizeDuration, setupFmtTest } from './helpers.t const { projectFileExists, readProjectFile, resolveProjectPath, runFmt, writeProjectFile } = setupFmtTest(); +interface SerializedFmtCache { + version: number; + namespace: string; + options: string[]; + files: (string | number)[]; +} + +const readFmtCache = (filePath: string): SerializedFmtCache => + JSON.parse(readProjectFile(filePath)) as SerializedFmtCache; + +const expectSingleCleanEntry = (cache: SerializedFmtCache, filePath: string): void => { + expect(cache.version).toBe(2); + expect(typeof cache.namespace).toBe('string'); + expect(cache.options).toHaveLength(1); + expect(cache.options[0]).toHaveLength(16); + expect(cache.files).toHaveLength(4); + expect(cache.files[0]).toBe(filePath); + expect(cache.files[1]).toEqual(expect.any(String)); + expect(cache.files.slice(2)).toEqual([0, 0]); +}; + test.each([ ['write', []], ['check', ['--check']], @@ -16,12 +37,7 @@ test.each([ expect(result.status).toBe(0); expect(readProjectFile('.rstack/cache/.gitignore')).toBe('*\n'); - expect(JSON.parse(readProjectFile('.rstack/cache/fmt/v1.json'))).toMatchObject({ - version: 1, - files: { - 'index.ts': [expect.any(String), expect.any(String), 'clean'], - }, - }); + expectSingleCleanEntry(readFmtCache('.rstack/cache/fmt/cache.json'), 'index.ts'); expect(readProjectFile('.rstack/cache/fmt-v1.json')).toBe('legacy'); }); @@ -58,12 +74,7 @@ test.each(['relative', 'absolute'] as const)('uses a %s custom cache location', const result = runFmt(['--cache-location', cacheLocation, 'index.ts']); expect(result.status).toBe(0); - expect(JSON.parse(readProjectFile('custom-cache/v1.json'))).toMatchObject({ - version: 1, - files: { - 'index.ts': [expect.any(String), expect.any(String), 'clean'], - }, - }); + expectSingleCleanEntry(readFmtCache('custom-cache/cache.json'), 'index.ts'); expect(projectFileExists('custom-cache/.gitignore')).toBe(false); expect(projectFileExists('.rstack')).toBe(false); }); @@ -99,26 +110,22 @@ test('uses an explicit config root cache from a subdirectory', () => { expect(result.status).toBe(0); expect(readProjectFile('packages/app/index.ts')).toBe('const value = 1;\n'); - expect(projectFileExists('.rstack/cache/fmt/v1.json')).toBe(true); + expect(projectFileExists('.rstack/cache/fmt/cache.json')).toBe(true); expect(projectFileExists('packages/app/.rstack')).toBe(false); - expect(JSON.parse(readProjectFile('.rstack/cache/fmt/v1.json'))).toMatchObject({ - files: { - 'packages/app/index.ts': [expect.any(String), expect.any(String), 'clean'], - }, - }); + expectSingleCleanEntry(readFmtCache('.rstack/cache/fmt/cache.json'), 'packages/app/index.ts'); }); test('recovers from a corrupted cache', () => { writeProjectFile('index.ts', 'const value = 1;\n'); const first = runFmt(['--check', 'index.ts']); - writeProjectFile('.rstack/cache/fmt/v1.json', '{'); + writeProjectFile('.rstack/cache/fmt/cache.json', '{'); const second = runFmt(['--check', 'index.ts']); expect(second.status).toBe(0); expect(normalizeDuration(second.stdout)).toBe(normalizeDuration(first.stdout)); expect(second.stderr).toBe(first.stderr); - expect(JSON.parse(readProjectFile('.rstack/cache/fmt/v1.json'))).toMatchObject({ version: 1 }); + expect(JSON.parse(readProjectFile('.rstack/cache/fmt/cache.json'))).toMatchObject({ version: 2 }); }); test('formats without a writable cache directory', () => { diff --git a/packages/rstack/tests/fmt/cacheIdentity.test.ts b/packages/rstack/tests/fmt/cacheIdentity.test.ts index e0d48789..933b7229 100644 --- a/packages/rstack/tests/fmt/cacheIdentity.test.ts +++ b/packages/rstack/tests/fmt/cacheIdentity.test.ts @@ -4,10 +4,11 @@ import prettierPkgJson from 'prettier/package.json' with { type: 'json' }; import { expect, test } from 'rstack/test'; import pkgJson from '../../package.json' with { type: 'json' }; import { + cacheHashLength, cacheNamespace, + createCacheHash, createCacheKeyResolver, createOptionsHasher, - sha256, } from '../../src/fmt/cacheIdentity.ts'; import { fmtCacheVersion } from '../../src/fmt/cacheStore.ts'; import type { ResolvedFmtOptions } from '../../src/fmt/types.ts'; @@ -17,7 +18,7 @@ const rootPath = path.join(import.meta.dirname, 'project'); const asOptions = (value: Record): ResolvedFmtOptions => value as ResolvedFmtOptions; -test('creates stable SHA-256 option hashes', () => { +test('creates stable SHA-256-derived option hashes', () => { const hashOptions = createOptionsHasher(); const left: ResolvedFmtOptions = { singleQuote: true, @@ -29,8 +30,8 @@ test('creates stable SHA-256 option hashes', () => { }; expect(hashOptions(left)).toBe(hashOptions(right)); - expect(hashOptions(left)).toHaveLength(64); - expect(sha256('abc')).toBe('ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad'); + expect(hashOptions(left)).toHaveLength(cacheHashLength); + expect(createCacheHash('abc')).toBe('ungWv48Bz-pBQUDe'); }); test('invalidates hashes when final formatter options change', () => { @@ -52,7 +53,7 @@ test('includes plugin fingerprints in option hashes', () => { const first = createOptionsHasher(new Map([[plugin, 'plugin@1']])); const second = createOptionsHasher(new Map([[plugin, 'plugin@2']])); - expect(first({ plugins: [plugin] })).toHaveLength(64); + expect(first({ plugins: [plugin] })).toHaveLength(cacheHashLength); expect(first({ plugins: [new URL(plugin)] })).toBe(first({ plugins: [plugin] })); expect(first({ plugins: [plugin] })).not.toBe(second({ plugins: [plugin] })); }); diff --git a/packages/rstack/tests/fmt/cacheStore.test.ts b/packages/rstack/tests/fmt/cacheStore.test.ts index 713d804d..e6f038b7 100644 --- a/packages/rstack/tests/fmt/cacheStore.test.ts +++ b/packages/rstack/tests/fmt/cacheStore.test.ts @@ -1,21 +1,32 @@ import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from 'node:fs'; import path from 'node:path'; import { expect, test } from 'rstack/test'; -import { fmtCacheVersion, loadFmtCacheStore, type FmtCacheFile } from '../../src/fmt/cacheStore.ts'; +import { + fmtCacheFileName, + fmtCacheVersion, + loadFmtCacheStore, + type FmtCacheFile, +} from '../../src/fmt/cacheStore.ts'; import { withTempProject } from './helpers.ts'; const namespace = 'test-namespace'; -const firstEntry = ['content-a', 'options-a', 'clean'] as const; -const secondEntry = ['content-b', 'options-b', 'dirty'] as const; -const unsupportedEntry = [null, 'options-c', 'unsupported'] as const; -const hashedUnsupportedEntry = ['content-c', 'options-c', 'unsupported'] as const; +const contentA = 'content-a'; +const contentB = 'content-b'; +const contentC = 'content-c'; +const optionsA = 'options-a'; +const optionsB = 'options-b'; +const optionsC = 'options-c'; +const firstEntry = [contentA, optionsA, 'clean'] as const; +const secondEntry = [contentB, optionsB, 'dirty'] as const; +const unsupportedEntry = ['', optionsC, 'unsupported'] as const; +const hashedUnsupportedEntry = [contentC, optionsC, 'unsupported'] as const; const readCache = (filePath: string): FmtCacheFile => JSON.parse(readFileSync(filePath, 'utf8')) as FmtCacheFile; -test('writes entries that can be loaded by another store', async () => { +test('writes flat entries that can be loaded by another store', async () => { await withTempProject(async (rootPath) => { - const cachePath = path.join(rootPath, 'cache', 'fmt-v1.json'); + const cachePath = path.join(rootPath, 'cache', fmtCacheFileName); const store = await loadFmtCacheStore(cachePath, namespace); expect(await store.save()).toBe(false); @@ -26,6 +37,25 @@ test('writes entries that can be loaded by another store', async () => { store.set('script', hashedUnsupportedEntry); expect(await store.save()).toBe(true); expect(await store.save()).toBe(false); + expect(readCache(cachePath)).toEqual({ + version: fmtCacheVersion, + namespace, + options: [optionsA, optionsC], + files: [ + 'src/a.ts', + contentA, + 0, + 0, + 'src/unknown.fixture', + '', + 1, + 2, + 'script', + contentC, + 1, + 2, + ], + }); const loaded = await loadFmtCacheStore(cachePath, namespace); expect(loaded.get('src/a.ts')).toEqual(firstEntry); @@ -36,16 +66,14 @@ test('writes entries that can be loaded by another store', async () => { test('preserves unvisited entries and skips unchanged updates', async () => { await withTempProject(async (rootPath) => { - const cachePath = path.join(rootPath, 'fmt-v1.json'); + const cachePath = path.join(rootPath, fmtCacheFileName); writeFileSync( cachePath, `${JSON.stringify({ version: fmtCacheVersion, namespace, - files: { - 'src/a.ts': firstEntry, - 'src/b.ts': secondEntry, - }, + options: [optionsA, optionsB], + files: ['src/a.ts', contentA, 0, 0, 'src/b.ts', contentB, 1, 1], })}\n`, ); @@ -56,34 +84,30 @@ test('preserves unvisited entries and skips unchanged updates', async () => { store.set('src/a.ts', secondEntry); expect(await store.save()).toBe(true); - expect(readCache(cachePath).files).toEqual({ - 'src/a.ts': secondEntry, - 'src/b.ts': secondEntry, + expect(readCache(cachePath)).toEqual({ + version: fmtCacheVersion, + namespace, + options: [optionsB], + files: ['src/a.ts', contentB, 0, 1, 'src/b.ts', contentB, 0, 1], }); }); }); -test('discards invalid data and entries from another namespace', async () => { +test('discards invalid schemas and other namespaces', async () => { await withTempProject(async (rootPath) => { - const cachePath = path.join(rootPath, 'fmt-v1.json'); + const cachePath = path.join(rootPath, fmtCacheFileName); + const validCache = { + version: fmtCacheVersion, + namespace, + options: [optionsA], + files: ['src/a.ts', contentA, 0, 0], + }; const invalidContents = [ '{invalid', - JSON.stringify({ version: 2, namespace, files: {} }), - JSON.stringify({ - version: fmtCacheVersion, - namespace, - files: { 'src/a.ts': ['content', 'options', 'unknown'] }, - }), - JSON.stringify({ - version: fmtCacheVersion, - namespace, - files: { 'src/a.ts': [42, 'options', 'unsupported'] }, - }), - JSON.stringify({ - version: fmtCacheVersion, - namespace, - files: { 'src/a.ts': [null, 'options', 'clean'] }, - }), + JSON.stringify({ ...validCache, version: fmtCacheVersion - 1 }), + JSON.stringify({ version: fmtCacheVersion, namespace, files: [] }), + JSON.stringify({ ...validCache, files: { 'src/a.ts': firstEntry } }), + JSON.stringify({ ...validCache, files: ['src/a.ts', contentA, 0] }), ]; for (const content of invalidContents) { @@ -95,9 +119,8 @@ test('discards invalid data and entries from another namespace', async () => { writeFileSync( cachePath, JSON.stringify({ - version: fmtCacheVersion, + ...validCache, namespace: 'old-namespace', - files: { 'src/a.ts': firstEntry }, }), ); const store = await loadFmtCacheStore(cachePath, namespace); @@ -106,14 +129,15 @@ test('discards invalid data and entries from another namespace', async () => { expect(readCache(cachePath)).toEqual({ version: fmtCacheVersion, namespace, - files: {}, + options: [], + files: [], }); }); }); test('does not throw or leave temporary files when persistence fails', async () => { await withTempProject(async (rootPath) => { - const cachePath = path.join(rootPath, 'fmt-v1.json'); + const cachePath = path.join(rootPath, fmtCacheFileName); mkdirSync(cachePath); const store = await loadFmtCacheStore(cachePath, namespace); diff --git a/packages/rstack/tests/fmt/runnerCache.test.ts b/packages/rstack/tests/fmt/runnerCache.test.ts index f9432a94..e78a2ab0 100644 --- a/packages/rstack/tests/fmt/runnerCache.test.ts +++ b/packages/rstack/tests/fmt/runnerCache.test.ts @@ -2,7 +2,12 @@ import { readFileSync, statSync, utimesSync, writeFileSync } from 'node:fs'; import path from 'node:path'; import { pathToFileURL } from 'node:url'; import { expect, test } from 'rstack/test'; -import { cacheNamespace, createOptionsHasher, sha256 } from '../../src/fmt/cacheIdentity.ts'; +import { + cacheHashLength, + cacheNamespace, + createCacheHash, + createOptionsHasher, +} from '../../src/fmt/cacheIdentity.ts'; import { loadFmtCacheStore } from '../../src/fmt/cacheStore.ts'; import { runFmtFiles } from '../../src/fmt/runner.ts'; import type { FmtCacheContext, FmtFileRequest, FmtMode } from '../../src/fmt/types.ts'; @@ -36,12 +41,12 @@ for (const mode of ['check', 'list-different'] as const) { const store = await loadFmtCacheStore(cache.filePath, cacheNamespace); expect(store.get('clean.ts')).toEqual([ - sha256(readFileSync(cleanPath)), + createCacheHash(readFileSync(cleanPath)), expect.any(String), 'clean', ]); expect(store.get('dirty.ts')).toEqual([ - sha256(readFileSync(dirtyPath)), + createCacheHash(readFileSync(dirtyPath)), expect.any(String), 'dirty', ]); @@ -79,7 +84,11 @@ test('uses content hashes instead of file metadata', async () => { const secondStore = await loadFmtCacheStore(cache.filePath, cacheNamespace); const secondEntry = secondStore.get('index.ts'); - expect(secondEntry).toEqual([sha256(readFileSync(filePath)), expect.any(String), 'dirty']); + expect(secondEntry).toEqual([ + createCacheHash(readFileSync(filePath)), + expect.any(String), + 'dirty', + ]); expect(secondEntry?.[0]).not.toBe(firstEntry?.[0]); }); }); @@ -101,7 +110,7 @@ test('invalidates entries when final options change', async () => { const store = await loadFmtCacheStore(cache.filePath, cacheNamespace); expect(store.get('index.ts')).toEqual([ - sha256(readFileSync(filePath)), + createCacheHash(readFileSync(filePath)), createOptionsHasher()(changed.options), 'dirty', ]); @@ -121,7 +130,7 @@ test('caches unsupported parser results until final options change', async () => processedFileCount: 0, }); expect((await loadFmtCacheStore(cache.filePath, cacheNamespace)).get('data.unknown')).toEqual([ - null, + '', createOptionsHasher()(unsupported.options), 'unsupported', ]); @@ -135,7 +144,7 @@ test('caches unsupported parser results until final options change', async () => processedFileCount: 1, }); expect((await loadFmtCacheStore(cache.filePath, cacheNamespace)).get('data.unknown')).toEqual([ - sha256(readFileSync(filePath)), + createCacheHash(readFileSync(filePath)), createOptionsHasher()(supported.options), 'dirty', ]); @@ -155,7 +164,7 @@ test('invalidates cached unsupported parser results when content changes without processedFileCount: 0, }); expect((await loadFmtCacheStore(cache.filePath, cacheNamespace)).get('script')).toEqual([ - sha256(readFileSync(filePath)), + createCacheHash(readFileSync(filePath)), createOptionsHasher()(file.options), 'unsupported', ]); @@ -169,7 +178,7 @@ test('invalidates cached unsupported parser results when content changes without processedFileCount: 1, }); expect((await loadFmtCacheStore(cache.filePath, cacheNamespace)).get('script')).toEqual([ - sha256(readFileSync(filePath)), + createCacheHash(readFileSync(filePath)), createOptionsHasher()(file.options), 'dirty', ]); @@ -212,14 +221,14 @@ test('caches only plugins with stable fingerprints', async () => { const firstHash = (await loadFmtCacheStore(cache.filePath, cacheNamespace)).get( 'data.fixture', )?.[1]; - expect(firstHash).toHaveLength(64); + expect(firstHash).toHaveLength(cacheHashLength); writePackageJson('2.0.0'); await run([file], 'check', cache); const secondHash = (await loadFmtCacheStore(cache.filePath, cacheNamespace)).get( 'data.fixture', )?.[1]; - expect(secondHash).toHaveLength(64); + expect(secondHash).toHaveLength(cacheHashLength); expect(secondHash).not.toBe(firstHash); }); }); @@ -281,12 +290,12 @@ test('write persists clean results for misses and hits', async () => { const store = await loadFmtCacheStore(cache.filePath, cacheNamespace); expect(store.get('clean.ts')).toEqual([ - sha256(readFileSync(cleanPath)), + createCacheHash(readFileSync(cleanPath)), expect.any(String), 'clean', ]); expect(store.get('dirty.ts')).toEqual([ - sha256(readFileSync(dirtyPath)), + createCacheHash(readFileSync(dirtyPath)), expect.any(String), 'clean', ]); @@ -318,7 +327,7 @@ test('write converts a dirty entry to clean', async () => { const store = await loadFmtCacheStore(cache.filePath, cacheNamespace); expect(store.get('index.ts')).toEqual([ - sha256(readFileSync(filePath)), + createCacheHash(readFileSync(filePath)), expect.any(String), 'clean', ]); diff --git a/packages/rstack/tests/fmt/runnerWorkerPreflight.test.ts b/packages/rstack/tests/fmt/runnerWorkerPreflight.test.ts index 71d48662..7b9e3b87 100644 --- a/packages/rstack/tests/fmt/runnerWorkerPreflight.test.ts +++ b/packages/rstack/tests/fmt/runnerWorkerPreflight.test.ts @@ -34,7 +34,7 @@ const createCachedUnsupportedFile = async (rootPath: string, fileName: string) = } const store = await loadFmtCacheStore(cache.filePath, cacheNamespace); - store.set(fileName, [null, optionsHash, 'unsupported']); + store.set(fileName, ['', optionsHash, 'unsupported']); await expect(store.save()).resolves.toBe(true); return { cache, file }; diff --git a/packages/rstack/tests/fmt/worker.test.ts b/packages/rstack/tests/fmt/worker.test.ts index 6f3631d5..3ef3d3aa 100644 --- a/packages/rstack/tests/fmt/worker.test.ts +++ b/packages/rstack/tests/fmt/worker.test.ts @@ -1,7 +1,7 @@ import path from 'node:path'; import { readFileSync } from 'node:fs'; import { expect, test } from 'rstack/test'; -import { sha256 } from '../../src/fmt/cacheIdentity.ts'; +import { createCacheHash } from '../../src/fmt/cacheIdentity.ts'; import { formatFile } from '../../src/fmt/worker.ts'; import { withTempProject, writeProjectFile } from './helpers.ts'; @@ -11,7 +11,7 @@ test('returns cached states before resolving the parser', async () => { const filePath = writeProjectFile(rootPath, 'example.ts', source); const noExtensionPath = writeProjectFile(rootPath, 'script', source); const missingPath = path.join(rootPath, 'missing.unknown'); - const contentHash = sha256(source); + const contentHash = createCacheHash(source); const optionsHash = 'options'; for (const [entry, targetPath, shouldWrite, status] of [ @@ -20,8 +20,8 @@ test('returns cached states before resolving the parser', async () => { [[contentHash, optionsHash, 'clean'], filePath, true, 'unchanged'], [[contentHash, optionsHash, 'unsupported'], noExtensionPath, false, 'unsupported'], [[contentHash, optionsHash, 'unsupported'], noExtensionPath, true, 'unsupported'], - [[null, optionsHash, 'unsupported'], missingPath, false, 'unsupported'], - [[null, optionsHash, 'unsupported'], missingPath, true, 'unsupported'], + [['', optionsHash, 'unsupported'], missingPath, false, 'unsupported'], + [['', optionsHash, 'unsupported'], missingPath, true, 'unsupported'], ] as const) { await expect( formatFile({ @@ -54,13 +54,13 @@ test('does not trust path-only unsupported entries for files without extensions' }, shouldWrite: false, cache: { - entry: [null, 'options', 'unsupported'], + entry: ['', 'options', 'unsupported'], optionsHash: 'options', }, }), ).resolves.toEqual({ status: 'changed', - cacheEntry: [sha256(readFileSync(filePath)), 'options', 'dirty'], + cacheEntry: [createCacheHash(readFileSync(filePath)), 'options', 'dirty'], }); }); }); @@ -81,7 +81,7 @@ test('resolves parser support before reading on a cache miss', async () => { }), ).resolves.toEqual({ status: 'unsupported', - cacheEntry: [null, 'options', 'unsupported'], + cacheEntry: ['', 'options', 'unsupported'], }); }); }); From b4fa3e8a7d4cdad5ad2aefcf4b94f76d1645a30a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 13 Aug 2026 05:02:46 +0000 Subject: [PATCH 10/11] chore(deps): update all non-major dependencies (#343) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/lint.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/reusable-native-build.yml | 2 +- .github/workflows/reusable-native-release.yml | 2 +- .github/workflows/test.yml | 4 +- Cargo.lock | 23 +- Cargo.toml | 6 +- .../template-app-preact-ts/package.json | 2 +- .../template-app-preact/package.json | 2 +- .../template-app-react-ts/package.json | 2 +- .../template-app-react/package.json | 2 +- .../template-app-solid-ts/package.json | 2 +- .../template-app-solid/package.json | 2 +- .../template-app-svelte-ts/package.json | 2 +- .../template-app-svelte/package.json | 2 +- .../template-app-vanilla-ts/package.json | 2 +- .../template-app-vanilla/package.json | 2 +- .../template-app-vue-ts/package.json | 2 +- .../template-app-vue/package.json | 2 +- .../template-lib-react-ts/package.json | 2 +- .../template-lib-react/package.json | 2 +- .../template-lib-solid-ts/package.json | 2 +- .../template-lib-solid/package.json | 2 +- .../template-lib-svelte-ts/package.json | 2 +- .../template-lib-vue-ts/package.json | 2 +- .../template-lib-vue/package.json | 2 +- pnpm-lock.yaml | 451 ++++++++++++------ pnpm-workspace.yaml | 12 +- rust-toolchain.toml | 2 +- 29 files changed, 364 insertions(+), 180 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 795132ce..34138418 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -26,7 +26,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7 with: - node-version: 24.18.1 + node-version: 24.19.0 package-manager-cache: false - name: Install Pnpm diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b0e43c23..80e75760 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -71,7 +71,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: - node-version: 24.18.1 + node-version: 24.19.0 package-manager-cache: false - name: Setup Pnpm diff --git a/.github/workflows/reusable-native-build.yml b/.github/workflows/reusable-native-build.yml index d06dbd48..4809a263 100644 --- a/.github/workflows/reusable-native-build.yml +++ b/.github/workflows/reusable-native-build.yml @@ -35,7 +35,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7 with: - node-version: 24.18.1 + node-version: 24.19.0 package-manager-cache: false - name: Install Pnpm diff --git a/.github/workflows/reusable-native-release.yml b/.github/workflows/reusable-native-release.yml index 920a686e..f8643d3b 100644 --- a/.github/workflows/reusable-native-release.yml +++ b/.github/workflows/reusable-native-release.yml @@ -70,7 +70,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7 with: - node-version: 24.18.1 + node-version: 24.19.0 package-manager-cache: false - name: Install Pnpm diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e41dfec6..8a00db11 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,7 +27,7 @@ jobs: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 - - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 + - uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 id: changes with: predicate-quantifier: 'every' @@ -43,7 +43,7 @@ jobs: if: steps.changes.outputs.changed == 'true' uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7 with: - node-version: 24.18.1 + node-version: 24.19.0 package-manager-cache: false - name: Install Pnpm diff --git a/Cargo.lock b/Cargo.lock index 345a8ab6..93e66a42 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -190,6 +190,12 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "libc" +version = "0.2.189" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2" + [[package]] name = "libloading" version = "0.9.0" @@ -214,13 +220,14 @@ checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" [[package]] name = "napi" -version = "3.12.0" +version = "3.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f71d6bc097c4a6eb853c3f24991ab8c9f50f57d1f719e305175541482217e36" +checksum = "459197f1592f4c3dbbf9c1b13f5a4599a343e4ef66b96bc340e2a518b36a6662" dependencies = [ "bitflags", "ctor", "futures", + "libc", "napi-build", "napi-sys", "nohash-hasher", @@ -229,15 +236,15 @@ dependencies = [ [[package]] name = "napi-build" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5282704fbe8d49b0cf8b08e3f33233416a528658f205c7e5ace63b582de0b11c" +checksum = "60fdf9b392c50e7c4170fa633bd909490ed7835cea4c046776d1a4dd8d2ae0ab" [[package]] name = "napi-derive" -version = "3.6.2" +version = "3.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d9002b2940f0184444754546e0fcd15182f56948e6f381968b019d549387c42" +checksum = "0fa55ea69990c90b888e9e77044410e304ce7f35de599dc6d0b5c1923d2e59af" dependencies = [ "convert_case", "ctor", @@ -249,9 +256,9 @@ dependencies = [ [[package]] name = "napi-derive-backend" -version = "6.1.1" +version = "6.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d60b5d773ad46c698c8cc2cd9fde0b283d39cbb7f71c04bee633c7bdba4423bd" +checksum = "df4056ac7c18e4438ccf0edaed4340ca0d269278c8ec19284f7b23cb039fd0ae" dependencies = [ "convert_case", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index 4ce85357..f7e5884d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,9 +10,9 @@ rust-version = "1.88" [workspace.dependencies] ignore = { version = "0.4.33", default-features = false } -napi = { version = "3.12.0", default-features = false, features = ["napi9"] } -napi-build = "2.4.0" -napi-derive = "3.6.2" +napi = { version = "3.12.1", default-features = false, features = ["napi9"] } +napi-build = "2.4.1" +napi-derive = "3.6.3" pathdiff = "0.2.3" rstack-ignore = { path = "crates/rstack-ignore" } diff --git a/packages/create-rstack/template-app-preact-ts/package.json b/packages/create-rstack/template-app-preact-ts/package.json index 6c1c71c9..e2265be8 100644 --- a/packages/create-rstack/template-app-preact-ts/package.json +++ b/packages/create-rstack/template-app-preact-ts/package.json @@ -18,7 +18,7 @@ }, "devDependencies": { "@rsbuild/plugin-preact": "^2.0.0", - "@testing-library/jest-dom": "^7.0.0", + "@testing-library/jest-dom": "^7.0.1", "@testing-library/preact": "^3.2.4", "@types/node": "^24.13.3", "happy-dom": "^20.11.2", diff --git a/packages/create-rstack/template-app-preact/package.json b/packages/create-rstack/template-app-preact/package.json index c21f8931..8352b4ef 100644 --- a/packages/create-rstack/template-app-preact/package.json +++ b/packages/create-rstack/template-app-preact/package.json @@ -18,7 +18,7 @@ }, "devDependencies": { "@rsbuild/plugin-preact": "^2.0.0", - "@testing-library/jest-dom": "^7.0.0", + "@testing-library/jest-dom": "^7.0.1", "@testing-library/preact": "^3.2.4", "happy-dom": "^20.11.2", "rstack": "^0.5.2" diff --git a/packages/create-rstack/template-app-react-ts/package.json b/packages/create-rstack/template-app-react-ts/package.json index dcabfd86..5afd8142 100644 --- a/packages/create-rstack/template-app-react-ts/package.json +++ b/packages/create-rstack/template-app-react-ts/package.json @@ -20,7 +20,7 @@ "devDependencies": { "@rsbuild/plugin-react": "^2.1.0", "@testing-library/dom": "^10.4.1", - "@testing-library/jest-dom": "^7.0.0", + "@testing-library/jest-dom": "^7.0.1", "@testing-library/react": "^16.3.2", "@types/node": "^24.13.3", "@types/react": "^19.2.18", diff --git a/packages/create-rstack/template-app-react/package.json b/packages/create-rstack/template-app-react/package.json index b724a854..0d2d0e24 100644 --- a/packages/create-rstack/template-app-react/package.json +++ b/packages/create-rstack/template-app-react/package.json @@ -20,7 +20,7 @@ "devDependencies": { "@rsbuild/plugin-react": "^2.1.0", "@testing-library/dom": "^10.4.1", - "@testing-library/jest-dom": "^7.0.0", + "@testing-library/jest-dom": "^7.0.1", "@testing-library/react": "^16.3.2", "happy-dom": "^20.11.2", "rstack": "^0.5.2" diff --git a/packages/create-rstack/template-app-solid-ts/package.json b/packages/create-rstack/template-app-solid-ts/package.json index 5c38f341..61d0c0d8 100644 --- a/packages/create-rstack/template-app-solid-ts/package.json +++ b/packages/create-rstack/template-app-solid-ts/package.json @@ -20,7 +20,7 @@ "@rsbuild/plugin-babel": "^2.0.1", "@rsbuild/plugin-solid": "^1.2.2", "@solidjs/testing-library": "^0.8.10", - "@testing-library/jest-dom": "^7.0.0", + "@testing-library/jest-dom": "^7.0.1", "@types/node": "^24.13.3", "happy-dom": "^20.11.2", "rstack": "^0.5.2", diff --git a/packages/create-rstack/template-app-solid/package.json b/packages/create-rstack/template-app-solid/package.json index c092fd73..064ec69b 100644 --- a/packages/create-rstack/template-app-solid/package.json +++ b/packages/create-rstack/template-app-solid/package.json @@ -20,7 +20,7 @@ "@rsbuild/plugin-babel": "^2.0.1", "@rsbuild/plugin-solid": "^1.2.2", "@solidjs/testing-library": "^0.8.10", - "@testing-library/jest-dom": "^7.0.0", + "@testing-library/jest-dom": "^7.0.1", "happy-dom": "^20.11.2", "rstack": "^0.5.2" } diff --git a/packages/create-rstack/template-app-svelte-ts/package.json b/packages/create-rstack/template-app-svelte-ts/package.json index 1a00fa3b..3d737117 100644 --- a/packages/create-rstack/template-app-svelte-ts/package.json +++ b/packages/create-rstack/template-app-svelte-ts/package.json @@ -18,7 +18,7 @@ }, "devDependencies": { "@rsbuild/plugin-svelte": "^2.0.1", - "@testing-library/jest-dom": "^7.0.0", + "@testing-library/jest-dom": "^7.0.1", "@testing-library/svelte": "^5.4.2", "@types/node": "^24.13.3", "happy-dom": "^20.11.2", diff --git a/packages/create-rstack/template-app-svelte/package.json b/packages/create-rstack/template-app-svelte/package.json index d3ef1e7c..ad9fd84d 100644 --- a/packages/create-rstack/template-app-svelte/package.json +++ b/packages/create-rstack/template-app-svelte/package.json @@ -18,7 +18,7 @@ }, "devDependencies": { "@rsbuild/plugin-svelte": "^2.0.1", - "@testing-library/jest-dom": "^7.0.0", + "@testing-library/jest-dom": "^7.0.1", "@testing-library/svelte": "^5.4.2", "happy-dom": "^20.11.2", "prettier-plugin-svelte": "^4.1.1", diff --git a/packages/create-rstack/template-app-vanilla-ts/package.json b/packages/create-rstack/template-app-vanilla-ts/package.json index 6736f404..fd6dab91 100644 --- a/packages/create-rstack/template-app-vanilla-ts/package.json +++ b/packages/create-rstack/template-app-vanilla-ts/package.json @@ -15,7 +15,7 @@ }, "devDependencies": { "@testing-library/dom": "^10.4.1", - "@testing-library/jest-dom": "^7.0.0", + "@testing-library/jest-dom": "^7.0.1", "@types/node": "^24.13.3", "happy-dom": "^20.11.2", "rstack": "^0.5.2", diff --git a/packages/create-rstack/template-app-vanilla/package.json b/packages/create-rstack/template-app-vanilla/package.json index 32376dc9..3e2ddcb2 100644 --- a/packages/create-rstack/template-app-vanilla/package.json +++ b/packages/create-rstack/template-app-vanilla/package.json @@ -15,7 +15,7 @@ }, "devDependencies": { "@testing-library/dom": "^10.4.1", - "@testing-library/jest-dom": "^7.0.0", + "@testing-library/jest-dom": "^7.0.1", "happy-dom": "^20.11.2", "rstack": "^0.5.2" } diff --git a/packages/create-rstack/template-app-vue-ts/package.json b/packages/create-rstack/template-app-vue-ts/package.json index f7103c91..26df147d 100644 --- a/packages/create-rstack/template-app-vue-ts/package.json +++ b/packages/create-rstack/template-app-vue-ts/package.json @@ -18,7 +18,7 @@ }, "devDependencies": { "@rsbuild/plugin-vue": "^2.0.1", - "@testing-library/jest-dom": "^7.0.0", + "@testing-library/jest-dom": "^7.0.1", "@types/node": "^24.13.3", "@vue/test-utils": "^2.4.11", "happy-dom": "^20.11.2", diff --git a/packages/create-rstack/template-app-vue/package.json b/packages/create-rstack/template-app-vue/package.json index 03d5df80..551684e5 100644 --- a/packages/create-rstack/template-app-vue/package.json +++ b/packages/create-rstack/template-app-vue/package.json @@ -18,7 +18,7 @@ }, "devDependencies": { "@rsbuild/plugin-vue": "^2.0.1", - "@testing-library/jest-dom": "^7.0.0", + "@testing-library/jest-dom": "^7.0.1", "@vue/test-utils": "^2.4.11", "happy-dom": "^20.11.2", "rstack": "^0.5.2" diff --git a/packages/create-rstack/template-lib-react-ts/package.json b/packages/create-rstack/template-lib-react-ts/package.json index 98d6ae9c..7099cae6 100644 --- a/packages/create-rstack/template-lib-react-ts/package.json +++ b/packages/create-rstack/template-lib-react-ts/package.json @@ -25,7 +25,7 @@ "devDependencies": { "@rsbuild/plugin-react": "^2.1.0", "@testing-library/dom": "^10.4.1", - "@testing-library/jest-dom": "^7.0.0", + "@testing-library/jest-dom": "^7.0.1", "@testing-library/react": "^16.3.2", "@types/node": "^24.13.3", "@types/react": "^19.2.18", diff --git a/packages/create-rstack/template-lib-react/package.json b/packages/create-rstack/template-lib-react/package.json index f9b3c3dc..2ec7b89c 100644 --- a/packages/create-rstack/template-lib-react/package.json +++ b/packages/create-rstack/template-lib-react/package.json @@ -23,7 +23,7 @@ "devDependencies": { "@rsbuild/plugin-react": "^2.1.0", "@testing-library/dom": "^10.4.1", - "@testing-library/jest-dom": "^7.0.0", + "@testing-library/jest-dom": "^7.0.1", "@testing-library/react": "^16.3.2", "@types/react-dom": "^19.2.4", "happy-dom": "^20.11.2", diff --git a/packages/create-rstack/template-lib-solid-ts/package.json b/packages/create-rstack/template-lib-solid-ts/package.json index 17b3132c..f3757028 100644 --- a/packages/create-rstack/template-lib-solid-ts/package.json +++ b/packages/create-rstack/template-lib-solid-ts/package.json @@ -27,7 +27,7 @@ "@rsbuild/plugin-babel": "^2.0.1", "@rsbuild/plugin-solid": "^1.2.2", "@solidjs/testing-library": "^0.8.10", - "@testing-library/jest-dom": "^7.0.0", + "@testing-library/jest-dom": "^7.0.1", "@types/node": "^24.13.3", "happy-dom": "^20.11.2", "rstack": "^0.5.2", diff --git a/packages/create-rstack/template-lib-solid/package.json b/packages/create-rstack/template-lib-solid/package.json index 90567af4..f21d25ae 100644 --- a/packages/create-rstack/template-lib-solid/package.json +++ b/packages/create-rstack/template-lib-solid/package.json @@ -25,7 +25,7 @@ "@rsbuild/plugin-babel": "^2.0.1", "@rsbuild/plugin-solid": "^1.2.2", "@solidjs/testing-library": "^0.8.10", - "@testing-library/jest-dom": "^7.0.0", + "@testing-library/jest-dom": "^7.0.1", "happy-dom": "^20.11.2", "rstack": "^0.5.2", "solid-js": "^1.9.14" diff --git a/packages/create-rstack/template-lib-svelte-ts/package.json b/packages/create-rstack/template-lib-svelte-ts/package.json index 956e0de2..1fbc2c4b 100644 --- a/packages/create-rstack/template-lib-svelte-ts/package.json +++ b/packages/create-rstack/template-lib-svelte-ts/package.json @@ -30,7 +30,7 @@ "rstack": "^0.5.2", "svelte": "^5.56.8", "svelte-check": "^4.7.5", - "svelte2tsx": "^0.7.59", + "svelte2tsx": "^0.7.60", "typescript": "^6.0.3" }, "peerDependencies": { diff --git a/packages/create-rstack/template-lib-vue-ts/package.json b/packages/create-rstack/template-lib-vue-ts/package.json index 1c5146c1..59ee0a24 100644 --- a/packages/create-rstack/template-lib-vue-ts/package.json +++ b/packages/create-rstack/template-lib-vue-ts/package.json @@ -24,7 +24,7 @@ }, "devDependencies": { "@rsbuild/plugin-vue": "^2.0.1", - "@testing-library/jest-dom": "^7.0.0", + "@testing-library/jest-dom": "^7.0.1", "@types/node": "^24.13.3", "@vue/test-utils": "^2.4.11", "happy-dom": "^20.11.2", diff --git a/packages/create-rstack/template-lib-vue/package.json b/packages/create-rstack/template-lib-vue/package.json index 9ed02556..68a08a4b 100644 --- a/packages/create-rstack/template-lib-vue/package.json +++ b/packages/create-rstack/template-lib-vue/package.json @@ -22,7 +22,7 @@ }, "devDependencies": { "@rsbuild/plugin-vue": "^2.0.1", - "@testing-library/jest-dom": "^7.0.0", + "@testing-library/jest-dom": "^7.0.1", "@vue/test-utils": "^2.4.11", "happy-dom": "^20.11.2", "rstack": "^0.5.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c3ad4f86..be9b0d6c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,11 +8,11 @@ settings: catalogs: default: '@napi-rs/cli': - specifier: ^3.8.3 - version: 3.8.3 + specifier: ^3.8.6 + version: 3.8.6 '@rsbuild/core': - specifier: ~2.1.10 - version: 2.1.10 + specifier: ~2.1.11 + version: 2.1.11 '@rsbuild/plugin-react': specifier: ^2.1.0 version: 2.1.0 @@ -56,14 +56,14 @@ catalogs: specifier: ~0.11.6 version: 0.11.6 '@shikijs/transformers': - specifier: ^4.4.2 - version: 4.4.2 + specifier: ^4.4.3 + version: 4.4.3 '@testing-library/dom': specifier: ^10.4.1 version: 10.4.1 '@testing-library/jest-dom': - specifier: ^7.0.0 - version: 7.0.0 + specifier: ^7.0.1 + version: 7.0.1 '@testing-library/react': specifier: ^16.3.2 version: 16.3.2 @@ -86,8 +86,8 @@ catalogs: specifier: 2.1.0 version: 2.1.0 globals: - specifier: ^17.7.0 - version: 17.9.0 + specifier: ^17.10.0 + version: 17.10.0 happy-dom: specifier: ^20.11.2 version: 20.11.2 @@ -149,8 +149,8 @@ catalogs: specifier: 1.0.12 version: 1.0.12 yuku-parser: - specifier: 0.8.4 - version: 0.8.4 + specifier: 0.8.5 + version: 0.8.5 importers: @@ -164,7 +164,7 @@ importers: version: 0.0.4 globals: specifier: 'catalog:' - version: 17.9.0 + version: 17.10.0 heading-case: specifier: 'catalog:' version: 1.1.5 @@ -189,13 +189,13 @@ importers: devDependencies: '@rsbuild/plugin-react': specifier: 'catalog:' - version: 2.1.0(@rsbuild/core@2.1.10)(@rspack/core@2.1.8) + version: 2.1.0(@rsbuild/core@2.1.10)(@rspack/core@2.1.9) '@testing-library/dom': specifier: 'catalog:' version: 10.4.1 '@testing-library/jest-dom': specifier: 'catalog:' - version: 7.0.0(@testing-library/dom@10.4.1) + version: 7.0.1(@testing-library/dom@10.4.1) '@testing-library/react': specifier: 'catalog:' version: 16.3.2(@testing-library/dom@10.4.1)(@types/react-dom@19.2.4)(@types/react@19.2.18)(react-dom@19.2.8)(react@19.2.8) @@ -222,7 +222,7 @@ importers: version: 10.4.1 '@testing-library/jest-dom': specifier: 'catalog:' - version: 7.0.0(@testing-library/dom@10.4.1) + version: 7.0.1(@testing-library/dom@10.4.1) '@types/node': specifier: 'catalog:' version: 24.13.3 @@ -277,13 +277,13 @@ importers: devDependencies: '@rsbuild/plugin-react': specifier: 'catalog:' - version: 2.1.0(@rsbuild/core@2.1.10)(@rspack/core@2.1.8) + version: 2.1.0(@rsbuild/core@2.1.10)(@rspack/core@2.1.9) '@testing-library/dom': specifier: 'catalog:' version: 10.4.1 '@testing-library/jest-dom': specifier: 'catalog:' - version: 7.0.0(@testing-library/dom@10.4.1) + version: 7.0.1(@testing-library/dom@10.4.1) '@testing-library/react': specifier: 'catalog:' version: 16.3.2(@testing-library/dom@10.4.1)(@types/react-dom@19.2.4)(@types/react@19.2.18)(react-dom@19.2.8)(react@19.2.8) @@ -320,7 +320,7 @@ importers: devDependencies: '@rsbuild/plugin-react': specifier: 'catalog:' - version: 2.1.0(@rsbuild/core@2.1.10)(@rspack/core@2.1.8) + version: 2.1.0(@rsbuild/core@2.1.10)(@rspack/core@2.1.9) '@testing-library/dom': specifier: 'catalog:' version: 10.4.1 @@ -366,7 +366,7 @@ importers: dependencies: '@rsbuild/core': specifier: 'catalog:' - version: 2.1.10 + version: 2.1.11 '@rslib/core': specifier: 'catalog:' version: 1.0.0-beta.2(typescript@7.0.2) @@ -384,11 +384,11 @@ importers: version: 2.1.0 yuku-parser: specifier: 'catalog:' - version: 0.8.4 + version: 0.8.5 devDependencies: '@napi-rs/cli': specifier: 'catalog:' - version: 3.8.3(@types/node@24.13.3)(node-addon-api@7.1.1)(supports-color@8.1.1) + version: 3.8.6(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3)(@types/node@24.13.3)(supports-color@8.1.1) '@rspress/core': specifier: 'catalog:' version: 2.0.19(micromark-util-types@2.0.2)(micromark@4.0.2)(supports-color@8.1.1) @@ -400,7 +400,7 @@ importers: version: 0.2.0 '@rstest/adapter-rsbuild': specifier: 'catalog:' - version: 0.11.6(@rsbuild/core@2.1.10)(@rstest/core@0.11.6) + version: 0.11.6(@rsbuild/core@2.1.11)(@rstest/core@0.11.6) '@rstest/adapter-rslib': specifier: 'catalog:' version: 0.11.6(@rslib/core@1.0.0-beta.2)(@rstest/core@0.11.6)(typescript@7.0.2) @@ -469,7 +469,7 @@ importers: version: 1.14.7(@rspress/core@2.0.19) '@shikijs/transformers': specifier: 'catalog:' - version: 4.4.2 + version: 4.4.3 '@types/node': specifier: 'catalog:' version: 24.13.3 @@ -766,15 +766,21 @@ packages: '@types/react': '>=16' react: '>=16' - '@napi-rs/cli@3.8.3': - resolution: {integrity: sha512-f5vr9ih+ROvX5x9yZ4ywGj+kqcMXTzc4TsXUT4KUmfYlcdKTJ0uROuzeDP6rfDKhCqWo7EL6nBvfMWkhv5TMeQ==} + '@napi-rs/cli@3.8.6': + resolution: {integrity: sha512-FnJ9fghsV9Q4zh2aJGPSvQiUlJRC27B6KhzAXcIW2rlSD8keak3mhXw4tJYa3KJkP9whETfsPwqp/DJRnQg5ng==} engines: {node: ^20.17.0 || ^22.13.0 || >= 23.5.0} hasBin: true peerDependencies: - '@emnapi/runtime': 2.0.0-alpha.3 + '@emnapi/core': ^1.7.1 || ^2.0.0-alpha.4 + '@emnapi/runtime': ^1.7.1 || ^2.0.0-alpha.4 + emnapi: ^1.7.1 || ^2.0.0-alpha.4 peerDependenciesMeta: + '@emnapi/core': + optional: true '@emnapi/runtime': optional: true + emnapi: + optional: true '@napi-rs/cross-toolchain@1.0.3': resolution: {integrity: sha512-ENPfLe4937bsKVTDA6zdABx4pq9w0tHqRrJHyaGxgaPq03a2Bd1unD5XSKjXJjebsABJ+MjAv1A2OvCgK9yehg==} @@ -1275,6 +1281,16 @@ packages: core-js: optional: true + '@rsbuild/core@2.1.11': + resolution: {integrity: sha512-jA/QwZu8wIljp70TjERVoX+vk2cWU+viHpV9EAdKpA6ifu/pFnThEhbV3RFxBvF/9mB3h7ZRUfdDIyknT+9MWA==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + core-js: '>= 3.0.0' + peerDependenciesMeta: + core-js: + optional: true + '@rsbuild/plugin-react@2.1.0': resolution: {integrity: sha512-RQTIAWB/CwPjoWt9iAl+8HixeQVgZ7kEIBrWPCixfITyHdiD84h0YpUTpEUuz6kGHw1KXT9mHZ3Rwy6WG7aRDA==} peerDependencies: @@ -1362,69 +1378,149 @@ packages: cpu: [arm64] os: [darwin] + '@rspack/binding-darwin-arm64@2.1.9': + resolution: {integrity: sha512-sQQgKx+1ckW5GI6w/ozJkoaQM0Skbwj7hFiv+Y2d7+iAB7OVz83LWFrodRl1QGCg1QNuaEmlVo9AUapWUSr/8g==} + cpu: [arm64] + os: [darwin] + '@rspack/binding-darwin-x64@2.1.8': resolution: {integrity: sha512-08pBkFhlD3Y3Qzh94w/Fc3skaIE3e96kl2P14m8+tnYTcglpOfpA2OwS3iHt9fOqy0HjoAVe6/MW3cBgs5iabA==} cpu: [x64] os: [darwin] + '@rspack/binding-darwin-x64@2.1.9': + resolution: {integrity: sha512-kuWzn8JFKJUxSFwX/+rzvZUm4fRrSbXCTCAlzb0iHvP6vftjCFHGpNJfWjD7yX9O7C/dtoGiNT1O1veJytVsWA==} + cpu: [x64] + os: [darwin] + '@rspack/binding-linux-arm64-gnu@2.1.8': resolution: {integrity: sha512-KLniMc9GzhKpVqhPzaJo3KJwzdAllXVVqZIk/uL1QipXOxs57fgM4u7IexKPFVla0o/u1PQG/Ah2YLDmda24Ow==} cpu: [arm64] os: [linux] libc: [glibc] + '@rspack/binding-linux-arm64-gnu@2.1.9': + resolution: {integrity: sha512-rj1TjWGuG9Zc+fmwfvOpRO9npuHMKE4xXSB/BZqZNcH5Uey4NcAo1/GF8zHRoalQrwf0roP9WsFX1tk85rzP/Q==} + cpu: [arm64] + os: [linux] + libc: [glibc] + '@rspack/binding-linux-arm64-musl@2.1.8': resolution: {integrity: sha512-yUKAxHNGnICtw5RnxFWu4dHtsz/tdt7rbeFcsINNVre9HcrRxf5XP+FbOGL/SMxd9oM9XCo10paU2WckTKwbEA==} cpu: [arm64] os: [linux] libc: [musl] + '@rspack/binding-linux-arm64-musl@2.1.9': + resolution: {integrity: sha512-Z2+sS2z9Imt3og0e3Kq4hEumiqTajQBXkl9cqSYj1lwOgmViLAvMX4BlCL1cinIEstixFKQ+xsta9SI6ivCKtg==} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rspack/binding-linux-ppc64-gnu@2.1.9': + resolution: {integrity: sha512-xK90IHipRDgxvDF9n90HRNklci0G2Amk0ZMsM3t3YX+/8jIJNcuEPk6hJ1hlY6KZu7U9enqGbNQ7Fe0StBeLVA==} + cpu: [ppc64] + os: [linux] + libc: [glibc] + '@rspack/binding-linux-riscv64-gnu@2.1.8': resolution: {integrity: sha512-gg4S1jaitwYPHR9HZ3zNGH1EK2GXINm66p4kEpOP1gbc+akyOouVF/dMcu9NGPlRg58FbEhVRZYKu7Z/zcpKHg==} cpu: [riscv64] os: [linux] libc: [glibc] + '@rspack/binding-linux-riscv64-gnu@2.1.9': + resolution: {integrity: sha512-aaOwU3voq20Vwmfu1V6UPz8eQJBitBUNbLc08dxHGsmQM+ap6dd4j5xn/i5Y6AfLro2Q3GJvpCayc+dVIOR32g==} + cpu: [riscv64] + os: [linux] + libc: [glibc] + '@rspack/binding-linux-riscv64-musl@2.1.8': resolution: {integrity: sha512-b/aU5j1h368SLNyz5u+flqpZVhzSZ1UIslaj9sZJuAvqkGWv3xsjc/28/PTo/RYXCxd0FNVAxTxWHKvRiAAS8w==} cpu: [riscv64] os: [linux] libc: [musl] + '@rspack/binding-linux-riscv64-musl@2.1.9': + resolution: {integrity: sha512-tF7XnEtpTYyVS8ef96IKUjFhd9lFa9Swv212fcyWxRhxRn4PEYVWpSh/D3NDVX+i69Z7xFDDEoyMUdYBkkVTlw==} + cpu: [riscv64] + os: [linux] + libc: [musl] + + '@rspack/binding-linux-s390x-gnu@2.1.9': + resolution: {integrity: sha512-rGmeME3Pd8k/55txP+19ceZJxhVN2mtC8TLzB1ycTrhy8U+ZnN7J8rZSl89LYrZGYewd1UmOcY0QKKy05FS3FA==} + cpu: [s390x] + os: [linux] + libc: [glibc] + '@rspack/binding-linux-x64-gnu@2.1.8': resolution: {integrity: sha512-EyegohSx0BJRqieCg9f/caCqFARRWkqI5hwJt6k530MoOTLeq8I3vsbeg24/2MktwIC1dmJi8bl0+WhPKQs4eQ==} cpu: [x64] os: [linux] libc: [glibc] + '@rspack/binding-linux-x64-gnu@2.1.9': + resolution: {integrity: sha512-YimUCS//wl+AZjXvgVig7sJtPiGs+WNMH4g49F1msB5T40rw0aOopp9O3MdC+LFfRm6vpIJwOHd6alo/UUs7nA==} + cpu: [x64] + os: [linux] + libc: [glibc] + '@rspack/binding-linux-x64-musl@2.1.8': resolution: {integrity: sha512-I6E+goN+UQ297q4r1qdbiAyNCI3t0+a5Y0xDIAPOZfRDRxDTnH/LF8/y65gjsJoKRKyn7zxRC0T/NURTkRNQ9A==} cpu: [x64] os: [linux] libc: [musl] + '@rspack/binding-linux-x64-musl@2.1.9': + resolution: {integrity: sha512-tYJRdoB3IWVVcnGPZqCnRjC5MJle7xHucKkIuKtGbSMS6hzg6B1oKZav1BBw72gxnrW4n2Bwt82TBKQKBUSjmA==} + cpu: [x64] + os: [linux] + libc: [musl] + '@rspack/binding-wasm32-wasi@2.1.8': resolution: {integrity: sha512-om7GAKWAU3lcSvbCon2m7mzw8v9OTrO2LW2MZ1lGe/uVJJmwGGkl9HVoXFyWFLrN6YVFyx8iP+AkN4owDWB9Cw==} cpu: [wasm32] + '@rspack/binding-wasm32-wasi@2.1.9': + resolution: {integrity: sha512-TF6oZRU23x6vHzGuvRFszvEnmC5Yn8PHbKmeZWsUHj4Mtv4tDdDGVdlxj6Kq3pySS6sRknv8gzpRMhXqHD3I5g==} + cpu: [wasm32] + '@rspack/binding-win32-arm64-msvc@2.1.8': resolution: {integrity: sha512-WDnsP/SUb9zbxyGX9XjPw5AXrX86u5oidn0MDdfJduOOqdCSpHwmRjlQ8NUJhbBq9WqVJMFlcab7NwZVWX/yyg==} cpu: [arm64] os: [win32] + '@rspack/binding-win32-arm64-msvc@2.1.9': + resolution: {integrity: sha512-tLt4gbvUelmtJGI3PHtQHZuGpaO2z/ym6+OXAjc6NR2jWbzljardSjONiXVWIi1zmzODt4dD/fL3Ncb+RU/jHQ==} + cpu: [arm64] + os: [win32] + '@rspack/binding-win32-ia32-msvc@2.1.8': resolution: {integrity: sha512-QiMQMPNDiY3dhhaIdaFPzcPDC06cEYkNY89ea+EmDvNVgZq6V+2mFS/WnzZVMeEbGAYJCjsv/ABhhLT1hlYMvg==} cpu: [ia32] os: [win32] + '@rspack/binding-win32-ia32-msvc@2.1.9': + resolution: {integrity: sha512-VznxSrGPb4mvxkTHTdGolEpBOuDW7RICD9Rp266MhYLQG4c0uNcX7+vWF4HbFvB0kN+Gdkj7vz+5shWdrfK72Q==} + cpu: [ia32] + os: [win32] + '@rspack/binding-win32-x64-msvc@2.1.8': resolution: {integrity: sha512-b7sA5eB64vo2mbsuc//MOYzVLeCKHPn0dfP/GmNEoHdWbhRgZ/orZLWurYMQj04ELTLW6YCJEy59g5KRzNYHfw==} cpu: [x64] os: [win32] + '@rspack/binding-win32-x64-msvc@2.1.9': + resolution: {integrity: sha512-P1dGC6t3PJinqN6tBZ+jyou4LvwpD2ygeovKgg5tuYWKFMUwh1v60yX3afOUwaJMEGbHUye7xuYRd84NCMSNOQ==} + cpu: [x64] + os: [win32] + '@rspack/binding@2.1.8': resolution: {integrity: sha512-tmAyHzDbPiy8V7HvQqtuPsbs6dPgwV0YjzW5XrPRV9gzf+Hdm7pvsZJKE1QKO9WV5RuvGYav98xIX6O+abZxzQ==} + '@rspack/binding@2.1.9': + resolution: {integrity: sha512-0ZZj+RE62/jFRwX5czqjjGiMGgzSK0hm7/66PtCKjyZjb2tNAg3WGyWv+ref7684ZAjtbHHpZ+EOGswQYBjklA==} + '@rspack/core@2.1.8': resolution: {integrity: sha512-na1kyA6Mj8/LWw9O3A8NsrG9rNKN3Iq2WiXrEuIwsU5r/Nl/evm3hO7bWKHxgsRyydI6W7okwx3MXgf8rzel6g==} engines: {node: ^20.19.0 || >=22.12.0} @@ -1437,6 +1533,18 @@ packages: '@swc/helpers': optional: true + '@rspack/core@2.1.9': + resolution: {integrity: sha512-kXd5aYrkO+91fYolNYAjUhW/1F9kGmw7PtneNRY6z3KK6ttJgQWMVNypiCkhK3TOcyWPGH42qd0bzHZlH72JaA==} + engines: {node: ^20.19.0 || >=22.12.0} + peerDependencies: + '@module-federation/runtime-tools': ^0.24.1 || ^2.0.0 + '@swc/helpers': ^0.5.23 + peerDependenciesMeta: + '@module-federation/runtime-tools': + optional: true + '@swc/helpers': + optional: true + '@rspack/plugin-react-refresh@2.0.2': resolution: {integrity: sha512-dGNZiCxQxgAUI9sah7gd8u+O7OJZRCmqtEJNDOd8xW5RqcieC86F7p5qcShyw6onH5pKf57evpr2VjGbaFGkZg==} peerDependencies: @@ -1522,8 +1630,8 @@ packages: resolution: {integrity: sha512-ANMDxuaPsNMdDC1m4vfvhlDmJweMwkE5XitTwrq2rWHx5jM+dlm4MmHt2PP6t0uejfR77SuhrhJ0zEijIF/uhA==} engines: {node: '>=20'} - '@shikijs/core@4.4.2': - resolution: {integrity: sha512-StyzbAyxg2/tBGf78gwbBkGyeQ73lf8UiJArFaQhTQIDqQOCKPCQFanvrs4/Yv3Yfyc+ONInJM6K+FMIf+P+kA==} + '@shikijs/core@4.4.3': + resolution: {integrity: sha512-QCR4q2ZO/ILJEuwiBMel4wdcTDb1JGwfjKTxPDF6x8ixOaluPrVqIn06C99AcRPhmYlBR56d/Fb+GN58GzExpg==} engines: {node: '>=20'} '@shikijs/engine-javascript@4.3.1': @@ -1542,8 +1650,8 @@ packages: resolution: {integrity: sha512-CXQRQOYy1leqQ8ceTeJdmXv/bsUY++6QyLpXJ94LZAAYj5X2SKRdc5ipguv4NPyGVKItB2PPwUpRNe0Sjh5S1A==} engines: {node: '>=20'} - '@shikijs/primitive@4.4.2': - resolution: {integrity: sha512-l6fQQKsOMlz72n38fztmSgZ76MO6KSWuw8o+GJ+FhmqrpC9pIOJNQNXGgbb5yX2AwpzlEHwsaLPnk/8o4Fm+rA==} + '@shikijs/primitive@4.4.3': + resolution: {integrity: sha512-m0wBeLDQDeIxRdUmrCPdQqfuUamDwRL5isCfYbguKD6NiaKpVbsv+3J81DyIKgNW5h4WAIIr8T4EkgQrBBxvaQ==} engines: {node: '>=20'} '@shikijs/rehype@4.3.1': @@ -1554,16 +1662,16 @@ packages: resolution: {integrity: sha512-dgpoJ4WqNi2yTmizQHBJ5zcX6j2lE6icN/0yt4l1kkf16jrY/pwPLoTb1ETsWMz0OBLf9ZNvwmxft+cH+N9qSA==} engines: {node: '>=20'} - '@shikijs/transformers@4.4.2': - resolution: {integrity: sha512-d81PJ9KkR1tVP95FH/9296HTtDo0mh76wv10u9T1YmsZq/UcXgt0OLdBszfUQ1i+umkRMCjDnFbFZU7/tCODTQ==} + '@shikijs/transformers@4.4.3': + resolution: {integrity: sha512-oJSARV6NaWd+rnNJbtnpAdj3Zg0ZVyzsnMgb3vi3HA+35y8lBWUCpOnWsmyiXZIikY+x1BDqrQUgmxfzWh7Jvw==} engines: {node: '>=20'} '@shikijs/types@4.3.1': resolution: {integrity: sha512-CHFxE0jztBIZRHH6gxXE7DXUCFXjReEGxZ/j0rfSLGKZuwp2xBYycEP14875DSa9KLL/6700oxIq6oO6ef9K2g==} engines: {node: '>=20'} - '@shikijs/types@4.4.2': - resolution: {integrity: sha512-PFYitV4vpDr/iPCIhnHp+Q4ftic5N5VeNJ3KQ1O8gn3h2ar8qgwMAXF7tq4m1CWaMS60fV4VqF6vfnWH4F7vqQ==} + '@shikijs/types@4.4.3': + resolution: {integrity: sha512-UEJxmRR++MAGR6hugn0vgVS2W/6lWAts84FFSrnlH9sP0LNol7E5+NQ792pH8liWUhyMyjhTgSUH3k7iD7tc5g==} engines: {node: '>=20'} '@shikijs/vscode-textmate@10.0.2': @@ -1581,11 +1689,15 @@ packages: resolution: {integrity: sha512-o4PXJQidqJl82ckFaXUeoAW+XysPLauYI43Abki5hABd853iMhitooc6znOnczgbTYmEP6U6/y1ZyKAIsvMKGg==} engines: {node: '>=18'} - '@testing-library/jest-dom@7.0.0': - resolution: {integrity: sha512-HKAH9C6mBo5yBG6yRO5i43L2iisencAo5z+o5P/saHUoY+miC5ivXRxHBJcFyB5ypPNxHJdK3BoF/3O4DIptMg==} + '@testing-library/jest-dom@7.0.1': + resolution: {integrity: sha512-oMDTC3oA+6CXSO2JZnvOI7CA6oVub6kij5ggk9ohwye5slmkwxYDXcPOVxgMw/RQlticjtO0C1RZkR97HgrWMw==} engines: {node: '>=22', npm: '>=6', yarn: '>=1'} peerDependencies: '@testing-library/dom': '>=10 <11' + vitest: '>= 0.32' + peerDependenciesMeta: + vitest: + optional: true '@testing-library/react@16.3.2': resolution: {integrity: sha512-XU5/SytQM+ykqMnAnvB2umaJNIOsLF3PVv//1Ew4CTcpz0/BRyy/af40qqrt7SjKpDdT1saBMc42CUok5gaw+g==} @@ -1795,74 +1907,74 @@ packages: peerDependencies: react: '>=18.3.1' - '@yuku-parser/binding-android-arm64@0.8.4': - resolution: {integrity: sha512-+HIMmv08Zrh9ugIAEMnKBMMePOl7CDxrjc8Vui1+GG2TJHM1yI1+3wo1pnXB6Nj2IiHugDkQw8ycUI6SA2EUkQ==} + '@yuku-parser/binding-android-arm64@0.8.5': + resolution: {integrity: sha512-BJtJvyf/Ma3v57uebPbe7VMUjNwTa3KW0fJn4awBBXyen8aS/i0gUbCDEsjGPY4GvAT41AggcYSep37V5VPENg==} cpu: [arm64] os: [android] - '@yuku-parser/binding-darwin-arm64@0.8.4': - resolution: {integrity: sha512-Elf/B/2m3OsyvxoQnBk8Dtu+9csHkzBNs5Yv9GbHjT3x0kVKNWjFusyZgm41VwxcPDqdpRi8tWxNX7OqXkmf/A==} + '@yuku-parser/binding-darwin-arm64@0.8.5': + resolution: {integrity: sha512-CEzkjuxNjufVmSRlSm1qYGaoRpbp0g03saC8Tz6BesbmBUuP8MSqJa2BSskMbvYkRhKUN4OFCoPJ0XJf7ARTZQ==} cpu: [arm64] os: [darwin] - '@yuku-parser/binding-darwin-x64@0.8.4': - resolution: {integrity: sha512-CjZuMoXnL5XUkVpDqh4WDPwpAw8CwmtHHnTerGkS45So/sNuwkXdyIAEqqIZfaLopi5W/V9NApAT2md9XizjsQ==} + '@yuku-parser/binding-darwin-x64@0.8.5': + resolution: {integrity: sha512-HS7wYfYUi3fTYNrzLNnZUia5DVo/Kf5NRmbh2rNVDKzMUEUfXI7xWdh0OOqIqYI3SsA5AcZOCI357uYb0+2B9Q==} cpu: [x64] os: [darwin] - '@yuku-parser/binding-freebsd-x64@0.8.4': - resolution: {integrity: sha512-ibLKORdz71iI4Vs+fyFgvwQ51P5XcxJIyQLa8cSEWqwptRdo+BTcZHIQEcZnFDPUuvmJ19RRH9CoiJdfhr7pZw==} + '@yuku-parser/binding-freebsd-x64@0.8.5': + resolution: {integrity: sha512-Iq/XcdT3qjV+mxzb6hE4oSlst/+wrJxSsgKu3FkVkV1bxb0UfITfedws/wI356KVr+BM9CeamNkdbchHV4pJlw==} cpu: [x64] os: [freebsd] - '@yuku-parser/binding-linux-arm-gnu@0.8.4': - resolution: {integrity: sha512-Fo3r5fYhGDcFnl+KN+L9PgtiQPS4AIE1n1mG1o5jZ11p7g5yZ/1EjLFmSHAUsoXreun8KjTsFjEL7P1Sb93PZQ==} + '@yuku-parser/binding-linux-arm-gnu@0.8.5': + resolution: {integrity: sha512-vbI/zeUdJEZ8BKUEfOD8ngtPR5/9XdONpRRosw73kOtA1GyipTF1rj75ozLHIVCEybdCB/GSlQ6OjjhuEAKrGA==} cpu: [arm] os: [linux] libc: [glibc] - '@yuku-parser/binding-linux-arm-musl@0.8.4': - resolution: {integrity: sha512-BEB31vUEgXPWf7WkoMPSzzJhpC/wWCBXyysRCCPsw47BJ/OtbQsvJbxX9fFDuSRLy3kbyIV/WbdUTgbQ9COxiw==} + '@yuku-parser/binding-linux-arm-musl@0.8.5': + resolution: {integrity: sha512-3K4kOkOxWbUKoRja+vn7Srn8Nyc66Fr66oFWO+pFA/0KpVtlIGpKY+/KL8QIQdM7swTh+82OVkuFKeFEweVFLg==} cpu: [arm] os: [linux] libc: [musl] - '@yuku-parser/binding-linux-arm64-gnu@0.8.4': - resolution: {integrity: sha512-xGLCRcHn9xVz7JVNyyKtiNJSf503qtUmih9XVSsghgzOmiKUMnHObs69OMMwXN3788tg1jsl11fNjjQlB8idMA==} + '@yuku-parser/binding-linux-arm64-gnu@0.8.5': + resolution: {integrity: sha512-aj2pI9eT3ZAj8mWrC+utYUJwyxSd6ozthHjJfGtcY3MnZuQ4qbO7wm15BMqDgCSrg7az3tnONy1ftVQTWV9inA==} cpu: [arm64] os: [linux] libc: [glibc] - '@yuku-parser/binding-linux-arm64-musl@0.8.4': - resolution: {integrity: sha512-3kNRi8NJT2q6FQRVCUFHIQ99+kXdi8cVJEEUi6+xtFqpMgNrZNnbgAj28ILsDC7zmclaU+v47eUCeJoKLSCbww==} + '@yuku-parser/binding-linux-arm64-musl@0.8.5': + resolution: {integrity: sha512-+T2buVRNtY0QwhUeo8t47HmEpgh7tXMx8htMEdT7O0HHv3eFitwvyuVSdYNOpxo52Sc/0wJ6F4UbZni75aD4Pg==} cpu: [arm64] os: [linux] libc: [musl] - '@yuku-parser/binding-linux-x64-gnu@0.8.4': - resolution: {integrity: sha512-isi62oMy94Z3OXwGs2l2rkqRiRyqLmfHeTRHpA/uWZbsNhnm7IdVvkF7e7wHNKAtd5jwGzOqYSroxKv2fOm7Cw==} + '@yuku-parser/binding-linux-x64-gnu@0.8.5': + resolution: {integrity: sha512-uIoy1uplNUqjq3GW6z+Ea8UCQkLKRPlM4FvqAhYMDwBazkVpE1mNvMqaQqf57ZP8mGTeOf4OF6CuUlenR2ttqg==} cpu: [x64] os: [linux] libc: [glibc] - '@yuku-parser/binding-linux-x64-musl@0.8.4': - resolution: {integrity: sha512-9RsEw2xYHqU/pjSRBTOupWN3sF8uz9stjJdARfz6o0llvF+yfrj5QHmTiocGGBeAI80fvKmDtr2RIQClUzAPcA==} + '@yuku-parser/binding-linux-x64-musl@0.8.5': + resolution: {integrity: sha512-27doVJjvYevPWcakDCpfgZfDAlyhfyY3BwHf5TKtponCrSYBMzrBpD8ChYB1M7B6YOm0M5U9kEA0k1sB6CD4Ow==} cpu: [x64] os: [linux] libc: [musl] - '@yuku-parser/binding-win32-arm64@0.8.4': - resolution: {integrity: sha512-VEZHo9rEGOBKR20sA3vCO00aQvwWND5aLu7YxeX+YupMZJh9hd1f17AbClJN37Q2iL1PCHht+wDTOKX6tZYqXg==} + '@yuku-parser/binding-win32-arm64@0.8.5': + resolution: {integrity: sha512-UIlSKhOLWZUQyDVQzYWAkHQGWnwNw5IxR/YYT2UCy64HLMQGGIxhb3qa/7Rf6yki50FrLx1O9PWgBKXCq7Zxxg==} cpu: [arm64] os: [win32] - '@yuku-parser/binding-win32-x64@0.8.4': - resolution: {integrity: sha512-PeH3VzN1feGjPtDpVEAqf000fPT+nxtw/696LKp/5Z9RJi/MaXpB636QC+5QtrAPSoEnIkyEe+c+mq2QLZPWBA==} + '@yuku-parser/binding-win32-x64@0.8.5': + resolution: {integrity: sha512-helhS0Pt0TwsW9Z5L3V5o27qrnTrmaUTgSpymVUJYlZJgW6Nagk7nS5P3Ez4b1OZXMwc5y5CR6m1niuzL/yYfQ==} cpu: [x64] os: [win32] - '@yuku-toolchain/types@0.8.4': - resolution: {integrity: sha512-p7JE8flrj7ijZ/qLjHi4UwKqMarMD6zumbKXhrjp2I2iLJOuTYiQyci2U36VlXcUlNyzsY7E/mLnKCHotbzJVw==} + '@yuku-toolchain/types@0.8.5': + resolution: {integrity: sha512-ELNzrhwfi9+VCTaj6QcLCb5MlUK6pmVqPqH8bBmer1FTHvgEITnpwB73L/Wx5KKPPVWAokfeeU9V2rJy/9kMlg==} acorn-jsx@5.3.2: resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} @@ -2044,14 +2156,6 @@ packages: dom-accessibility-api@0.6.3: resolution: {integrity: sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w==} - emnapi@2.0.0-alpha.3: - resolution: {integrity: sha512-K9bc9Xx4OwSfhJpdSOpcfIKzn7/6emuubaIorf6I5e7WBAM79665rf6iHr9y50NL4qYMUP/AheTpD1Z4yU1EBw==} - peerDependencies: - node-addon-api: '>= 6.1.0' - peerDependenciesMeta: - node-addon-api: - optional: true - emojis-list@3.0.0: resolution: {integrity: sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==} engines: {node: '>= 4'} @@ -2147,8 +2251,8 @@ packages: git-hooks-list@4.2.1: resolution: {integrity: sha512-WNvqJjOxxs/8ZP9+DWdwWJ7cDsd60NHf39XnD82pDVrKO5q7xfPqpkK6hwEAmBa/ZSEE4IOoR75EzbbIuwGlMw==} - globals@17.9.0: - resolution: {integrity: sha512-m/MvAW61QVU5VDNF1Vj8axt016h8w7L5TU1e9zlab7XIttAT2YAlCwl75K1fOqvMM9apmD7lbCIRhpfkhmxhCg==} + globals@17.10.0: + resolution: {integrity: sha512-V0kztuWST2k8A/VbxAY8+L+7+Rgo3fyA24IHRLrZp7HOzJjV0gHSaZUjK9lpP/IrBSNite2tZ1prhRkinRu1CA==} engines: {node: '>=18'} happy-dom@20.11.2: @@ -3077,11 +3181,11 @@ packages: engines: {node: '>= 14.6'} hasBin: true - yuku-ast@0.8.4: - resolution: {integrity: sha512-s7EWfWIQkaGmsGnyr/BU0jli9YTN5TvrKIsSmALyRD9elumDQInuhv0BrVObENKVCxr9W3Ikmnx5u02KvfuUmw==} + yuku-ast@0.8.5: + resolution: {integrity: sha512-Ez2CI2BnPK/if0tVI7jB9UUDSNibcChjJDEPEKuWPJNRkbvzSoAQrSqpKtdzl8qTPp4ftVb87f/jx5HIKOieQw==} - yuku-parser@0.8.4: - resolution: {integrity: sha512-sw41wouvT5rUmLIp87hmvm5vtF+MRSI3x6yjq6xqpYmtkQj+Ht6N7xRQ8lMhLv8N7JAzughGj0Rfi0jQRSu9HQ==} + yuku-parser@0.8.5: + resolution: {integrity: sha512-t843J9IdYYpcDaW7o3aDPXpTM72FsvkIDYEHtigyGFCvC3EhiIaSGM5WVNZl3lxTv1Dfis6IW3S/yBsBIaCiWw==} zimmerframe@1.1.4: resolution: {integrity: sha512-B58NGBEoc8Y9MWWCQGl/gq9xBCe4IiKM0a2x7GZdQKOW5Exr8S1W24J6OgM1njK8xCRGvAJIL/MxXHf6SkmQKQ==} @@ -3366,7 +3470,7 @@ snapshots: '@types/react': 19.2.18 react: 19.2.8 - '@napi-rs/cli@3.8.3(@types/node@24.13.3)(node-addon-api@7.1.1)(supports-color@8.1.1)': + '@napi-rs/cli@3.8.6(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3)(@types/node@24.13.3)(supports-color@8.1.1)': dependencies: '@inquirer/prompts': 8.5.2(@types/node@24.13.3) '@napi-rs/cross-toolchain': 1.0.3(supports-color@8.1.1) @@ -3374,13 +3478,15 @@ snapshots: '@octokit/rest': 22.0.1 clipanion: 4.0.0-rc.4 colorette: 2.0.20 - emnapi: 2.0.0-alpha.3(node-addon-api@7.1.1) es-toolkit: 1.50.0 js-yaml: 4.3.1 obug: 2.1.4 semver: 7.8.5 typanion: 3.14.0 typescript: 6.0.3 + optionalDependencies: + '@emnapi/core': 1.11.3 + '@emnapi/runtime': 1.11.3 transitivePeerDependencies: - '@napi-rs/cross-toolchain-arm64-target-aarch64' - '@napi-rs/cross-toolchain-arm64-target-armv7' @@ -3393,7 +3499,6 @@ snapshots: - '@napi-rs/cross-toolchain-x64-target-s390x' - '@napi-rs/cross-toolchain-x64-target-x86_64' - '@types/node' - - node-addon-api - supports-color '@napi-rs/cross-toolchain@1.0.3(supports-color@8.1.1)': @@ -3767,9 +3872,16 @@ snapshots: transitivePeerDependencies: - '@module-federation/runtime-tools' - '@rsbuild/plugin-react@2.1.0(@rsbuild/core@2.1.10)(@rspack/core@2.1.8)': + '@rsbuild/core@2.1.11': dependencies: - '@rspack/plugin-react-refresh': 2.0.2(@rspack/core@2.1.8)(react-refresh@0.18.0) + '@rspack/core': 2.1.9(@swc/helpers@0.5.23) + '@swc/helpers': 0.5.23 + transitivePeerDependencies: + - '@module-federation/runtime-tools' + + '@rsbuild/plugin-react@2.1.0(@rsbuild/core@2.1.10)(@rspack/core@2.1.9)': + dependencies: + '@rspack/plugin-react-refresh': 2.0.2(@rspack/core@2.1.9)(react-refresh@0.18.0) react-refresh: 0.18.0 optionalDependencies: '@rsbuild/core': 2.1.10 @@ -3788,8 +3900,8 @@ snapshots: '@rslib/core@1.0.0-beta.2(typescript@7.0.2)': dependencies: - '@rsbuild/core': 2.1.10 - rsbuild-plugin-dts: 1.0.0-beta.2(@rsbuild/core@2.1.10)(typescript@7.0.2) + '@rsbuild/core': 2.1.11 + rsbuild-plugin-dts: 1.0.0-beta.2(@rsbuild/core@2.1.11)(typescript@7.0.2) optionalDependencies: typescript: 7.0.2 transitivePeerDependencies: @@ -3836,27 +3948,57 @@ snapshots: '@rspack/binding-darwin-arm64@2.1.8': optional: true + '@rspack/binding-darwin-arm64@2.1.9': + optional: true + '@rspack/binding-darwin-x64@2.1.8': optional: true + '@rspack/binding-darwin-x64@2.1.9': + optional: true + '@rspack/binding-linux-arm64-gnu@2.1.8': optional: true + '@rspack/binding-linux-arm64-gnu@2.1.9': + optional: true + '@rspack/binding-linux-arm64-musl@2.1.8': optional: true + '@rspack/binding-linux-arm64-musl@2.1.9': + optional: true + + '@rspack/binding-linux-ppc64-gnu@2.1.9': + optional: true + '@rspack/binding-linux-riscv64-gnu@2.1.8': optional: true + '@rspack/binding-linux-riscv64-gnu@2.1.9': + optional: true + '@rspack/binding-linux-riscv64-musl@2.1.8': optional: true + '@rspack/binding-linux-riscv64-musl@2.1.9': + optional: true + + '@rspack/binding-linux-s390x-gnu@2.1.9': + optional: true + '@rspack/binding-linux-x64-gnu@2.1.8': optional: true + '@rspack/binding-linux-x64-gnu@2.1.9': + optional: true + '@rspack/binding-linux-x64-musl@2.1.8': optional: true + '@rspack/binding-linux-x64-musl@2.1.9': + optional: true + '@rspack/binding-wasm32-wasi@2.1.8': dependencies: '@emnapi/core': 1.11.3 @@ -3864,15 +4006,31 @@ snapshots: '@napi-rs/wasm-runtime': 1.1.6(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3) optional: true + '@rspack/binding-wasm32-wasi@2.1.9': + dependencies: + '@emnapi/core': 1.11.3 + '@emnapi/runtime': 1.11.3 + '@napi-rs/wasm-runtime': 1.1.6(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3) + optional: true + '@rspack/binding-win32-arm64-msvc@2.1.8': optional: true + '@rspack/binding-win32-arm64-msvc@2.1.9': + optional: true + '@rspack/binding-win32-ia32-msvc@2.1.8': optional: true + '@rspack/binding-win32-ia32-msvc@2.1.9': + optional: true + '@rspack/binding-win32-x64-msvc@2.1.8': optional: true + '@rspack/binding-win32-x64-msvc@2.1.9': + optional: true + '@rspack/binding@2.1.8': optionalDependencies: '@rspack/binding-darwin-arm64': 2.1.8 @@ -3888,24 +4046,47 @@ snapshots: '@rspack/binding-win32-ia32-msvc': 2.1.8 '@rspack/binding-win32-x64-msvc': 2.1.8 + '@rspack/binding@2.1.9': + optionalDependencies: + '@rspack/binding-darwin-arm64': 2.1.9 + '@rspack/binding-darwin-x64': 2.1.9 + '@rspack/binding-linux-arm64-gnu': 2.1.9 + '@rspack/binding-linux-arm64-musl': 2.1.9 + '@rspack/binding-linux-ppc64-gnu': 2.1.9 + '@rspack/binding-linux-riscv64-gnu': 2.1.9 + '@rspack/binding-linux-riscv64-musl': 2.1.9 + '@rspack/binding-linux-s390x-gnu': 2.1.9 + '@rspack/binding-linux-x64-gnu': 2.1.9 + '@rspack/binding-linux-x64-musl': 2.1.9 + '@rspack/binding-wasm32-wasi': 2.1.9 + '@rspack/binding-win32-arm64-msvc': 2.1.9 + '@rspack/binding-win32-ia32-msvc': 2.1.9 + '@rspack/binding-win32-x64-msvc': 2.1.9 + '@rspack/core@2.1.8(@swc/helpers@0.5.23)': dependencies: '@rspack/binding': 2.1.8 optionalDependencies: '@swc/helpers': 0.5.23 - '@rspack/plugin-react-refresh@2.0.2(@rspack/core@2.1.8)(react-refresh@0.18.0)': + '@rspack/core@2.1.9(@swc/helpers@0.5.23)': + dependencies: + '@rspack/binding': 2.1.9 + optionalDependencies: + '@swc/helpers': 0.5.23 + + '@rspack/plugin-react-refresh@2.0.2(@rspack/core@2.1.9)(react-refresh@0.18.0)': dependencies: react-refresh: 0.18.0 optionalDependencies: - '@rspack/core': 2.1.8(@swc/helpers@0.5.23) + '@rspack/core': 2.1.9(@swc/helpers@0.5.23) '@rspress/core@2.0.19(micromark-util-types@2.0.2)(micromark@4.0.2)(supports-color@8.1.1)': dependencies: '@mdx-js/mdx': 3.1.1(supports-color@8.1.1) '@mdx-js/react': 3.1.1(@types/react@19.2.18)(react@19.2.8) '@rsbuild/core': 2.1.10 - '@rsbuild/plugin-react': 2.1.0(@rsbuild/core@2.1.10)(@rspack/core@2.1.8) + '@rsbuild/plugin-react': 2.1.0(@rsbuild/core@2.1.10)(@rspack/core@2.1.9) '@rspress/shared': 2.0.19(supports-color@8.1.1) '@shikijs/rehype': 4.3.1 '@types/mdast': 4.0.4 @@ -3978,9 +4159,9 @@ snapshots: '@rstackjs/test-utils@0.2.0': {} - '@rstest/adapter-rsbuild@0.11.6(@rsbuild/core@2.1.10)(@rstest/core@0.11.6)': + '@rstest/adapter-rsbuild@0.11.6(@rsbuild/core@2.1.11)(@rstest/core@0.11.6)': dependencies: - '@rsbuild/core': 2.1.10 + '@rsbuild/core': 2.1.11 '@rstest/core': 0.11.6(happy-dom@20.11.2) '@rstest/adapter-rslib@0.11.6(@rslib/core@1.0.0-beta.2)(@rstest/core@0.11.6)(typescript@7.0.2)': @@ -3992,7 +4173,7 @@ snapshots: '@rstest/core@0.11.6(happy-dom@20.11.2)': dependencies: - '@rsbuild/core': 2.1.10 + '@rsbuild/core': 2.1.11 '@types/chai': 5.2.3 optionalDependencies: happy-dom: 20.11.2 @@ -4008,10 +4189,10 @@ snapshots: '@types/hast': 3.0.5 hast-util-to-html: 9.0.5 - '@shikijs/core@4.4.2': + '@shikijs/core@4.4.3': dependencies: - '@shikijs/primitive': 4.4.2 - '@shikijs/types': 4.4.2 + '@shikijs/primitive': 4.4.3 + '@shikijs/types': 4.4.3 '@shikijs/vscode-textmate': 10.0.2 '@types/hast': 3.0.5 hast-util-to-html: 9.0.5 @@ -4037,9 +4218,9 @@ snapshots: '@shikijs/vscode-textmate': 10.0.2 '@types/hast': 3.0.5 - '@shikijs/primitive@4.4.2': + '@shikijs/primitive@4.4.3': dependencies: - '@shikijs/types': 4.4.2 + '@shikijs/types': 4.4.3 '@shikijs/vscode-textmate': 10.0.2 '@types/hast': 3.0.5 @@ -4056,17 +4237,17 @@ snapshots: dependencies: '@shikijs/types': 4.3.1 - '@shikijs/transformers@4.4.2': + '@shikijs/transformers@4.4.3': dependencies: - '@shikijs/core': 4.4.2 - '@shikijs/types': 4.4.2 + '@shikijs/core': 4.4.3 + '@shikijs/types': 4.4.3 '@shikijs/types@4.3.1': dependencies: '@shikijs/vscode-textmate': 10.0.2 '@types/hast': 3.0.5 - '@shikijs/types@4.4.2': + '@shikijs/types@4.4.3': dependencies: '@shikijs/vscode-textmate': 10.0.2 '@types/hast': 3.0.5 @@ -4092,7 +4273,7 @@ snapshots: picocolors: 1.1.1 pretty-format: 27.5.1 - '@testing-library/jest-dom@7.0.0(@testing-library/dom@10.4.1)': + '@testing-library/jest-dom@7.0.1(@testing-library/dom@10.4.1)': dependencies: '@adobe/css-tools': 4.5.0 '@testing-library/dom': 10.4.1 @@ -4245,43 +4426,43 @@ snapshots: react: 19.2.8 unhead: 2.1.16 - '@yuku-parser/binding-android-arm64@0.8.4': + '@yuku-parser/binding-android-arm64@0.8.5': optional: true - '@yuku-parser/binding-darwin-arm64@0.8.4': + '@yuku-parser/binding-darwin-arm64@0.8.5': optional: true - '@yuku-parser/binding-darwin-x64@0.8.4': + '@yuku-parser/binding-darwin-x64@0.8.5': optional: true - '@yuku-parser/binding-freebsd-x64@0.8.4': + '@yuku-parser/binding-freebsd-x64@0.8.5': optional: true - '@yuku-parser/binding-linux-arm-gnu@0.8.4': + '@yuku-parser/binding-linux-arm-gnu@0.8.5': optional: true - '@yuku-parser/binding-linux-arm-musl@0.8.4': + '@yuku-parser/binding-linux-arm-musl@0.8.5': optional: true - '@yuku-parser/binding-linux-arm64-gnu@0.8.4': + '@yuku-parser/binding-linux-arm64-gnu@0.8.5': optional: true - '@yuku-parser/binding-linux-arm64-musl@0.8.4': + '@yuku-parser/binding-linux-arm64-musl@0.8.5': optional: true - '@yuku-parser/binding-linux-x64-gnu@0.8.4': + '@yuku-parser/binding-linux-x64-gnu@0.8.5': optional: true - '@yuku-parser/binding-linux-x64-musl@0.8.4': + '@yuku-parser/binding-linux-x64-musl@0.8.5': optional: true - '@yuku-parser/binding-win32-arm64@0.8.4': + '@yuku-parser/binding-win32-arm64@0.8.5': optional: true - '@yuku-parser/binding-win32-x64@0.8.4': + '@yuku-parser/binding-win32-x64@0.8.5': optional: true - '@yuku-toolchain/types@0.8.4': {} + '@yuku-toolchain/types@0.8.5': {} acorn-jsx@5.3.2(acorn@8.17.0): dependencies: @@ -4407,10 +4588,6 @@ snapshots: dom-accessibility-api@0.6.3: {} - emnapi@2.0.0-alpha.3(node-addon-api@7.1.1): - optionalDependencies: - node-addon-api: 7.1.1 - emojis-list@3.0.0: {} entities@6.0.1: {} @@ -4502,7 +4679,7 @@ snapshots: git-hooks-list@4.2.1: {} - globals@17.9.0: {} + globals@17.10.0: {} happy-dom@20.11.2: dependencies: @@ -5459,10 +5636,10 @@ snapshots: mdast-util-to-markdown: 2.1.2 unified: 11.0.5 - rsbuild-plugin-dts@1.0.0-beta.2(@rsbuild/core@2.1.10)(typescript@7.0.2): + rsbuild-plugin-dts@1.0.0-beta.2(@rsbuild/core@2.1.11)(typescript@7.0.2): dependencies: '@ast-grep/napi': 0.37.0 - '@rsbuild/core': 2.1.10 + '@rsbuild/core': 2.1.11 optionalDependencies: typescript: 7.0.2 @@ -5811,27 +5988,27 @@ snapshots: yaml@2.9.0: optional: true - yuku-ast@0.8.4: + yuku-ast@0.8.5: dependencies: - '@yuku-toolchain/types': 0.8.4 + '@yuku-toolchain/types': 0.8.5 - yuku-parser@0.8.4: + yuku-parser@0.8.5: dependencies: - '@yuku-toolchain/types': 0.8.4 - yuku-ast: 0.8.4 + '@yuku-toolchain/types': 0.8.5 + yuku-ast: 0.8.5 optionalDependencies: - '@yuku-parser/binding-android-arm64': 0.8.4 - '@yuku-parser/binding-darwin-arm64': 0.8.4 - '@yuku-parser/binding-darwin-x64': 0.8.4 - '@yuku-parser/binding-freebsd-x64': 0.8.4 - '@yuku-parser/binding-linux-arm-gnu': 0.8.4 - '@yuku-parser/binding-linux-arm-musl': 0.8.4 - '@yuku-parser/binding-linux-arm64-gnu': 0.8.4 - '@yuku-parser/binding-linux-arm64-musl': 0.8.4 - '@yuku-parser/binding-linux-x64-gnu': 0.8.4 - '@yuku-parser/binding-linux-x64-musl': 0.8.4 - '@yuku-parser/binding-win32-arm64': 0.8.4 - '@yuku-parser/binding-win32-x64': 0.8.4 + '@yuku-parser/binding-android-arm64': 0.8.5 + '@yuku-parser/binding-darwin-arm64': 0.8.5 + '@yuku-parser/binding-darwin-x64': 0.8.5 + '@yuku-parser/binding-freebsd-x64': 0.8.5 + '@yuku-parser/binding-linux-arm-gnu': 0.8.5 + '@yuku-parser/binding-linux-arm-musl': 0.8.5 + '@yuku-parser/binding-linux-arm64-gnu': 0.8.5 + '@yuku-parser/binding-linux-arm64-musl': 0.8.5 + '@yuku-parser/binding-linux-x64-gnu': 0.8.5 + '@yuku-parser/binding-linux-x64-musl': 0.8.5 + '@yuku-parser/binding-win32-arm64': 0.8.5 + '@yuku-parser/binding-win32-x64': 0.8.5 zimmerframe@1.1.4: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 460655d2..720da26e 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -12,8 +12,8 @@ catalogMode: prefer cleanupUnusedCatalogs: true catalog: - '@napi-rs/cli': '^3.8.3' - '@rsbuild/core': '~2.1.10' + '@napi-rs/cli': '^3.8.6' + '@rsbuild/core': '~2.1.11' '@rsbuild/plugin-react': '^2.1.0' '@rsbuild/plugin-sass': '^2.0.1' '@rslib/core': '~1.0.0-beta.2' @@ -29,16 +29,16 @@ catalog: '@rstest/adapter-rslib': '~0.11.6' '@rstest/core': '~0.11.6' '@testing-library/dom': '^10.4.1' - '@testing-library/jest-dom': '^7.0.0' + '@testing-library/jest-dom': '^7.0.1' '@testing-library/react': '^16.3.2' '@types/micromatch': '^4.0.10' '@types/node': '^24.13.3' '@types/react': '^19.2.18' '@types/react-dom': '^19.2.4' - '@shikijs/transformers': '^4.4.2' + '@shikijs/transformers': '^4.4.3' 'cspell-ban-words': '^0.0.4' 'fast-json-stable-stringify': '2.1.0' - globals: '^17.7.0' + globals: '^17.10.0' 'happy-dom': '^20.11.2' 'heading-case': '^1.1.5' 'import-meta-resolve': '4.2.0' @@ -59,7 +59,7 @@ catalog: 'typescript': '^7.0.2' 'vscode-languageserver': '10.1.0' 'vscode-languageserver-textdocument': '1.0.12' - yuku-parser: '0.8.4' + yuku-parser: '0.8.5' dedupePeers: true diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 6f8397f5..da0237fb 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] # Required by the release-only -Zlocation-detail=none flag. -channel = "nightly-2026-04-16" +channel = "nightly-2026-08-12" components = ["clippy", "rustfmt"] profile = "minimal" From 66c613864018ebb7b970cd5005a838fc70f0c12c Mon Sep 17 00:00:00 2001 From: Jiahan Chen Date: Thu, 13 Aug 2026 13:30:30 +0800 Subject: [PATCH 11/11] release: v0.6.0 (#342) --- packages/create-rstack/package.json | 2 +- .../template-app-lit-ts/package.json | 2 +- .../template-app-lit/package.json | 2 +- .../template-app-preact-ts/package.json | 2 +- .../template-app-preact/package.json | 2 +- .../template-app-react-ts/package.json | 2 +- .../template-app-react/package.json | 2 +- .../template-app-solid-ts/package.json | 2 +- .../template-app-solid/package.json | 2 +- .../template-app-svelte-ts/package.json | 2 +- .../template-app-svelte/package.json | 2 +- .../template-app-vanilla-ts/package.json | 2 +- .../template-app-vanilla/package.json | 2 +- .../template-app-vue-ts/package.json | 2 +- .../template-app-vue/package.json | 2 +- .../template-doc-i18n/package.json | 2 +- .../create-rstack/template-doc/package.json | 2 +- .../template-lib-node-ts/package.json | 2 +- .../template-lib-node/package.json | 2 +- .../template-lib-react-ts/package.json | 2 +- .../template-lib-react/package.json | 2 +- .../template-lib-solid-ts/package.json | 2 +- .../template-lib-solid/package.json | 2 +- .../template-lib-svelte-ts/package.json | 2 +- .../template-lib-svelte/package.json | 2 +- .../template-lib-vue-ts/package.json | 2 +- .../template-lib-vue/package.json | 2 +- packages/rstack/binding.cjs | 108 +++++++++--------- packages/rstack/package.json | 2 +- 29 files changed, 82 insertions(+), 82 deletions(-) diff --git a/packages/create-rstack/package.json b/packages/create-rstack/package.json index 31f78bd1..3624d1b0 100644 --- a/packages/create-rstack/package.json +++ b/packages/create-rstack/package.json @@ -1,6 +1,6 @@ { "name": "create-rstack", - "version": "3.1.2", + "version": "3.2.0", "description": "Create a new Rstack project", "homepage": "https://rstack.rs", "bugs": { diff --git a/packages/create-rstack/template-app-lit-ts/package.json b/packages/create-rstack/template-app-lit-ts/package.json index aba33ac0..61684891 100644 --- a/packages/create-rstack/template-app-lit-ts/package.json +++ b/packages/create-rstack/template-app-lit-ts/package.json @@ -19,7 +19,7 @@ "devDependencies": { "@types/node": "^24.13.3", "happy-dom": "^20.11.2", - "rstack": "^0.5.2", + "rstack": "^0.6.0", "typescript": "^7.0.2" } } diff --git a/packages/create-rstack/template-app-lit/package.json b/packages/create-rstack/template-app-lit/package.json index 6d260528..21399993 100644 --- a/packages/create-rstack/template-app-lit/package.json +++ b/packages/create-rstack/template-app-lit/package.json @@ -18,6 +18,6 @@ }, "devDependencies": { "happy-dom": "^20.11.2", - "rstack": "^0.5.2" + "rstack": "^0.6.0" } } diff --git a/packages/create-rstack/template-app-preact-ts/package.json b/packages/create-rstack/template-app-preact-ts/package.json index e2265be8..56aac06a 100644 --- a/packages/create-rstack/template-app-preact-ts/package.json +++ b/packages/create-rstack/template-app-preact-ts/package.json @@ -22,7 +22,7 @@ "@testing-library/preact": "^3.2.4", "@types/node": "^24.13.3", "happy-dom": "^20.11.2", - "rstack": "^0.5.2", + "rstack": "^0.6.0", "typescript": "^7.0.2" } } diff --git a/packages/create-rstack/template-app-preact/package.json b/packages/create-rstack/template-app-preact/package.json index 8352b4ef..272497e0 100644 --- a/packages/create-rstack/template-app-preact/package.json +++ b/packages/create-rstack/template-app-preact/package.json @@ -21,6 +21,6 @@ "@testing-library/jest-dom": "^7.0.1", "@testing-library/preact": "^3.2.4", "happy-dom": "^20.11.2", - "rstack": "^0.5.2" + "rstack": "^0.6.0" } } diff --git a/packages/create-rstack/template-app-react-ts/package.json b/packages/create-rstack/template-app-react-ts/package.json index 5afd8142..0fbcb93d 100644 --- a/packages/create-rstack/template-app-react-ts/package.json +++ b/packages/create-rstack/template-app-react-ts/package.json @@ -26,7 +26,7 @@ "@types/react": "^19.2.18", "@types/react-dom": "^19.2.4", "happy-dom": "^20.11.2", - "rstack": "^0.5.2", + "rstack": "^0.6.0", "typescript": "^7.0.2" } } diff --git a/packages/create-rstack/template-app-react/package.json b/packages/create-rstack/template-app-react/package.json index 0d2d0e24..4f0a81e6 100644 --- a/packages/create-rstack/template-app-react/package.json +++ b/packages/create-rstack/template-app-react/package.json @@ -23,6 +23,6 @@ "@testing-library/jest-dom": "^7.0.1", "@testing-library/react": "^16.3.2", "happy-dom": "^20.11.2", - "rstack": "^0.5.2" + "rstack": "^0.6.0" } } diff --git a/packages/create-rstack/template-app-solid-ts/package.json b/packages/create-rstack/template-app-solid-ts/package.json index 61d0c0d8..b15f3a66 100644 --- a/packages/create-rstack/template-app-solid-ts/package.json +++ b/packages/create-rstack/template-app-solid-ts/package.json @@ -23,7 +23,7 @@ "@testing-library/jest-dom": "^7.0.1", "@types/node": "^24.13.3", "happy-dom": "^20.11.2", - "rstack": "^0.5.2", + "rstack": "^0.6.0", "typescript": "^7.0.2" } } diff --git a/packages/create-rstack/template-app-solid/package.json b/packages/create-rstack/template-app-solid/package.json index 064ec69b..d1964a8c 100644 --- a/packages/create-rstack/template-app-solid/package.json +++ b/packages/create-rstack/template-app-solid/package.json @@ -22,6 +22,6 @@ "@solidjs/testing-library": "^0.8.10", "@testing-library/jest-dom": "^7.0.1", "happy-dom": "^20.11.2", - "rstack": "^0.5.2" + "rstack": "^0.6.0" } } diff --git a/packages/create-rstack/template-app-svelte-ts/package.json b/packages/create-rstack/template-app-svelte-ts/package.json index 3d737117..c705ed07 100644 --- a/packages/create-rstack/template-app-svelte-ts/package.json +++ b/packages/create-rstack/template-app-svelte-ts/package.json @@ -23,7 +23,7 @@ "@types/node": "^24.13.3", "happy-dom": "^20.11.2", "prettier-plugin-svelte": "^4.1.1", - "rstack": "^0.5.2", + "rstack": "^0.6.0", "svelte-check": "^4.7.5", "typescript": "^6.0.3" } diff --git a/packages/create-rstack/template-app-svelte/package.json b/packages/create-rstack/template-app-svelte/package.json index ad9fd84d..e5abceee 100644 --- a/packages/create-rstack/template-app-svelte/package.json +++ b/packages/create-rstack/template-app-svelte/package.json @@ -22,6 +22,6 @@ "@testing-library/svelte": "^5.4.2", "happy-dom": "^20.11.2", "prettier-plugin-svelte": "^4.1.1", - "rstack": "^0.5.2" + "rstack": "^0.6.0" } } diff --git a/packages/create-rstack/template-app-vanilla-ts/package.json b/packages/create-rstack/template-app-vanilla-ts/package.json index fd6dab91..19f80fa9 100644 --- a/packages/create-rstack/template-app-vanilla-ts/package.json +++ b/packages/create-rstack/template-app-vanilla-ts/package.json @@ -18,7 +18,7 @@ "@testing-library/jest-dom": "^7.0.1", "@types/node": "^24.13.3", "happy-dom": "^20.11.2", - "rstack": "^0.5.2", + "rstack": "^0.6.0", "typescript": "^7.0.2" } } diff --git a/packages/create-rstack/template-app-vanilla/package.json b/packages/create-rstack/template-app-vanilla/package.json index 3e2ddcb2..6e4dd119 100644 --- a/packages/create-rstack/template-app-vanilla/package.json +++ b/packages/create-rstack/template-app-vanilla/package.json @@ -17,6 +17,6 @@ "@testing-library/dom": "^10.4.1", "@testing-library/jest-dom": "^7.0.1", "happy-dom": "^20.11.2", - "rstack": "^0.5.2" + "rstack": "^0.6.0" } } diff --git a/packages/create-rstack/template-app-vue-ts/package.json b/packages/create-rstack/template-app-vue-ts/package.json index 26df147d..fcd61816 100644 --- a/packages/create-rstack/template-app-vue-ts/package.json +++ b/packages/create-rstack/template-app-vue-ts/package.json @@ -22,7 +22,7 @@ "@types/node": "^24.13.3", "@vue/test-utils": "^2.4.11", "happy-dom": "^20.11.2", - "rstack": "^0.5.2", + "rstack": "^0.6.0", "typescript": "^6.0.3", "vue-tsc": "^3.3.9" } diff --git a/packages/create-rstack/template-app-vue/package.json b/packages/create-rstack/template-app-vue/package.json index 551684e5..7cd20a99 100644 --- a/packages/create-rstack/template-app-vue/package.json +++ b/packages/create-rstack/template-app-vue/package.json @@ -21,6 +21,6 @@ "@testing-library/jest-dom": "^7.0.1", "@vue/test-utils": "^2.4.11", "happy-dom": "^20.11.2", - "rstack": "^0.5.2" + "rstack": "^0.6.0" } } diff --git a/packages/create-rstack/template-doc-i18n/package.json b/packages/create-rstack/template-doc-i18n/package.json index 921e526a..b002b2a2 100644 --- a/packages/create-rstack/template-doc-i18n/package.json +++ b/packages/create-rstack/template-doc-i18n/package.json @@ -18,7 +18,7 @@ "@types/react-dom": "^19.2.4", "react": "^19.2.8", "react-dom": "^19.2.8", - "rstack": "^0.5.2", + "rstack": "^0.6.0", "typescript": "^7.0.2" } } diff --git a/packages/create-rstack/template-doc/package.json b/packages/create-rstack/template-doc/package.json index 4b86ecd8..f11dce21 100644 --- a/packages/create-rstack/template-doc/package.json +++ b/packages/create-rstack/template-doc/package.json @@ -18,7 +18,7 @@ "@types/react-dom": "^19.2.4", "react": "^19.2.8", "react-dom": "^19.2.8", - "rstack": "^0.5.2", + "rstack": "^0.6.0", "typescript": "^7.0.2" } } diff --git a/packages/create-rstack/template-lib-node-ts/package.json b/packages/create-rstack/template-lib-node-ts/package.json index 9f2c7a60..0249c11b 100644 --- a/packages/create-rstack/template-lib-node-ts/package.json +++ b/packages/create-rstack/template-lib-node-ts/package.json @@ -25,7 +25,7 @@ }, "devDependencies": { "@types/node": "^24.13.3", - "rstack": "^0.5.2", + "rstack": "^0.6.0", "typescript": "^7.0.2" }, "engines": { diff --git a/packages/create-rstack/template-lib-node/package.json b/packages/create-rstack/template-lib-node/package.json index d80ee62b..32cec902 100644 --- a/packages/create-rstack/template-lib-node/package.json +++ b/packages/create-rstack/template-lib-node/package.json @@ -22,7 +22,7 @@ "test:watch": "rs test --watch" }, "devDependencies": { - "rstack": "^0.5.2" + "rstack": "^0.6.0" }, "engines": { "node": ">=22.12.0" diff --git a/packages/create-rstack/template-lib-react-ts/package.json b/packages/create-rstack/template-lib-react-ts/package.json index 7099cae6..2f6db0e9 100644 --- a/packages/create-rstack/template-lib-react-ts/package.json +++ b/packages/create-rstack/template-lib-react-ts/package.json @@ -33,7 +33,7 @@ "happy-dom": "^20.11.2", "react": "^19.2.8", "react-dom": "^19.2.8", - "rstack": "^0.5.2", + "rstack": "^0.6.0", "typescript": "^7.0.2" }, "peerDependencies": { diff --git a/packages/create-rstack/template-lib-react/package.json b/packages/create-rstack/template-lib-react/package.json index 2ec7b89c..72e2c7a2 100644 --- a/packages/create-rstack/template-lib-react/package.json +++ b/packages/create-rstack/template-lib-react/package.json @@ -29,7 +29,7 @@ "happy-dom": "^20.11.2", "react": "^19.2.8", "react-dom": "^19.2.8", - "rstack": "^0.5.2" + "rstack": "^0.6.0" }, "peerDependencies": { "react": ">=18.0.0", diff --git a/packages/create-rstack/template-lib-solid-ts/package.json b/packages/create-rstack/template-lib-solid-ts/package.json index f3757028..f40e43bd 100644 --- a/packages/create-rstack/template-lib-solid-ts/package.json +++ b/packages/create-rstack/template-lib-solid-ts/package.json @@ -30,7 +30,7 @@ "@testing-library/jest-dom": "^7.0.1", "@types/node": "^24.13.3", "happy-dom": "^20.11.2", - "rstack": "^0.5.2", + "rstack": "^0.6.0", "solid-js": "^1.9.14", "typescript": "^7.0.2" }, diff --git a/packages/create-rstack/template-lib-solid/package.json b/packages/create-rstack/template-lib-solid/package.json index f21d25ae..3f8a1e54 100644 --- a/packages/create-rstack/template-lib-solid/package.json +++ b/packages/create-rstack/template-lib-solid/package.json @@ -27,7 +27,7 @@ "@solidjs/testing-library": "^0.8.10", "@testing-library/jest-dom": "^7.0.1", "happy-dom": "^20.11.2", - "rstack": "^0.5.2", + "rstack": "^0.6.0", "solid-js": "^1.9.14" }, "peerDependencies": { diff --git a/packages/create-rstack/template-lib-svelte-ts/package.json b/packages/create-rstack/template-lib-svelte-ts/package.json index 1fbc2c4b..faea65d7 100644 --- a/packages/create-rstack/template-lib-svelte-ts/package.json +++ b/packages/create-rstack/template-lib-svelte-ts/package.json @@ -27,7 +27,7 @@ "@types/node": "^24.13.3", "happy-dom": "^20.11.2", "prettier-plugin-svelte": "^4.1.1", - "rstack": "^0.5.2", + "rstack": "^0.6.0", "svelte": "^5.56.8", "svelte-check": "^4.7.5", "svelte2tsx": "^0.7.60", diff --git a/packages/create-rstack/template-lib-svelte/package.json b/packages/create-rstack/template-lib-svelte/package.json index d0c867a9..e64f4746 100644 --- a/packages/create-rstack/template-lib-svelte/package.json +++ b/packages/create-rstack/template-lib-svelte/package.json @@ -24,7 +24,7 @@ "@rsbuild/plugin-svelte": "^2.0.1", "happy-dom": "^20.11.2", "prettier-plugin-svelte": "^4.1.1", - "rstack": "^0.5.2", + "rstack": "^0.6.0", "svelte": "^5.56.8" }, "peerDependencies": { diff --git a/packages/create-rstack/template-lib-vue-ts/package.json b/packages/create-rstack/template-lib-vue-ts/package.json index 59ee0a24..a1932615 100644 --- a/packages/create-rstack/template-lib-vue-ts/package.json +++ b/packages/create-rstack/template-lib-vue-ts/package.json @@ -28,7 +28,7 @@ "@types/node": "^24.13.3", "@vue/test-utils": "^2.4.11", "happy-dom": "^20.11.2", - "rstack": "^0.5.2", + "rstack": "^0.6.0", "typescript": "^6.0.3", "vue": "^3.5.41", "vue-tsc": "^3.3.9" diff --git a/packages/create-rstack/template-lib-vue/package.json b/packages/create-rstack/template-lib-vue/package.json index 68a08a4b..abbff2c4 100644 --- a/packages/create-rstack/template-lib-vue/package.json +++ b/packages/create-rstack/template-lib-vue/package.json @@ -25,7 +25,7 @@ "@testing-library/jest-dom": "^7.0.1", "@vue/test-utils": "^2.4.11", "happy-dom": "^20.11.2", - "rstack": "^0.5.2", + "rstack": "^0.6.0", "vue": "^3.5.41" }, "peerDependencies": { diff --git a/packages/rstack/binding.cjs b/packages/rstack/binding.cjs index 29f79bb3..8ee733a0 100644 --- a/packages/rstack/binding.cjs +++ b/packages/rstack/binding.cjs @@ -77,8 +77,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-android-arm64') const bindingPackageVersion = require('@rstackjs/cli-android-arm64/package.json').version - if (bindingPackageVersion !== '0.5.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.5.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -93,8 +93,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-android-arm-eabi') const bindingPackageVersion = require('@rstackjs/cli-android-arm-eabi/package.json').version - if (bindingPackageVersion !== '0.5.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.5.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -114,8 +114,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-win32-x64-gnu') const bindingPackageVersion = require('@rstackjs/cli-win32-x64-gnu/package.json').version - if (bindingPackageVersion !== '0.5.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.5.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -130,8 +130,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-win32-x64-msvc') const bindingPackageVersion = require('@rstackjs/cli-win32-x64-msvc/package.json').version - if (bindingPackageVersion !== '0.5.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.5.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -147,8 +147,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-win32-ia32-msvc') const bindingPackageVersion = require('@rstackjs/cli-win32-ia32-msvc/package.json').version - if (bindingPackageVersion !== '0.5.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.5.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -163,8 +163,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-win32-arm64-msvc') const bindingPackageVersion = require('@rstackjs/cli-win32-arm64-msvc/package.json').version - if (bindingPackageVersion !== '0.5.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.5.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -182,8 +182,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-darwin-universal') const bindingPackageVersion = require('@rstackjs/cli-darwin-universal/package.json').version - if (bindingPackageVersion !== '0.5.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.5.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -198,8 +198,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-darwin-x64') const bindingPackageVersion = require('@rstackjs/cli-darwin-x64/package.json').version - if (bindingPackageVersion !== '0.5.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.5.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -214,8 +214,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-darwin-arm64') const bindingPackageVersion = require('@rstackjs/cli-darwin-arm64/package.json').version - if (bindingPackageVersion !== '0.5.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.5.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -234,8 +234,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-freebsd-x64') const bindingPackageVersion = require('@rstackjs/cli-freebsd-x64/package.json').version - if (bindingPackageVersion !== '0.5.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.5.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -250,8 +250,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-freebsd-arm64') const bindingPackageVersion = require('@rstackjs/cli-freebsd-arm64/package.json').version - if (bindingPackageVersion !== '0.5.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.5.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -271,8 +271,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-linux-x64-musl') const bindingPackageVersion = require('@rstackjs/cli-linux-x64-musl/package.json').version - if (bindingPackageVersion !== '0.5.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.5.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -287,8 +287,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-linux-x64-gnu') const bindingPackageVersion = require('@rstackjs/cli-linux-x64-gnu/package.json').version - if (bindingPackageVersion !== '0.5.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.5.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -305,8 +305,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-linux-arm64-musl') const bindingPackageVersion = require('@rstackjs/cli-linux-arm64-musl/package.json').version - if (bindingPackageVersion !== '0.5.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.5.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -321,8 +321,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-linux-arm64-gnu') const bindingPackageVersion = require('@rstackjs/cli-linux-arm64-gnu/package.json').version - if (bindingPackageVersion !== '0.5.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.5.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -339,8 +339,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-linux-arm-musleabihf') const bindingPackageVersion = require('@rstackjs/cli-linux-arm-musleabihf/package.json').version - if (bindingPackageVersion !== '0.5.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.5.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -355,8 +355,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-linux-arm-gnueabihf') const bindingPackageVersion = require('@rstackjs/cli-linux-arm-gnueabihf/package.json').version - if (bindingPackageVersion !== '0.5.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.5.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -373,8 +373,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-linux-loong64-musl') const bindingPackageVersion = require('@rstackjs/cli-linux-loong64-musl/package.json').version - if (bindingPackageVersion !== '0.5.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.5.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -389,8 +389,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-linux-loong64-gnu') const bindingPackageVersion = require('@rstackjs/cli-linux-loong64-gnu/package.json').version - if (bindingPackageVersion !== '0.5.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.5.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -407,8 +407,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-linux-riscv64-musl') const bindingPackageVersion = require('@rstackjs/cli-linux-riscv64-musl/package.json').version - if (bindingPackageVersion !== '0.5.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.5.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -423,8 +423,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-linux-riscv64-gnu') const bindingPackageVersion = require('@rstackjs/cli-linux-riscv64-gnu/package.json').version - if (bindingPackageVersion !== '0.5.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.5.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -440,8 +440,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-linux-ppc64-gnu') const bindingPackageVersion = require('@rstackjs/cli-linux-ppc64-gnu/package.json').version - if (bindingPackageVersion !== '0.5.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.5.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -456,8 +456,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-linux-s390x-gnu') const bindingPackageVersion = require('@rstackjs/cli-linux-s390x-gnu/package.json').version - if (bindingPackageVersion !== '0.5.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.5.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -476,8 +476,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-openharmony-arm64') const bindingPackageVersion = require('@rstackjs/cli-openharmony-arm64/package.json').version - if (bindingPackageVersion !== '0.5.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.5.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -492,8 +492,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-openharmony-x64') const bindingPackageVersion = require('@rstackjs/cli-openharmony-x64/package.json').version - if (bindingPackageVersion !== '0.5.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.5.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -508,8 +508,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-openharmony-arm') const bindingPackageVersion = require('@rstackjs/cli-openharmony-arm/package.json').version - if (bindingPackageVersion !== '0.5.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.5.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -648,8 +648,8 @@ if (!nativeBinding || forceWasi) { if (!candidateFailed) { if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { const bindingPackageVersion = require('@rstackjs/cli-wasm32-wasi/package.json').version - if (bindingPackageVersion !== '0.5.2') { - throw new Error(`WASI binding package version mismatch, expected 0.5.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.0') { + throw new Error(`WASI binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } } wasiBinding = require('@rstackjs/cli-wasm32-wasi') diff --git a/packages/rstack/package.json b/packages/rstack/package.json index a30788f7..5936624f 100644 --- a/packages/rstack/package.json +++ b/packages/rstack/package.json @@ -1,6 +1,6 @@ { "name": "rstack", - "version": "0.5.2", + "version": "0.6.0", "description": "One CLI for JavaScript development, powered by Rstack.", "homepage": "https://rstack.rs", "bugs": {