create-docusaurus 0.0.0-4644 → 0.0.0-4645
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/index.js
CHANGED
|
@@ -33,7 +33,7 @@ async function findPackageManagerFromLockFile() {
|
|
|
33
33
|
return undefined;
|
|
34
34
|
}
|
|
35
35
|
function findPackageManagerFromUserAgent() {
|
|
36
|
-
return PackageManagersList.find((packageManager) =>
|
|
36
|
+
return PackageManagersList.find((packageManager) => process.env.npm_config_user_agent?.startsWith(packageManager));
|
|
37
37
|
}
|
|
38
38
|
async function askForPackageManagerChoice() {
|
|
39
39
|
const hasYarn = shell.exec('yarn --version', { silent: true }).code === 0;
|
|
@@ -52,14 +52,15 @@ async function askForPackageManagerChoice() {
|
|
|
52
52
|
})).packageManager;
|
|
53
53
|
}
|
|
54
54
|
async function getPackageManager(packageManagerChoice, skipInstall = false) {
|
|
55
|
-
var _a, _b;
|
|
56
55
|
if (packageManagerChoice &&
|
|
57
56
|
!PackageManagersList.includes(packageManagerChoice)) {
|
|
58
57
|
throw new Error(`Invalid package manager choice ${packageManagerChoice}. Must be one of ${PackageManagersList.join(', ')}`);
|
|
59
58
|
}
|
|
60
|
-
return (
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
return (packageManagerChoice ??
|
|
60
|
+
(await findPackageManagerFromLockFile()) ??
|
|
61
|
+
findPackageManagerFromUserAgent() ??
|
|
62
|
+
// This only happens if the user has a global installation in PATH
|
|
63
|
+
(skipInstall ? DefaultPackageManager : askForPackageManagerChoice()));
|
|
63
64
|
}
|
|
64
65
|
function isValidGitRepoUrl(gitRepoUrl) {
|
|
65
66
|
return ['https://', 'git@'].some((item) => gitRepoUrl.startsWith(item));
|
|
@@ -134,7 +135,6 @@ async function getGitCommand(gitStrategy) {
|
|
|
134
135
|
}
|
|
135
136
|
}
|
|
136
137
|
export default async function init(rootDir, siteName, reqTemplate, cliOptions = {}) {
|
|
137
|
-
var _a;
|
|
138
138
|
const templatesDir = fileURLToPath(new URL('../templates', import.meta.url));
|
|
139
139
|
const templates = await readTemplates(templatesDir);
|
|
140
140
|
const hasTS = (templateName) => fs.pathExists(path.resolve(templatesDir, `${templateName}${TypeScriptTemplateSuffix}`));
|
|
@@ -179,7 +179,7 @@ export default async function init(rootDir, siteName, reqTemplate, cliOptions =
|
|
|
179
179
|
useTS = tsPrompt.useTS;
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
|
-
let gitStrategy =
|
|
182
|
+
let gitStrategy = cliOptions.gitStrategy ?? 'deep';
|
|
183
183
|
// If user choose Git repository, we'll prompt for the url.
|
|
184
184
|
if (template === 'Git repository') {
|
|
185
185
|
const repoPrompt = await prompts({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-docusaurus",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-4645",
|
|
4
4
|
"description": "Create Docusaurus apps easily.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@docusaurus/logger": "0.0.0-
|
|
25
|
+
"@docusaurus/logger": "0.0.0-4645",
|
|
26
26
|
"commander": "^5.1.0",
|
|
27
27
|
"fs-extra": "^10.0.1",
|
|
28
28
|
"lodash": "^4.17.21",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"engines": {
|
|
39
39
|
"node": ">=14"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "4eb744d0323996e14e1e1cc164fc925b0a9280fd"
|
|
42
42
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docusaurus-2-classic-template",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-4645",
|
|
4
4
|
"private": true,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"docusaurus": "docusaurus",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"write-heading-ids": "docusaurus write-heading-ids"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@docusaurus/core": "0.0.0-
|
|
18
|
-
"@docusaurus/preset-classic": "0.0.0-
|
|
17
|
+
"@docusaurus/core": "0.0.0-4645",
|
|
18
|
+
"@docusaurus/preset-classic": "0.0.0-4645",
|
|
19
19
|
"@mdx-js/react": "^1.6.22",
|
|
20
20
|
"clsx": "^1.1.1",
|
|
21
21
|
"prism-react-renderer": "^1.2.1",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docusaurus-2-classic-typescript-template",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-4645",
|
|
4
4
|
"private": true,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"docusaurus": "docusaurus",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"typecheck": "tsc"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@docusaurus/core": "0.0.0-
|
|
19
|
-
"@docusaurus/preset-classic": "0.0.0-
|
|
18
|
+
"@docusaurus/core": "0.0.0-4645",
|
|
19
|
+
"@docusaurus/preset-classic": "0.0.0-4645",
|
|
20
20
|
"@mdx-js/react": "^1.6.22",
|
|
21
21
|
"clsx": "^1.1.1",
|
|
22
22
|
"prism-react-renderer": "^1.2.1",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"react-dom": "^17.0.1"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@docusaurus/module-type-aliases": "0.0.0-
|
|
27
|
+
"@docusaurus/module-type-aliases": "0.0.0-4645",
|
|
28
28
|
"@tsconfig/docusaurus": "^1.0.4",
|
|
29
|
-
"typescript": "^4.
|
|
29
|
+
"typescript": "^4.6.2"
|
|
30
30
|
},
|
|
31
31
|
"browserslist": {
|
|
32
32
|
"production": [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docusaurus-2-facebook-template",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-4645",
|
|
4
4
|
"private": true,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"docusaurus": "docusaurus",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"format:diff": "prettier --config .prettierrc --list-different \"**/*.{js,jsx,ts,tsx,md,mdx}\""
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@docusaurus/core": "0.0.0-
|
|
22
|
-
"@docusaurus/preset-classic": "0.0.0-
|
|
21
|
+
"@docusaurus/core": "0.0.0-4645",
|
|
22
|
+
"@docusaurus/preset-classic": "0.0.0-4645",
|
|
23
23
|
"@mdx-js/react": "^1.6.22",
|
|
24
24
|
"clsx": "^1.1.1",
|
|
25
25
|
"react": "^17.0.1",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"eslint-plugin-header": "^3.1.1",
|
|
34
34
|
"eslint-plugin-import": "^2.25.3",
|
|
35
35
|
"eslint-plugin-jsx-a11y": "^6.5.1",
|
|
36
|
-
"eslint-plugin-react": "^7.
|
|
36
|
+
"eslint-plugin-react": "^7.29.2",
|
|
37
37
|
"eslint-plugin-react-hooks": "^4.3.0",
|
|
38
38
|
"prettier": "^2.5.1",
|
|
39
39
|
"stylelint": "^14.5.3"
|