mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-29 14:38:50 +02:00
refactor: remove copyright comment from swizzled components (#7017)
* refactor: remove copyright comment from swizzled components * Update packages/docusaurus/src/commands/swizzle/actions.ts Co-authored-by: Joshua Chen <sidachen2003@gmail.com> Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
This commit is contained in:
parent
3683f25637
commit
45b7a1b7c8
5 changed files with 35 additions and 2 deletions
|
@ -1,3 +1,11 @@
|
|||
.testClass {
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
.testClass {
|
||||
background: black;
|
||||
}
|
||||
|
|
|
@ -1,3 +1,10 @@
|
|||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
|
||||
export default function ComponentInFolder() {
|
||||
|
|
|
@ -1,3 +1,10 @@
|
|||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
.testClass {
|
||||
background: black;
|
||||
}
|
||||
|
|
|
@ -1,3 +1,10 @@
|
|||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
|
||||
export default function FirstLevelComponent() {
|
||||
|
|
|
@ -81,7 +81,11 @@ export async function eject({
|
|||
const fileName = path.basename(sourceFile);
|
||||
const targetFile = path.join(toPath, fileName);
|
||||
try {
|
||||
await fs.copy(sourceFile, targetFile, {overwrite: true});
|
||||
const fileContents = await fs.readFile(sourceFile, 'utf-8');
|
||||
await fs.outputFile(
|
||||
targetFile,
|
||||
fileContents.trimStart().replace(/^\/\*.+?\*\/\s*/ms, ''),
|
||||
);
|
||||
} catch (err) {
|
||||
throw new Error(
|
||||
logger.interpolate`Could not copy file from ${sourceFile} to ${targetFile}`,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue