mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-11 16:17:25 +02:00
refactor: remove a lot of implicit anys (#7468)
This commit is contained in:
parent
0c8e57de67
commit
3666a2ede5
23 changed files with 148 additions and 163 deletions
|
@ -5,19 +5,27 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
// @ts-check
|
||||
|
||||
import fs from 'fs-extra';
|
||||
import shell from 'shelljs';
|
||||
|
||||
const NODE_MAJOR_VERSION = parseInt(process.versions.node.split('.')[0], 10);
|
||||
const NODE_MAJOR_VERSION = parseInt(
|
||||
/** @type {string} */ (process.versions.node.split('.')[0]),
|
||||
10,
|
||||
);
|
||||
if (NODE_MAJOR_VERSION < 16) {
|
||||
throw new Error(
|
||||
'This generateExamples Docusaurus script requires at least Node.js 16 and npm 7. See why here: https://github.com/facebook/docusaurus/pull/5722#issuecomment-948847891',
|
||||
);
|
||||
}
|
||||
|
||||
// Generate one example per init template
|
||||
// We use those generated examples as CodeSandbox projects
|
||||
// See https://github.com/facebook/docusaurus/issues/1699
|
||||
/**
|
||||
* Generate one example per init template
|
||||
* We use those generated examples as CodeSandbox projects
|
||||
* See https://github.com/facebook/docusaurus/issues/1699
|
||||
* @param {string} template
|
||||
*/
|
||||
async function generateTemplateExample(template) {
|
||||
try {
|
||||
console.log(
|
||||
|
@ -103,6 +111,12 @@ async function generateTemplateExample(template) {
|
|||
* Button visible here: https://jamstack.org/generators/
|
||||
*/
|
||||
function updateStarters() {
|
||||
/**
|
||||
* @param {Object} param0
|
||||
* @param {string} param0.subfolder
|
||||
* @param {string} param0.remote
|
||||
* @param {string} param0.remoteBranch
|
||||
*/
|
||||
function forcePushGitSubtree({subfolder, remote, remoteBranch}) {
|
||||
console.log('');
|
||||
// See https://stackoverflow.com/questions/33172857/how-do-i-force-a-subtree-push-to-overwrite-remote-changes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue