fixes
This commit is contained in:
31
lib/snippets/node/Assets.ts
Normal file
31
lib/snippets/node/Assets.ts
Normal file
@ -0,0 +1,31 @@
|
||||
const eslintrc = `module.exports = {
|
||||
env: {
|
||||
commonjs: true,
|
||||
es6: true,
|
||||
node: true
|
||||
},
|
||||
extends: [
|
||||
'@scode'
|
||||
],
|
||||
globals: {
|
||||
Atomics: 'readonly',
|
||||
SharedArrayBuffer: 'readonly'
|
||||
},
|
||||
parserOptions: {
|
||||
ecmaVersion: 2018
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const gitignore = `/node_modules/
|
||||
/dist/
|
||||
/.nyc_output/
|
||||
/coverage/
|
||||
`;
|
||||
|
||||
const index = '';
|
||||
|
||||
const npmrc = `@scode:registry=https://npm.scode.ovh
|
||||
`;
|
||||
|
||||
export { eslintrc, gitignore, index, npmrc };
|
@ -11,12 +11,9 @@ import { Snippet } from '../../Snippet';
|
||||
import { apply_template, modify_json, run_command } from '../../Helper';
|
||||
|
||||
|
||||
import eslintrc from './template/eslintrc.asset';
|
||||
import npmrc from './template/npmrc.asset';
|
||||
import index from './template/index.asset';
|
||||
import gitignore from './template/gitignore.asset';
|
||||
import { eslintrc, gitignore, index, npmrc } from './Assets';
|
||||
|
||||
export class Node implements Snippet {
|
||||
export default class Node implements Snippet {
|
||||
public async start (): Promise<void> {
|
||||
const folder = await new Input (
|
||||
{ message: 'project name (leave empty for current folder):' }
|
||||
@ -28,9 +25,9 @@ export class Node implements Snippet {
|
||||
await apply_template (index, path.join (folder, 'index.js'));
|
||||
await apply_template (gitignore, path.join (folder, '.gitignore'));
|
||||
|
||||
await run_command ('git init', folder);
|
||||
await run_command ('yarn init -y', folder);
|
||||
await run_command (
|
||||
run_command ('git init', folder);
|
||||
run_command ('yarn init -y', folder);
|
||||
run_command (
|
||||
'yarn add --dev @scode/eslint-config eslint nyc ava',
|
||||
folder
|
||||
);
|
||||
|
@ -1,17 +0,0 @@
|
||||
module.exports = {
|
||||
env: {
|
||||
commonjs: true,
|
||||
es6: true,
|
||||
node: true
|
||||
},
|
||||
extends: [
|
||||
'@scode'
|
||||
],
|
||||
globals: {
|
||||
Atomics: 'readonly',
|
||||
SharedArrayBuffer: 'readonly'
|
||||
},
|
||||
parserOptions: {
|
||||
ecmaVersion: 2018
|
||||
}
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
/node_modules/
|
||||
/dist/
|
||||
/.nyc_output/
|
||||
/coverage/
|
@ -1 +0,0 @@
|
||||
@scode:registry=https://npm.scode.ovh
|
Reference in New Issue
Block a user