@docusaurus/utils 4.0.0-canary-6896 → 4.0.0-canary-6898
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/lastUpdateUtils.js +1 -1
- package/lib/vcs/vcs.js +4 -4
- package/lib/vcs/vcs.js.map +1 -1
- package/lib/vcs/{vcsDefaultV2.d.ts → vcsDefault.d.ts} +3 -3
- package/lib/vcs/vcsDefault.d.ts.map +1 -0
- package/lib/vcs/{vcsDefaultV2.js → vcsDefault.js} +4 -4
- package/lib/vcs/vcsDefault.js.map +1 -0
- package/lib/vcs/{vcsDefaultV1.d.ts → vcsDefaultV3.d.ts} +3 -3
- package/lib/vcs/vcsDefaultV3.d.ts.map +1 -0
- package/lib/vcs/{vcsDefaultV1.js → vcsDefaultV3.js} +4 -4
- package/lib/vcs/{vcsDefaultV1.js.map → vcsDefaultV3.js.map} +1 -1
- package/package.json +5 -5
- package/src/lastUpdateUtils.ts +1 -1
- package/src/vcs/vcs.ts +4 -4
- package/src/vcs/{vcsDefaultV2.ts → vcsDefault.ts} +2 -2
- package/src/vcs/{vcsDefaultV1.ts → vcsDefaultV3.ts} +2 -2
- package/lib/vcs/vcsDefaultV1.d.ts.map +0 -1
- package/lib/vcs/vcsDefaultV2.d.ts.map +0 -1
- package/lib/vcs/vcsDefaultV2.js.map +0 -1
package/lib/lastUpdateUtils.js
CHANGED
|
@@ -18,7 +18,7 @@ async function readLastUpdateData(filePath, options, lastUpdateFrontMatter, vcsP
|
|
|
18
18
|
// This also ensures unit tests keep working without extra setup
|
|
19
19
|
// We still want to ensure type safety by requiring the VCS param
|
|
20
20
|
// TODO Docusaurus v4: refactor all these Git read APIs
|
|
21
|
-
const vcs = vcsParam ?? (0, vcs_1.getVcsPreset)('default-
|
|
21
|
+
const vcs = vcsParam ?? (0, vcs_1.getVcsPreset)('default-v3');
|
|
22
22
|
const { showLastUpdateAuthor, showLastUpdateTime } = options;
|
|
23
23
|
if (!showLastUpdateAuthor && !showLastUpdateTime) {
|
|
24
24
|
return { lastUpdatedBy: undefined, lastUpdatedAt: undefined };
|
package/lib/vcs/vcs.js
CHANGED
|
@@ -12,15 +12,15 @@ const vcsHardcoded_1 = require("./vcsHardcoded");
|
|
|
12
12
|
const vcsGitAdHoc_1 = require("./vcsGitAdHoc");
|
|
13
13
|
const vcsGitEager_1 = require("./vcsGitEager");
|
|
14
14
|
const vcsDisabled_1 = require("./vcsDisabled");
|
|
15
|
-
const
|
|
16
|
-
const
|
|
15
|
+
const vcsDefault_1 = require("./vcsDefault");
|
|
16
|
+
const vcsDefaultV3_1 = require("./vcsDefaultV3");
|
|
17
17
|
const VcsPresets = {
|
|
18
18
|
'git-ad-hoc': vcsGitAdHoc_1.VcsGitAdHoc,
|
|
19
19
|
'git-eager': vcsGitEager_1.VscGitEager,
|
|
20
20
|
hardcoded: vcsHardcoded_1.VcsHardcoded,
|
|
21
21
|
disabled: vcsDisabled_1.VcsDisabled,
|
|
22
|
-
|
|
23
|
-
'default-
|
|
22
|
+
default: vcsDefault_1.VcsDefault,
|
|
23
|
+
'default-v3': vcsDefaultV3_1.VcsDefaultV3,
|
|
24
24
|
};
|
|
25
25
|
exports.VcsPresetNames = Object.keys(VcsPresets);
|
|
26
26
|
function findVcsPreset(presetName) {
|
package/lib/vcs/vcs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vcs.js","sourceRoot":"","sources":["../../src/vcs/vcs.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;AAEH,iDAKwB;AACxB,+CAA0C;AAC1C,+CAA0C;AAC1C,+CAA0C;AAC1C,
|
|
1
|
+
{"version":3,"file":"vcs.js","sourceRoot":"","sources":["../../src/vcs/vcs.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;AAEH,iDAKwB;AACxB,+CAA0C;AAC1C,+CAA0C;AAC1C,+CAA0C;AAC1C,6CAAwC;AACxC,iDAA4C;AAG5C,MAAM,UAAU,GAAiC;IAC/C,YAAY,EAAE,yBAAW;IACzB,WAAW,EAAE,yBAAW;IACxB,SAAS,EAAE,2BAAY;IACvB,QAAQ,EAAE,yBAAW;IAErB,OAAO,EAAE,uBAAU;IACnB,YAAY,EAAE,2BAAY;CAC3B,CAAC;AAEW,QAAA,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAgB,CAAC;AAErE,SAAS,aAAa,CAAC,UAAkB;IACvC,OAAO,UAAU,CAAC,UAAuB,CAAC,CAAC;AAC7C,CAAC;AAED,sBAA6B,UAAqB;IAChD,MAAM,GAAG,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC;IACtC,IAAI,GAAG,EAAE,CAAC;QACR,OAAO,GAAG,CAAC;IACb,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CACb,uCAAuC,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,CACpE,CAAC;IACJ,CAAC;AACH,CAAC;AAED,4DAA4D;AAC/C,QAAA,QAAQ,GAAG;IACtB,aAAa,EAAE,0CAA2B;IAC1C,gBAAgB,EAAE,6CAA8B;IAChD,mBAAmB,EAAE,gDAAiC;IACtD,GAAG,2BAAY;CAChB,CAAC"}
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { VcsConfig } from '@docusaurus/types';
|
|
8
8
|
/**
|
|
9
|
-
* This VCS implements the
|
|
9
|
+
* This VCS implements the default eager Git automatic strategy.
|
|
10
10
|
* It is only enabled in production mode, reading the git repository eagerly.
|
|
11
11
|
*/
|
|
12
|
-
export declare const
|
|
13
|
-
//# sourceMappingURL=
|
|
12
|
+
export declare const VcsDefault: VcsConfig;
|
|
13
|
+
//# sourceMappingURL=vcsDefault.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vcsDefault.d.ts","sourceRoot":"","sources":["../../src/vcs/vcsDefault.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAC;AASjD;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,SAUxB,CAAC"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.
|
|
9
|
+
exports.VcsDefault = void 0;
|
|
10
10
|
const vcsHardcoded_1 = require("./vcsHardcoded");
|
|
11
11
|
const vcsGitEager_1 = require("./vcsGitEager");
|
|
12
12
|
function getStrategy() {
|
|
@@ -16,10 +16,10 @@ function getStrategy() {
|
|
|
16
16
|
: vcsGitEager_1.VscGitEager;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
|
-
* This VCS implements the
|
|
19
|
+
* This VCS implements the default eager Git automatic strategy.
|
|
20
20
|
* It is only enabled in production mode, reading the git repository eagerly.
|
|
21
21
|
*/
|
|
22
|
-
exports.
|
|
22
|
+
exports.VcsDefault = {
|
|
23
23
|
initialize: (...params) => {
|
|
24
24
|
return getStrategy().initialize(...params);
|
|
25
25
|
},
|
|
@@ -30,4 +30,4 @@ exports.VcsDefaultV2 = {
|
|
|
30
30
|
return getStrategy().getFileLastUpdateInfo(...params);
|
|
31
31
|
},
|
|
32
32
|
};
|
|
33
|
-
//# sourceMappingURL=
|
|
33
|
+
//# sourceMappingURL=vcsDefault.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vcsDefault.js","sourceRoot":"","sources":["../../src/vcs/vcsDefault.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,iDAA4C;AAC5C,+CAA0C;AAG1C,SAAS,WAAW;IAClB,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa;QAC3C,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM;QAC/B,CAAC,CAAC,2BAAY;QACd,CAAC,CAAC,yBAAW,CAAC;AAClB,CAAC;AAED;;;GAGG;AACU,QAAA,UAAU,GAAc;IACnC,UAAU,EAAE,CAAC,GAAG,MAAM,EAAE,EAAE;QACxB,OAAO,WAAW,EAAE,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,CAAC;IAC7C,CAAC;IACD,mBAAmB,EAAE,CAAC,GAAG,MAAM,EAAE,EAAE;QACjC,OAAO,WAAW,EAAE,CAAC,mBAAmB,CAAC,GAAG,MAAM,CAAC,CAAC;IACtD,CAAC;IACD,qBAAqB,EAAE,CAAC,GAAG,MAAM,EAAE,EAAE;QACnC,OAAO,WAAW,EAAE,CAAC,qBAAqB,CAAC,GAAG,MAAM,CAAC,CAAC;IACxD,CAAC;CACF,CAAC"}
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { VcsConfig } from '@docusaurus/types';
|
|
8
8
|
/**
|
|
9
|
-
* This VCS implements the historical Git automatic strategy.
|
|
9
|
+
* This VCS implements the historical Docusaurus v3 Git automatic strategy.
|
|
10
10
|
* It is only enabled in production mode, using ad-hoc git log commands.
|
|
11
11
|
*/
|
|
12
|
-
export declare const
|
|
13
|
-
//# sourceMappingURL=
|
|
12
|
+
export declare const VcsDefaultV3: VcsConfig;
|
|
13
|
+
//# sourceMappingURL=vcsDefaultV3.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vcsDefaultV3.d.ts","sourceRoot":"","sources":["../../src/vcs/vcsDefaultV3.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAC;AASjD;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,SAU1B,CAAC"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.
|
|
9
|
+
exports.VcsDefaultV3 = void 0;
|
|
10
10
|
const vcsHardcoded_1 = require("./vcsHardcoded");
|
|
11
11
|
const vcsGitAdHoc_1 = require("./vcsGitAdHoc");
|
|
12
12
|
function getDynamicStrategy() {
|
|
@@ -16,10 +16,10 @@ function getDynamicStrategy() {
|
|
|
16
16
|
: vcsGitAdHoc_1.VcsGitAdHoc;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
|
-
* This VCS implements the historical Git automatic strategy.
|
|
19
|
+
* This VCS implements the historical Docusaurus v3 Git automatic strategy.
|
|
20
20
|
* It is only enabled in production mode, using ad-hoc git log commands.
|
|
21
21
|
*/
|
|
22
|
-
exports.
|
|
22
|
+
exports.VcsDefaultV3 = {
|
|
23
23
|
initialize: (...params) => {
|
|
24
24
|
return getDynamicStrategy().initialize(...params);
|
|
25
25
|
},
|
|
@@ -30,4 +30,4 @@ exports.VcsDefaultV1 = {
|
|
|
30
30
|
return getDynamicStrategy().getFileLastUpdateInfo(...params);
|
|
31
31
|
},
|
|
32
32
|
};
|
|
33
|
-
//# sourceMappingURL=
|
|
33
|
+
//# sourceMappingURL=vcsDefaultV3.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"vcsDefaultV3.js","sourceRoot":"","sources":["../../src/vcs/vcsDefaultV3.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,iDAA4C;AAC5C,+CAA0C;AAG1C,SAAS,kBAAkB;IACzB,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa;QAC3C,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM;QAC/B,CAAC,CAAC,2BAAY;QACd,CAAC,CAAC,yBAAW,CAAC;AAClB,CAAC;AAED;;;GAGG;AACU,QAAA,YAAY,GAAc;IACrC,UAAU,EAAE,CAAC,GAAG,MAAM,EAAE,EAAE;QACxB,OAAO,kBAAkB,EAAE,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,CAAC;IACpD,CAAC;IACD,mBAAmB,EAAE,CAAC,GAAG,MAAM,EAAE,EAAE;QACjC,OAAO,kBAAkB,EAAE,CAAC,mBAAmB,CAAC,GAAG,MAAM,CAAC,CAAC;IAC7D,CAAC;IACD,qBAAqB,EAAE,CAAC,GAAG,MAAM,EAAE,EAAE;QACnC,OAAO,kBAAkB,EAAE,CAAC,qBAAqB,CAAC,GAAG,MAAM,CAAC,CAAC;IAC/D,CAAC;CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/utils",
|
|
3
|
-
"version": "4.0.0-canary-
|
|
3
|
+
"version": "4.0.0-canary-6898",
|
|
4
4
|
"description": "Node utility functions for Docusaurus packages.",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@11ty/gray-matter": "^3.0.0",
|
|
22
|
-
"@docusaurus/fs": "4.0.0-canary-
|
|
23
|
-
"@docusaurus/logger": "4.0.0-canary-
|
|
24
|
-
"@docusaurus/types": "4.0.0-canary-
|
|
22
|
+
"@docusaurus/fs": "4.0.0-canary-6898",
|
|
23
|
+
"@docusaurus/logger": "4.0.0-canary-6898",
|
|
24
|
+
"@docusaurus/types": "4.0.0-canary-6898",
|
|
25
25
|
"execa": "^10.0.1",
|
|
26
26
|
"file-loader": "^6.2.0",
|
|
27
27
|
"github-slugger": "^2.0.0",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"@types/react-dom": "^19.3.0",
|
|
43
43
|
"dedent": "^1.7.2"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "9cb6d6b09eacaefa738949b06bffe912fe759eaf"
|
|
46
46
|
}
|
package/src/lastUpdateUtils.ts
CHANGED
|
@@ -52,7 +52,7 @@ export async function readLastUpdateData(
|
|
|
52
52
|
// This also ensures unit tests keep working without extra setup
|
|
53
53
|
// We still want to ensure type safety by requiring the VCS param
|
|
54
54
|
// TODO Docusaurus v4: refactor all these Git read APIs
|
|
55
|
-
const vcs = vcsParam ?? getVcsPreset('default-
|
|
55
|
+
const vcs = vcsParam ?? getVcsPreset('default-v3');
|
|
56
56
|
|
|
57
57
|
const {showLastUpdateAuthor, showLastUpdateTime} = options;
|
|
58
58
|
|
package/src/vcs/vcs.ts
CHANGED
|
@@ -14,8 +14,8 @@ import {
|
|
|
14
14
|
import {VcsGitAdHoc} from './vcsGitAdHoc';
|
|
15
15
|
import {VscGitEager} from './vcsGitEager';
|
|
16
16
|
import {VcsDisabled} from './vcsDisabled';
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
17
|
+
import {VcsDefault} from './vcsDefault';
|
|
18
|
+
import {VcsDefaultV3} from './vcsDefaultV3';
|
|
19
19
|
import type {VcsConfig, VcsPreset} from '@docusaurus/types';
|
|
20
20
|
|
|
21
21
|
const VcsPresets: Record<VcsPreset, VcsConfig> = {
|
|
@@ -24,8 +24,8 @@ const VcsPresets: Record<VcsPreset, VcsConfig> = {
|
|
|
24
24
|
hardcoded: VcsHardcoded,
|
|
25
25
|
disabled: VcsDisabled,
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
'default-
|
|
27
|
+
default: VcsDefault,
|
|
28
|
+
'default-v3': VcsDefaultV3,
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
export const VcsPresetNames = Object.keys(VcsPresets) as VcsPreset[];
|
|
@@ -17,10 +17,10 @@ function getStrategy(): VcsConfig {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* This VCS implements the
|
|
20
|
+
* This VCS implements the default eager Git automatic strategy.
|
|
21
21
|
* It is only enabled in production mode, reading the git repository eagerly.
|
|
22
22
|
*/
|
|
23
|
-
export const
|
|
23
|
+
export const VcsDefault: VcsConfig = {
|
|
24
24
|
initialize: (...params) => {
|
|
25
25
|
return getStrategy().initialize(...params);
|
|
26
26
|
},
|
|
@@ -17,10 +17,10 @@ function getDynamicStrategy(): VcsConfig {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* This VCS implements the historical Git automatic strategy.
|
|
20
|
+
* This VCS implements the historical Docusaurus v3 Git automatic strategy.
|
|
21
21
|
* It is only enabled in production mode, using ad-hoc git log commands.
|
|
22
22
|
*/
|
|
23
|
-
export const
|
|
23
|
+
export const VcsDefaultV3: VcsConfig = {
|
|
24
24
|
initialize: (...params) => {
|
|
25
25
|
return getDynamicStrategy().initialize(...params);
|
|
26
26
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vcsDefaultV1.d.ts","sourceRoot":"","sources":["../../src/vcs/vcsDefaultV1.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAC;AASjD;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,SAU1B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vcsDefaultV2.d.ts","sourceRoot":"","sources":["../../src/vcs/vcsDefaultV2.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAC;AASjD;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,SAU1B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vcsDefaultV2.js","sourceRoot":"","sources":["../../src/vcs/vcsDefaultV2.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,iDAA4C;AAC5C,+CAA0C;AAG1C,SAAS,WAAW;IAClB,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa;QAC3C,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM;QAC/B,CAAC,CAAC,2BAAY;QACd,CAAC,CAAC,yBAAW,CAAC;AAClB,CAAC;AAED;;;GAGG;AACU,QAAA,YAAY,GAAc;IACrC,UAAU,EAAE,CAAC,GAAG,MAAM,EAAE,EAAE;QACxB,OAAO,WAAW,EAAE,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,CAAC;IAC7C,CAAC;IACD,mBAAmB,EAAE,CAAC,GAAG,MAAM,EAAE,EAAE;QACjC,OAAO,WAAW,EAAE,CAAC,mBAAmB,CAAC,GAAG,MAAM,CAAC,CAAC;IACtD,CAAC;IACD,qBAAqB,EAAE,CAAC,GAAG,MAAM,EAAE,EAAE;QACnC,OAAO,WAAW,EAAE,CAAC,qBAAqB,CAAC,GAAG,MAAM,CAAC,CAAC;IACxD,CAAC;CACF,CAAC"}
|