mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-29 18:27:56 +02:00
chore: upgrade dependencies (#7993)
* chore: upgrade dependencies * Fix lint * Bump more * Fix lint
This commit is contained in:
parent
38dd7cfa04
commit
275f509d13
35 changed files with 1779 additions and 1788 deletions
|
@ -6,6 +6,6 @@
|
|||
"start": "npx --package netlify-cli netlify dev"
|
||||
},
|
||||
"dependencies": {
|
||||
"@netlify/functions": "^1.0.0"
|
||||
"@netlify/functions": "^1.2.0"
|
||||
}
|
||||
}
|
||||
|
|
38
package.json
38
package.json
|
@ -62,41 +62,41 @@
|
|||
"unified": "^9.2.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@crowdin/cli": "^3.7.9",
|
||||
"@crowdin/cli": "^3.7.10",
|
||||
"@swc/core": "1.2.197",
|
||||
"@swc/jest": "^0.2.22",
|
||||
"@testing-library/react-hooks": "^8.0.1",
|
||||
"@types/fs-extra": "^9.0.13",
|
||||
"@types/jest": "^28.1.6",
|
||||
"@types/lodash": "^4.14.182",
|
||||
"@types/node": "^18.6.3",
|
||||
"@types/jest": "^29.0.0",
|
||||
"@types/lodash": "^4.14.184",
|
||||
"@types/node": "^18.7.16",
|
||||
"@types/prompts": "^2.0.14",
|
||||
"@types/react": "^18.0.15",
|
||||
"@types/react": "^18.0.18",
|
||||
"@types/react-dev-utils": "^9.0.11",
|
||||
"@types/react-test-renderer": "^18.0.0",
|
||||
"@types/semver": "^7.3.10",
|
||||
"@types/semver": "^7.3.12",
|
||||
"@types/shelljs": "^0.8.11",
|
||||
"@typescript-eslint/eslint-plugin": "^5.32.0",
|
||||
"@typescript-eslint/parser": "^5.32.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.36.2",
|
||||
"@typescript-eslint/parser": "^5.36.2",
|
||||
"cross-env": "^7.0.3",
|
||||
"cspell": "^6.5.0",
|
||||
"eslint": "^8.21.0",
|
||||
"cspell": "^6.8.1",
|
||||
"eslint": "^8.23.0",
|
||||
"eslint-config-airbnb": "^19.0.4",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-plugin-header": "^3.1.1",
|
||||
"eslint-plugin-import": "^2.26.0",
|
||||
"eslint-plugin-jest": "^26.7.0",
|
||||
"eslint-plugin-jest": "^27.0.1",
|
||||
"eslint-plugin-jsx-a11y": "^6.6.1",
|
||||
"eslint-plugin-react": "^7.30.1",
|
||||
"eslint-plugin-react": "^7.31.7",
|
||||
"eslint-plugin-react-hooks": "^4.6.0",
|
||||
"eslint-plugin-regexp": "^1.8.0",
|
||||
"eslint-plugin-regexp": "^1.9.0",
|
||||
"husky": "^8.0.1",
|
||||
"image-size": "^1.0.2",
|
||||
"jest": "^28.1.3",
|
||||
"jest-environment-jsdom": "^28.1.3",
|
||||
"jest": "^29.0.2",
|
||||
"jest-environment-jsdom": "^29.0.2",
|
||||
"jest-serializer-ansi-escapes": "^2.0.1",
|
||||
"jest-serializer-react-helmet-async": "^1.0.21",
|
||||
"lerna": "^5.3.0",
|
||||
"lerna": "^5.5.0",
|
||||
"lerna-changelog": "^2.2.0",
|
||||
"lint-staged": "^13.0.3",
|
||||
"npm-run-all": "^4.1.5",
|
||||
|
@ -107,11 +107,11 @@
|
|||
"react-test-renderer": "^17.0.2",
|
||||
"remark-parse": "^8.0.2",
|
||||
"rimraf": "^3.0.2",
|
||||
"sharp": "^0.30.7",
|
||||
"sharp": "^0.31.0",
|
||||
"strip-ansi": "^6.0.1",
|
||||
"stylelint": "^14.9.1",
|
||||
"stylelint": "^14.11.0",
|
||||
"stylelint-config-prettier": "^9.0.3",
|
||||
"stylelint-config-standard": "^26.0.0",
|
||||
"stylelint-config-standard": "^28.0.0",
|
||||
"typescript": "~4.7.4"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
"prompts": "^2.4.2",
|
||||
"semver": "^7.3.7",
|
||||
"shelljs": "^0.8.5",
|
||||
"supports-color": "^9.2.2",
|
||||
"supports-color": "^9.2.3",
|
||||
"tslib": "^2.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
@ -27,16 +27,16 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@babel/eslint-parser": "^7.18.9",
|
||||
"eslint": "^8.21.0",
|
||||
"eslint": "^8.23.0",
|
||||
"eslint-config-airbnb": "^19.0.4",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-plugin-header": "^3.1.1",
|
||||
"eslint-plugin-import": "^2.26.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.6.1",
|
||||
"eslint-plugin-react": "^7.30.1",
|
||||
"eslint-plugin-react": "^7.31.7",
|
||||
"eslint-plugin-react-hooks": "^4.6.0",
|
||||
"prettier": "^2.7.1",
|
||||
"stylelint": "^14.9.1"
|
||||
"stylelint": "^14.11.0"
|
||||
},
|
||||
"browserslist": {
|
||||
"production": [
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"cssnano-preset-advanced": "^5.3.8",
|
||||
"postcss": "^8.4.14",
|
||||
"postcss-sort-media-queries": "^4.2.1",
|
||||
"postcss": "^8.4.16",
|
||||
"postcss-sort-media-queries": "^4.3.0",
|
||||
"tslib": "^2.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
@ -150,12 +150,12 @@ describe('report', () => {
|
|||
).toThrowErrorMatchingInlineSnapshot(
|
||||
`"Unexpected "reportingSeverity" value: foo."`,
|
||||
);
|
||||
expect(consoleLog).toBeCalledTimes(1);
|
||||
expect(consoleLog).toBeCalledWith(
|
||||
expect(consoleLog).toHaveBeenCalledTimes(1);
|
||||
expect(consoleLog).toHaveBeenCalledWith(
|
||||
expect.stringMatching(/.*\[INFO\].* hey/),
|
||||
);
|
||||
expect(consoleWarn).toBeCalledTimes(1);
|
||||
expect(consoleWarn).toBeCalledWith(
|
||||
expect(consoleWarn).toHaveBeenCalledTimes(1);
|
||||
expect(consoleWarn).toHaveBeenCalledWith(
|
||||
expect.stringMatching(/.*\[WARNING\].* hey/),
|
||||
);
|
||||
});
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/parser": "^7.18.10",
|
||||
"@babel/traverse": "^7.18.10",
|
||||
"@babel/parser": "^7.19.0",
|
||||
"@babel/traverse": "^7.19.0",
|
||||
"@docusaurus/logger": "^3.0.0-alpha.0",
|
||||
"@docusaurus/utils": "^3.0.0-alpha.0",
|
||||
"@mdx-js/mdx": "^1.6.22",
|
||||
|
|
|
@ -66,6 +66,6 @@ describe('transformImage plugin', () => {
|
|||
const errorMock = jest.spyOn(console, 'warn').mockImplementation(() => {});
|
||||
const result = await processFixture('invalid-img', {staticDirs});
|
||||
expect(result).toMatchSnapshot();
|
||||
expect(errorMock).toBeCalledTimes(1);
|
||||
expect(errorMock).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -22,8 +22,8 @@
|
|||
"docusaurus-migrate": "bin/index.mjs"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.18.10",
|
||||
"@babel/preset-env": "^7.18.10",
|
||||
"@babel/core": "^7.19.0",
|
||||
"@babel/preset-env": "^7.19.0",
|
||||
"@docusaurus/logger": "^3.0.0-alpha.0",
|
||||
"@docusaurus/utils": "^3.0.0-alpha.0",
|
||||
"@mapbox/hast-util-to-jsx": "^2.0.0",
|
||||
|
|
|
@ -98,7 +98,7 @@ describe.each(['atom', 'rss', 'json'])('%s', (feedType) => {
|
|||
} as PluginOptions,
|
||||
);
|
||||
|
||||
expect(fsMock).toBeCalledTimes(0);
|
||||
expect(fsMock).toHaveBeenCalledTimes(0);
|
||||
fsMock.mockClear();
|
||||
});
|
||||
|
||||
|
|
Binary file not shown.
|
@ -175,12 +175,12 @@ describe('loadSidebars', () => {
|
|||
} as VersionMetadata,
|
||||
}),
|
||||
).rejects.toThrowErrorMatchingInlineSnapshot(`""foo" is not allowed"`);
|
||||
expect(consoleWarnMock).toBeCalledWith(
|
||||
expect(consoleWarnMock).toHaveBeenCalledWith(
|
||||
expect.stringMatching(
|
||||
/.*\[WARNING\].* There are more than one category metadata files for .*foo.*: foo\/_category_.json, foo\/_category_.yml. The behavior is undetermined./,
|
||||
),
|
||||
);
|
||||
expect(consoleErrorMock).toBeCalledWith(
|
||||
expect(consoleErrorMock).toHaveBeenCalledWith(
|
||||
expect.stringMatching(
|
||||
/.*\[ERROR\].* The docs sidebar category metadata file .*foo\/_category_.json.* looks invalid!/,
|
||||
),
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
"@docusaurus/utils-validation": "^3.0.0-alpha.0",
|
||||
"@endiliey/react-ideal-image": "^0.0.11",
|
||||
"react-waypoint": "^10.3.0",
|
||||
"sharp": "^0.30.7",
|
||||
"sharp": "^0.31.0",
|
||||
"tslib": "^2.4.0",
|
||||
"webpack": "^5.74.0"
|
||||
},
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.18.10",
|
||||
"@babel/preset-env": "^7.18.10",
|
||||
"@babel/core": "^7.19.0",
|
||||
"@babel/preset-env": "^7.19.0",
|
||||
"@docusaurus/core": "^3.0.0-alpha.0",
|
||||
"@docusaurus/theme-common": "^3.0.0-alpha.0",
|
||||
"@docusaurus/theme-translations": "^3.0.0-alpha.0",
|
||||
|
@ -30,8 +30,8 @@
|
|||
"@docusaurus/utils-validation": "^3.0.0-alpha.0",
|
||||
"babel-loader": "^8.2.5",
|
||||
"clsx": "^1.2.1",
|
||||
"core-js": "^3.24.1",
|
||||
"terser-webpack-plugin": "^5.3.3",
|
||||
"core-js": "^3.25.1",
|
||||
"terser-webpack-plugin": "^5.3.6",
|
||||
"tslib": "^2.4.0",
|
||||
"webpack": "^5.74.0",
|
||||
"webpack-merge": "^5.8.0",
|
||||
|
|
|
@ -38,11 +38,11 @@
|
|||
"infima": "0.2.0-alpha.42",
|
||||
"lodash": "^4.17.21",
|
||||
"nprogress": "^0.2.0",
|
||||
"postcss": "^8.4.14",
|
||||
"postcss": "^8.4.16",
|
||||
"prism-react-renderer": "^1.3.5",
|
||||
"prismjs": "^1.28.0",
|
||||
"prismjs": "^1.29.0",
|
||||
"react-router-dom": "^5.3.3",
|
||||
"rtlcss": "^3.5.0",
|
||||
"rtlcss": "^4.0.0",
|
||||
"tslib": "^2.4.0",
|
||||
"utility-types": "^3.10.0"
|
||||
},
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
"copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@docsearch/react": "^3.1.1",
|
||||
"@docsearch/react": "^3.2.1",
|
||||
"@docusaurus/core": "^3.0.0-alpha.0",
|
||||
"@docusaurus/logger": "^3.0.0-alpha.0",
|
||||
"@docusaurus/plugin-content-docs": "^3.0.0-alpha.0",
|
||||
|
@ -42,7 +42,7 @@
|
|||
"@docusaurus/utils": "^3.0.0-alpha.0",
|
||||
"@docusaurus/utils-validation": "^3.0.0-alpha.0",
|
||||
"algoliasearch": "^4.14.2",
|
||||
"algoliasearch-helper": "^3.10.0",
|
||||
"algoliasearch-helper": "^3.11.0",
|
||||
"clsx": "^1.2.1",
|
||||
"eta": "^1.12.3",
|
||||
"fs-extra": "^10.1.0",
|
||||
|
|
|
@ -59,7 +59,7 @@ describe('normalizePluginOptions', () => {
|
|||
options,
|
||||
),
|
||||
).toEqual({foo: 'a', id: 'default'});
|
||||
expect(consoleMock).toBeCalledWith(
|
||||
expect(consoleMock).toHaveBeenCalledWith(
|
||||
expect.stringMatching(/"foo" deprecated/),
|
||||
);
|
||||
});
|
||||
|
@ -110,7 +110,7 @@ describe('normalizeThemeConfig', () => {
|
|||
themeConfig,
|
||||
),
|
||||
).toEqual(themeConfig);
|
||||
expect(consoleMock).toBeCalledWith(
|
||||
expect(consoleMock).toHaveBeenCalledWith(
|
||||
expect.stringMatching(/"foo" deprecated/),
|
||||
);
|
||||
});
|
||||
|
|
|
@ -104,7 +104,7 @@ describe('generate', () => {
|
|||
|
||||
it('works with existing cache', async () => {
|
||||
await generate(__dirname, 'foo', 'bar');
|
||||
expect(writeMock).toBeCalledTimes(1);
|
||||
expect(writeMock).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('works with existing file but no cache', async () => {
|
||||
|
@ -112,7 +112,7 @@ describe('generate', () => {
|
|||
// @ts-expect-error: seems the typedef doesn't understand overload
|
||||
readMock.mockImplementationOnce(() => Promise.resolve('bar'));
|
||||
await generate(__dirname, 'baz', 'bar');
|
||||
expect(writeMock).toBeCalledTimes(1);
|
||||
expect(writeMock).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('works when force skipping cache', async () => {
|
||||
|
|
|
@ -120,7 +120,7 @@ describe('getFileCommitDate', () => {
|
|||
age: 'newest',
|
||||
includeAuthor: true,
|
||||
}),
|
||||
).toThrowError(FileNotTrackedError);
|
||||
).toThrow(FileNotTrackedError);
|
||||
});
|
||||
it('throws when file not found', async () => {
|
||||
expect(() =>
|
||||
|
@ -128,7 +128,7 @@ describe('getFileCommitDate', () => {
|
|||
age: 'newest',
|
||||
includeAuthor: true,
|
||||
}),
|
||||
).toThrowError(
|
||||
).toThrow(
|
||||
/Failed to retrieve git history for ".*nonexistent.txt" because the file does not exist./,
|
||||
);
|
||||
});
|
||||
|
|
|
@ -33,16 +33,16 @@
|
|||
"url": "https://github.com/facebook/docusaurus/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.18.10",
|
||||
"@babel/generator": "^7.18.10",
|
||||
"@babel/core": "^7.19.0",
|
||||
"@babel/generator": "^7.19.0",
|
||||
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
||||
"@babel/plugin-transform-runtime": "^7.18.10",
|
||||
"@babel/preset-env": "^7.18.10",
|
||||
"@babel/preset-env": "^7.19.0",
|
||||
"@babel/preset-react": "^7.18.6",
|
||||
"@babel/preset-typescript": "^7.18.6",
|
||||
"@babel/runtime": "^7.18.9",
|
||||
"@babel/runtime-corejs3": "^7.18.9",
|
||||
"@babel/traverse": "^7.18.10",
|
||||
"@babel/runtime": "^7.19.0",
|
||||
"@babel/runtime-corejs3": "^7.19.0",
|
||||
"@babel/traverse": "^7.19.0",
|
||||
"@docusaurus/cssnano-preset": "^3.0.0-alpha.0",
|
||||
"@docusaurus/logger": "^3.0.0-alpha.0",
|
||||
"@docusaurus/mdx-loader": "^3.0.0-alpha.0",
|
||||
|
@ -63,10 +63,10 @@
|
|||
"combine-promises": "^1.1.0",
|
||||
"commander": "^5.1.0",
|
||||
"copy-webpack-plugin": "^11.0.0",
|
||||
"core-js": "^3.24.1",
|
||||
"core-js": "^3.25.1",
|
||||
"css-loader": "^6.7.1",
|
||||
"css-minimizer-webpack-plugin": "^4.0.0",
|
||||
"cssnano": "^5.1.12",
|
||||
"cssnano": "^5.1.13",
|
||||
"del": "^6.1.1",
|
||||
"detect-port": "^1.3.0",
|
||||
"escape-html": "^1.0.3",
|
||||
|
@ -80,7 +80,7 @@
|
|||
"leven": "^3.1.0",
|
||||
"lodash": "^4.17.21",
|
||||
"mini-css-extract-plugin": "^2.6.1",
|
||||
"postcss": "^8.4.14",
|
||||
"postcss": "^8.4.16",
|
||||
"postcss-loader": "^7.0.1",
|
||||
"prompts": "^2.4.2",
|
||||
"react-dev-utils": "^12.0.1",
|
||||
|
@ -94,14 +94,14 @@
|
|||
"semver": "^7.3.7",
|
||||
"serve-handler": "^6.1.3",
|
||||
"shelljs": "^0.8.5",
|
||||
"terser-webpack-plugin": "^5.3.3",
|
||||
"terser-webpack-plugin": "^5.3.6",
|
||||
"tslib": "^2.4.0",
|
||||
"update-notifier": "^5.1.0",
|
||||
"url-loader": "^4.1.1",
|
||||
"wait-on": "^6.0.1",
|
||||
"webpack": "^5.74.0",
|
||||
"webpack-bundle-analyzer": "^4.5.0",
|
||||
"webpack-dev-server": "^4.9.3",
|
||||
"webpack-bundle-analyzer": "^4.6.1",
|
||||
"webpack-dev-server": "^4.11.0",
|
||||
"webpack-merge": "^5.8.0",
|
||||
"webpackbar": "^5.0.2"
|
||||
},
|
||||
|
@ -115,7 +115,7 @@
|
|||
"@types/serve-handler": "^6.1.1",
|
||||
"@types/update-notifier": "^5.1.0",
|
||||
"@types/wait-on": "^5.3.1",
|
||||
"@types/webpack-bundle-analyzer": "^4.4.1",
|
||||
"@types/webpack-bundle-analyzer": "^4.4.2",
|
||||
"react-test-renderer": "^17.0.2",
|
||||
"tmp-promise": "^3.0.3",
|
||||
"tree-node-cli": "^1.5.2"
|
||||
|
|
|
@ -98,7 +98,7 @@ describe('normalizeLocation', () => {
|
|||
search: '',
|
||||
hash: '#features',
|
||||
});
|
||||
expect(replaceMock).toBeCalledTimes(1);
|
||||
expect(replaceMock).toHaveBeenCalledTimes(1);
|
||||
|
||||
expect(
|
||||
normalizeLocation({
|
||||
|
|
|
@ -107,7 +107,7 @@ describe('handleBrokenLinks', () => {
|
|||
|
||||
it('do not report anything for correct paths', async () => {
|
||||
const consoleMock = jest
|
||||
.spyOn(console, 'error')
|
||||
.spyOn(console, 'warn')
|
||||
.mockImplementation(() => {});
|
||||
const allCollectedCorrectLinks = {
|
||||
'/docs/good doc with space': [
|
||||
|
@ -136,12 +136,12 @@ describe('handleBrokenLinks', () => {
|
|||
};
|
||||
await handleBrokenLinks({
|
||||
allCollectedLinks: allCollectedCorrectLinks,
|
||||
onBrokenLinks: 'error',
|
||||
onBrokenLinks: 'warn',
|
||||
routes,
|
||||
baseUrl: '/',
|
||||
outDir,
|
||||
});
|
||||
expect(consoleMock).toBeCalledTimes(0);
|
||||
expect(consoleMock).toHaveBeenCalledTimes(0);
|
||||
});
|
||||
|
||||
it('reports all broken links', async () => {
|
||||
|
@ -167,7 +167,7 @@ describe('handleBrokenLinks', () => {
|
|||
baseUrl: '/',
|
||||
outDir,
|
||||
});
|
||||
expect(lodashMock).toBeCalledTimes(0);
|
||||
expect(lodashMock).toHaveBeenCalledTimes(0);
|
||||
lodashMock.mockRestore();
|
||||
});
|
||||
|
||||
|
|
|
@ -184,7 +184,7 @@ describe('normalizeConfig', () => {
|
|||
normalizeConfig({
|
||||
plugins,
|
||||
} as Config);
|
||||
}).not.toThrowError();
|
||||
}).not.toThrow();
|
||||
});
|
||||
|
||||
it.each([
|
||||
|
@ -223,7 +223,7 @@ describe('normalizeConfig', () => {
|
|||
normalizeConfig({
|
||||
themes,
|
||||
} as Config);
|
||||
}).not.toThrowError();
|
||||
}).not.toThrow();
|
||||
});
|
||||
|
||||
it('throws error if themes is not array', () => {
|
||||
|
|
|
@ -96,7 +96,7 @@ describe('handleDuplicateRoutes', () => {
|
|||
}).toThrowErrorMatchingSnapshot();
|
||||
const consoleMock = jest.spyOn(console, 'log').mockImplementation(() => {});
|
||||
handleDuplicateRoutes(routes, 'ignore');
|
||||
expect(consoleMock).toBeCalledTimes(0);
|
||||
expect(consoleMock).toHaveBeenCalledTimes(0);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ describe('writeCodeTranslations', () => {
|
|||
key2: {message: 'key2 message'},
|
||||
key3: {message: 'key3 message'},
|
||||
});
|
||||
expect(consoleInfoMock).toBeCalledWith(
|
||||
expect(consoleInfoMock).toHaveBeenCalledWith(
|
||||
expect.stringMatching(/3.* translations will be written/),
|
||||
);
|
||||
});
|
||||
|
@ -100,7 +100,7 @@ describe('writeCodeTranslations', () => {
|
|||
key2: {message: 'PREFIX key2 message'},
|
||||
key3: {message: 'PREFIX key3 message'},
|
||||
});
|
||||
expect(consoleInfoMock).toBeCalledWith(
|
||||
expect(consoleInfoMock).toHaveBeenCalledWith(
|
||||
expect.stringMatching(/3.* translations will be written/),
|
||||
);
|
||||
});
|
||||
|
@ -129,7 +129,7 @@ describe('writeCodeTranslations', () => {
|
|||
key3: {message: 'key3 message'},
|
||||
key4: {message: 'key4 message new'},
|
||||
});
|
||||
expect(consoleInfoMock).toBeCalledWith(
|
||||
expect(consoleInfoMock).toHaveBeenCalledWith(
|
||||
expect.stringMatching(/4.* translations will be written/),
|
||||
);
|
||||
});
|
||||
|
@ -154,7 +154,7 @@ describe('writeCodeTranslations', () => {
|
|||
key1: {message: 'key1 message'},
|
||||
key2: {message: 'PREFIX key2 message new'},
|
||||
});
|
||||
expect(consoleInfoMock).toBeCalledWith(
|
||||
expect(consoleInfoMock).toHaveBeenCalledWith(
|
||||
expect.stringMatching(/2.* translations will be written/),
|
||||
);
|
||||
});
|
||||
|
@ -179,7 +179,7 @@ describe('writeCodeTranslations', () => {
|
|||
key1: {message: 'key1 message new'},
|
||||
key2: {message: 'key2 message new'},
|
||||
});
|
||||
expect(consoleInfoMock).toBeCalledWith(
|
||||
expect(consoleInfoMock).toHaveBeenCalledWith(
|
||||
expect.stringMatching(/2.* translations will be written/),
|
||||
);
|
||||
});
|
||||
|
@ -205,7 +205,7 @@ describe('writeCodeTranslations', () => {
|
|||
key1: {message: 'PREFIX key1 message new'},
|
||||
key2: {message: 'PREFIX key2 message new'},
|
||||
});
|
||||
expect(consoleInfoMock).toBeCalledWith(
|
||||
expect(consoleInfoMock).toHaveBeenCalledWith(
|
||||
expect.stringMatching(/2.* translations will be written/),
|
||||
);
|
||||
});
|
||||
|
@ -232,7 +232,7 @@ describe('writeCodeTranslations', () => {
|
|||
key2: {message: 'key2 message', description: 'key2 desc new'},
|
||||
key3: {message: 'key3 message', description: 'key3 desc new'},
|
||||
});
|
||||
expect(consoleInfoMock).toBeCalledWith(
|
||||
expect(consoleInfoMock).toHaveBeenCalledWith(
|
||||
expect.stringMatching(/3.* translations will be written/),
|
||||
);
|
||||
});
|
||||
|
@ -242,10 +242,10 @@ describe('writeCodeTranslations', () => {
|
|||
|
||||
await writeCodeTranslations({localizationDir}, {}, {});
|
||||
|
||||
await expect(readFile()).rejects.toThrowError(
|
||||
await expect(readFile()).rejects.toThrow(
|
||||
/ENOENT: no such file or directory, open /,
|
||||
);
|
||||
expect(consoleInfoMock).toBeCalledTimes(0);
|
||||
expect(consoleInfoMock).toHaveBeenCalledTimes(0);
|
||||
});
|
||||
|
||||
it('throws for invalid content', async () => {
|
||||
|
|
|
@ -64,7 +64,7 @@ const default => {
|
|||
extractSourceCodeFileTranslations(sourceCodeFilePath, TestBabelOptions),
|
||||
).rejects.toThrow();
|
||||
|
||||
expect(errorMock).toBeCalledWith(
|
||||
expect(errorMock).toHaveBeenCalledWith(
|
||||
expect.stringMatching(
|
||||
/Error while attempting to extract Docusaurus translations from source code file at/,
|
||||
),
|
||||
|
|
|
@ -122,6 +122,6 @@ describe('base webpack config', () => {
|
|||
.mockImplementation(() => fileLoaderUtils);
|
||||
|
||||
await createBaseConfig(props, false, false);
|
||||
expect(mockSvg).toBeCalled();
|
||||
expect(mockSvg).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -346,13 +346,13 @@ describe('getHttpsConfig', () => {
|
|||
process.env.HTTPS = 'true';
|
||||
process.env.SSL_CRT_FILE = path.join(__dirname, '__fixtures__/host.crt');
|
||||
process.env.SSL_KEY_FILE = path.join(__dirname, '__fixtures__/invalid.key');
|
||||
await expect(getHttpsConfig()).rejects.toThrowError();
|
||||
await expect(getHttpsConfig()).rejects.toThrow();
|
||||
});
|
||||
|
||||
it('throws for invalid cert', async () => {
|
||||
process.env.HTTPS = 'true';
|
||||
process.env.SSL_CRT_FILE = path.join(__dirname, '__fixtures__/invalid.crt');
|
||||
process.env.SSL_KEY_FILE = path.join(__dirname, '__fixtures__/host.key');
|
||||
await expect(getHttpsConfig()).rejects.toThrowError();
|
||||
await expect(getHttpsConfig()).rejects.toThrow();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -21,11 +21,11 @@
|
|||
"build": "tsc"
|
||||
},
|
||||
"dependencies": {
|
||||
"@typescript-eslint/utils": "^5.32.0",
|
||||
"@typescript-eslint/utils": "^5.36.2",
|
||||
"tslib": "^2.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint-plugin-eslint-plugin": "^5.0.1"
|
||||
"eslint-plugin-eslint-plugin": "^5.0.6"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"eslint": ">=6"
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
"@docusaurus/logger": "^3.0.0-alpha.0",
|
||||
"file-loader": "^6.2.0",
|
||||
"lodash": "^4.17.21",
|
||||
"sharp": "^0.30.7",
|
||||
"sharp": "^0.31.0",
|
||||
"tslib": "^2.4.0"
|
||||
},
|
||||
"engines": {
|
||||
|
@ -28,6 +28,6 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@types/file-loader": "^5.0.1",
|
||||
"@types/sharp": "^0.30.4"
|
||||
"@types/sharp": "^0.30.5"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
"directory": "packages/stylelint-copyright"
|
||||
},
|
||||
"dependencies": {
|
||||
"stylelint": "^14.9.1",
|
||||
"stylelint": "^14.11.0",
|
||||
"tslib": "^2.4.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import stylelint from 'stylelint';
|
||||
import stylelint, {type Rule} from 'stylelint';
|
||||
|
||||
const ruleName = 'docusaurus/copyright-header';
|
||||
const messages = stylelint.utils.ruleMessages(ruleName, {
|
||||
|
@ -14,46 +14,48 @@ const messages = stylelint.utils.ruleMessages(ruleName, {
|
|||
|
||||
type SecondaryOption = {header?: string};
|
||||
|
||||
const plugin = stylelint.createPlugin(
|
||||
ruleName,
|
||||
(primaryOption: boolean, secondaryOption: SecondaryOption, context) =>
|
||||
(root, result) => {
|
||||
stylelint.utils.validateOptions(
|
||||
result,
|
||||
ruleName,
|
||||
{
|
||||
actual: primaryOption,
|
||||
possible: [true, false],
|
||||
},
|
||||
{
|
||||
actual: secondaryOption,
|
||||
possible: (v) =>
|
||||
typeof (v as SecondaryOption | undefined)?.header === 'string',
|
||||
},
|
||||
);
|
||||
const rule: Rule<boolean, string> =
|
||||
(primaryOption, secondaryOption, context) => (root, result) => {
|
||||
stylelint.utils.validateOptions(
|
||||
result,
|
||||
ruleName,
|
||||
{
|
||||
actual: primaryOption,
|
||||
possible: [true, false],
|
||||
},
|
||||
{
|
||||
actual: secondaryOption,
|
||||
possible: (v) =>
|
||||
typeof (v as SecondaryOption | undefined)?.header === 'string',
|
||||
},
|
||||
);
|
||||
|
||||
if (
|
||||
root.first &&
|
||||
root.first.type === 'comment' &&
|
||||
root.first.source?.start?.column === 1
|
||||
) {
|
||||
const {text} = root.first;
|
||||
if (text === secondaryOption.header) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (context.fix) {
|
||||
root.first?.before(`/*${secondaryOption.header!}\n */`);
|
||||
if (
|
||||
root.first &&
|
||||
root.first.type === 'comment' &&
|
||||
root.first.source?.start?.column === 1
|
||||
) {
|
||||
const {text} = root.first;
|
||||
if (text === secondaryOption.header) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (context.fix) {
|
||||
root.first?.before(`/*${secondaryOption.header!}\n */`);
|
||||
return;
|
||||
}
|
||||
|
||||
stylelint.utils.report({
|
||||
message: messages.rejected,
|
||||
node: root,
|
||||
result,
|
||||
ruleName,
|
||||
});
|
||||
},
|
||||
);
|
||||
stylelint.utils.report({
|
||||
message: messages.rejected,
|
||||
node: root,
|
||||
result,
|
||||
ruleName,
|
||||
});
|
||||
};
|
||||
|
||||
rule.ruleName = ruleName;
|
||||
rule.messages = messages;
|
||||
|
||||
const plugin = stylelint.createPlugin(ruleName, rule);
|
||||
|
||||
export = plugin;
|
||||
|
|
|
@ -34,8 +34,8 @@
|
|||
"typecheck": "tsc"
|
||||
},
|
||||
"dependencies": {
|
||||
"@crowdin/cli": "^3.7.9",
|
||||
"@crowdin/crowdin-api-client": "^1.19.0",
|
||||
"@crowdin/cli": "^3.7.10",
|
||||
"@crowdin/crowdin-api-client": "^1.19.1",
|
||||
"@docusaurus/core": "^3.0.0-alpha.0",
|
||||
"@docusaurus/logger": "^3.0.0-alpha.0",
|
||||
"@docusaurus/plugin-client-redirects": "^3.0.0-alpha.0",
|
||||
|
@ -48,7 +48,7 @@
|
|||
"@docusaurus/theme-live-codeblock": "^3.0.0-alpha.0",
|
||||
"@docusaurus/utils": "^3.0.0-alpha.0",
|
||||
"@docusaurus/utils-common": "^3.0.0-alpha.0",
|
||||
"@popperjs/core": "^2.11.5",
|
||||
"@popperjs/core": "^2.11.6",
|
||||
"@swc/core": "1.2.197",
|
||||
"clsx": "^1.2.1",
|
||||
"color": "^4.2.3",
|
||||
|
@ -84,7 +84,7 @@
|
|||
"devDependencies": {
|
||||
"@docusaurus/eslint-plugin": "^3.0.0-alpha.0",
|
||||
"@tsconfig/docusaurus": "^1.0.5",
|
||||
"@types/jest": "^28.1.6",
|
||||
"@types/jest": "^29.0.0",
|
||||
"cross-env": "^7.0.3",
|
||||
"rimraf": "^3.0.2"
|
||||
}
|
||||
|
|
|
@ -119,7 +119,7 @@ html[data-theme='dark'] .topBannerTitleText {
|
|||
}
|
||||
|
||||
@keyframes jack-in-the-box {
|
||||
from {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: scale(0.1) rotate(30deg);
|
||||
transform-origin: center bottom;
|
||||
|
@ -133,7 +133,7 @@ html[data-theme='dark'] .topBannerTitleText {
|
|||
transform: rotate(3deg);
|
||||
}
|
||||
|
||||
to {
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: scale(1);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue