@alauda/doom 0.22.1 → 0.22.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/cli/index.js CHANGED
@@ -28,7 +28,7 @@ program
28
28
  showGlobalOptions: true,
29
29
  })
30
30
  .option('-c, --config <config>', 'Specify the path to the config file')
31
- .option('-v <version>', `Specify the version of the documentation, can also be 'unversioned' or 'unversioned-x.y'`)
31
+ .option('-v <version>', 'Specify the version of the documentation, can also be `unversioned` or `unversioned-x.y`')
32
32
  .option('-b, --base <base>', 'Override the base of the documentation')
33
33
  .option('-p, --prefix <prefix>', 'Specify the prefix of the documentation base')
34
34
  .option('-f, --force [boolean]', `Force to
@@ -40,6 +40,7 @@ program
40
40
  .option('-I, --include <language...>', 'Include **only** the specific language(s), `en ru` for example')
41
41
  .option('-E, --exclude <language...>', 'Include all languages except the specific language(s), `ru` for example')
42
42
  .option('-o, --out-dir <path>', 'Override the `outDir` defined in the config file or the default `dist/{base}/{version}`, the resulting path will be `dist/{outDir}/{version}`')
43
+ .option('-r, --redirect <enum>', 'Whether to redirect to the locale closest to `navigator.language` when the user visits the site, could be `auto` or `never`', 'auto')
43
44
  .option('-n, --no-open [boolean]', 'Do not open the browser after starting the server')
44
45
  .command('dev', { isDefault: true })
45
46
  .description('Start the development server')
@@ -1,6 +1,6 @@
1
1
  import { type UserConfig } from '@rspress/core';
2
2
  import type { GlobalCliOptions } from '../types.js';
3
- export declare function loadConfig(root?: string, { config: configFile, base, prefix, v: version, download, export: export_, ignore, force, open, lazy, include, exclude, outDir, }?: GlobalCliOptions): Promise<{
3
+ export declare function loadConfig(root?: string, { config: configFile, base, prefix, v: version, download, export: export_, ignore, force, open, lazy, include, exclude, outDir, redirect, }?: GlobalCliOptions): Promise<{
4
4
  config: UserConfig;
5
5
  filepath?: string;
6
6
  }>;
@@ -36,7 +36,7 @@ const KNOWN_LOCALE_CONFIGS = {
36
36
  nextPageText: 'Следующая страница',
37
37
  },
38
38
  };
39
- const getCommonConfig = async ({ config, root, configFilePath, base, version, download, export: export_, ignore, force, open, lazy, include, exclude, }) => {
39
+ const getCommonConfig = async ({ config, root, configFilePath, base, version, download, export: export_, ignore, force, open, lazy, include, exclude, redirect, }) => {
40
40
  const fallbackToZh = 'lang' in config && !config.lang;
41
41
  root = resolveDocRoot(CWD, root, config.root);
42
42
  const localBasePath = configFilePath ? path.dirname(configFilePath) : root;
@@ -102,6 +102,7 @@ const getCommonConfig = async ({ config, root, configFilePath, base, version, do
102
102
  enableScrollToTop: true,
103
103
  // https://github.com/web-infra-dev/rspress/issues/2011
104
104
  outline: true,
105
+ localeRedirect: redirect,
105
106
  ...(fallbackToZh ? KNOWN_LOCALE_CONFIGS.zh : { locales }),
106
107
  },
107
108
  plugins: [
@@ -178,7 +179,7 @@ const findConfig = async (basePath) => {
178
179
  }
179
180
  }
180
181
  };
181
- export async function loadConfig(root, { config: configFile, base, prefix, v: version, download, export: export_, ignore, force, open, lazy, include, exclude, outDir, } = {}) {
182
+ export async function loadConfig(root, { config: configFile, base, prefix, v: version, download, export: export_, ignore, force, open, lazy, include, exclude, outDir, redirect, } = {}) {
182
183
  let configFilePath;
183
184
  if (configFile) {
184
185
  configFilePath = path.resolve(configFile);
@@ -242,6 +243,7 @@ export async function loadConfig(root, { config: configFile, base, prefix, v: ve
242
243
  lazy,
243
244
  include,
244
245
  exclude,
246
+ redirect,
245
247
  });
246
248
  base = commonConfig.base;
247
249
  const mergedConfig = mergeRsbuildConfig(commonConfig, config, {
package/lib/types.d.ts CHANGED
@@ -17,6 +17,7 @@ export interface GlobalCliOptions {
17
17
  include?: string[];
18
18
  exclude?: string[];
19
19
  outDir?: string;
20
+ redirect?: 'auto' | 'never';
20
21
  }
21
22
  export interface TranslateOptions {
22
23
  systemPrompt?: string;
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@alauda/doom",
3
- "version": "0.22.1",
3
+ "version": "0.22.3",
4
4
  "type": "module",
5
5
  "description": "Doctor Doom making docs.",
6
- "repository": "https://gitlab-ce.alauda.cn/idp/Doom.git",
7
- "packageManager": "yarn@4.9.1",
6
+ "repository": "git+https://github.com/alauda/Doom.git",
7
+ "homepage": "https://github.com/alauda/Doom#readme",
8
+ "funding": "https://opencollective.com/alauda",
8
9
  "engines": {
9
10
  "node": ">=18.17.0 <20 || >=20.1.0"
10
11
  },
@@ -23,23 +24,6 @@
23
24
  "styles",
24
25
  "!lib/*.tsbuildinfo"
25
26
  ],
26
- "scripts": {
27
- "build": "tsc -b src",
28
- "clean": "tsc -b src --clean",
29
- "dev": "yarn swc-node --watch-path src/cli --watch-path src/plugins src/cli/index.ts",
30
- "doom": "yarn swc-node src/cli/index.ts",
31
- "export": "yarn doom export",
32
- "fixture": "yarn dev fixture-docs",
33
- "format": "prettier --write .",
34
- "lint": "run-p 'lint:*'",
35
- "lint:es": "eslint . --cache",
36
- "lint:tsc": "tsc -b",
37
- "prepare": "simple-git-hooks && patch-package && yarn-berry-deduplicate",
38
- "prepublishOnly": "yarn build",
39
- "serve": "yarn doom serve",
40
- "swc-node": "node --enable-source-maps --import @swc-node/register/esm-register",
41
- "translate": "yarn doom translate fixture-docs"
42
- },
43
27
  "dependencies": {
44
28
  "@inquirer/prompts": "^7.5.0",
45
29
  "@openapi-contrib/openapi-schema-to-json-schema": "^5.1.0",
@@ -76,34 +60,8 @@
76
60
  "yaml": "^2.7.1",
77
61
  "yoctocolors": "^2.1.1"
78
62
  },
79
- "devDependencies": {
80
- "@eslint/js": "^9.26.0",
81
- "@swc-node/register": "^1.10.10",
82
- "@swc/core": "1.11.24",
83
- "@total-typescript/ts-reset": "^0.6.1",
84
- "@types/cli-progress": "^3.11.6",
85
- "@types/ejs": "^3.1.5",
86
- "@types/node": "^18.19.96",
87
- "@types/picomatch": "^4.0.0",
88
- "@types/react": "^18.3.21",
89
- "@types/react-dom": "^18.3.7",
90
- "@types/swagger2openapi": "^7.0.4",
91
- "@unts/patch-package": "^8.1.1",
92
- "eslint": "^9.26.0",
93
- "eslint-import-resolver-typescript": "^4.3.4",
94
- "eslint-plugin-import-x": "^4.11.0",
95
- "nano-staged": "^0.8.0",
96
- "npm-run-all2": "^7.0.2",
97
- "prettier": "^3.5.3",
98
- "prettier-plugin-pkg": "^0.19.0",
99
- "prettier-plugin-properties": "^0.3.0",
100
- "simple-git-hooks": "^2.13.0",
101
- "typescript": "^5.8.3",
102
- "typescript-eslint": "^8.32.0",
103
- "yarn-berry-deduplicate": "^6.1.3"
104
- },
105
63
  "publishConfig": {
106
64
  "access": "public",
107
65
  "registry": "https://registry.npmjs.org"
108
66
  }
109
- }
67
+ }
@@ -6,38 +6,9 @@
6
6
  "python",
7
7
  "webassembly"
8
8
  ],
9
- "homepage": "https://github.com/pyodide/pyodide",
10
- "repository": {
11
- "type": "git",
12
- "url": "https://github.com/pyodide/pyodide"
13
- },
14
- "bugs": {
15
- "url": "https://github.com/pyodide/pyodide/issues"
16
- },
9
+ "repository": "git+https://github.com/pyodide/pyodide",
10
+ "homepage": "https://github.com/pyodide/pyodide#readme",
17
11
  "license": "Apache-2.0",
18
- "devDependencies": {
19
- "@types/assert": "^1.5.6",
20
- "@types/expect": "^24.3.0",
21
- "@types/mocha": "^9.1.0",
22
- "@types/node": "^20.8.4",
23
- "@types/ws": "^8.5.3",
24
- "chai": "^4.3.6",
25
- "chai-as-promised": "^7.1.1",
26
- "cross-env": "^7.0.3",
27
- "dts-bundle-generator": "^8.1.1",
28
- "esbuild": "^0.17.12",
29
- "express": "^4.17.3",
30
- "mocha": "^9.0.2",
31
- "npm-run-all": "^4.1.5",
32
- "nyc": "^15.1.0",
33
- "prettier": "^2.2.1",
34
- "sinon": "^18.0.0",
35
- "ts-mocha": "^9.0.2",
36
- "tsd": "^0.24.1",
37
- "typedoc": "^0.27.6",
38
- "typescript": "5.7",
39
- "wabt": "^1.0.32"
40
- },
41
12
  "main": "pyodide.js",
42
13
  "exports": {
43
14
  ".": {
@@ -78,57 +49,8 @@
78
49
  "vm": false,
79
50
  "ws": false
80
51
  },
81
- "scripts": {
82
- "build-inner": "node esbuild.config.inner.mjs",
83
- "build": "tsc --noEmit && node esbuild.config.outer.mjs",
84
- "test": "npm-run-all test:*",
85
- "test:unit": "cross-env TEST_NODE=1 ts-mocha --node-option=experimental-loader=./test/loader.mjs --node-option=experimental-wasm-stack-switching -p tsconfig.test.json \"test/unit/**\"",
86
- "test:node": "cross-env TEST_NODE=1 mocha test/integration/**/*.test.js",
87
- "test:browser": "mocha test/integration/**/*.test.js",
88
- "tsc": "tsc --noEmit",
89
- "coverage": "cross-env TEST_NODE=1 npm-run-all coverage:*",
90
- "coverage:build": "nyc npm run test:node"
91
- },
92
- "mocha": {
93
- "bail": false,
94
- "timeout": 30000,
95
- "full-trace": true,
96
- "inline-diffs": true,
97
- "check-leaks": false,
98
- "global": [
99
- "pyodide",
100
- "page",
101
- "chai"
102
- ]
103
- },
104
- "nyc": {
105
- "reporter": [
106
- "html",
107
- "text-summary"
108
- ],
109
- "include": [
110
- "*.ts"
111
- ],
112
- "all": true,
113
- "clean": true,
114
- "cache": false,
115
- "instrument": false,
116
- "checkCoverage": true,
117
- "statements": 95,
118
- "functions": 95,
119
- "branches": 80,
120
- "lines": 95
121
- },
122
- "tsd": {
123
- "compilerOptions": {
124
- "lib": [
125
- "ES2017",
126
- "DOM"
127
- ]
128
- }
129
- },
130
52
  "dependencies": {
131
- "ws": "^8.5.0"
53
+ "ws": "^8.18.2"
132
54
  },
133
55
  "types": "./pyodide.d.ts",
134
56
  "engines": {