mirror of
https://github.com/DOI-DO/j40-cejst-2.git
synced 2025-10-01 02:33:18 -07:00
fixing merge conflicts
This commit is contained in:
parent
3b150b5761
commit
07c4c030d3
266 changed files with 1868 additions and 1811 deletions
|
@ -2,12 +2,12 @@
|
|||
|
||||
Creating all the various parts of a React component each time a new component is needed is cumbersome and error-prone.
|
||||
|
||||
This folder follows this [link](https://levelup.gitconnected.com/how-to-generate-react-components-from-your-terminal-a27741a5b862) to allow the developer to create a new React component (along with sass, tests and barrell) with a single command. The command is
|
||||
This folder follows this [link](https://levelup.gitconnected.com/how-to-generate-react-components-from-your-terminal-a27741a5b862) to allow the developer to create a new React component (along with sass, tests and barrell) with a single command. The command is
|
||||
|
||||
`npm run gc <NameOfComponent>`
|
||||
`npm run gc <NameOfComponent>`
|
||||
|
||||
For example: to create a new React component called MapGeolocate:
|
||||
|
||||
`npm run gc MapGeolocate`
|
||||
|
||||
Note: gc stands for generate component
|
||||
Note: gc stands for generate component
|
||||
|
|
|
@ -61,4 +61,4 @@ describe('rendering of ${name} Component', () => {
|
|||
// index.ts
|
||||
exports.barrel = name => `import ${name} from './${name}';
|
||||
export default ${name};
|
||||
`;
|
||||
`;
|
||||
|
|
|
@ -8,7 +8,7 @@ if (!name) throw new Error('You must include a component name.');
|
|||
const dir = `./src/components/${name}/`;
|
||||
|
||||
// throw an error if the file already exists
|
||||
if (fs.existsSync(dir)) throw new Error('A component with that name already exists.');
|
||||
if (fs.existsSync(dir)) throw new Error('A component with that name already exists.');
|
||||
|
||||
// create the folder
|
||||
fs.mkdirSync(dir);
|
||||
|
@ -52,4 +52,4 @@ fs.writeFile(`${dir}/index.ts`, barrel(name), writeFileErrorHandler);
|
|||
const fileContent = `${importStatements}\n${exportStatements}`;
|
||||
|
||||
fs.writeFile(`./src/components/index.ts`, fileContent, writeFileErrorHandler);
|
||||
}); */
|
||||
}); */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue