Compare commits

...

3 Commits

Author SHA1 Message Date
b69e6a36c3 license in file + package json 2020-04-26 11:57:42 +02:00
cd7c757daf tsc on test when typescript on 2020-04-26 11:57:32 +02:00
a6e607334c remove unnecessary file 2020-04-26 11:45:22 +02:00
4 changed files with 24 additions and 1827 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@
# stryker temp files
.stryker-tmp
*.log

View File

@ -10,9 +10,10 @@ import path from 'path';
import fs from 'fs-extra';
import { Confirm, Input, AutoComplete } from 'enquirer';
// eslint-disable-next-line id-match
import { findLicense } from 'license';
import { findLicense, getLicense } from 'license';
import { Snippet } from '../../Snippet';
import { DialogHandler } from '../../dialog';
import { modify_json } from '../../Helper';
import { CopyrightGenerator } from './copyright_generator';
import { FileMapper } from './file_mapper';
import { CopyrightOptions } from './copyright_options';
@ -33,6 +34,24 @@ export default class Copyright implements Snippet {
this.fix_file_license.bind (this)
);
modify_json ((json) => {
json.author = `${this.options.author} <${this.options.email}>`;
json.license = this.options.has_license
? this.options.license
: 'UNLICENSED';
});
if (this.options.has_license) {
await fs.writeFile (
path.join (cwd, 'LICENSE'),
getLicense (this.options.license, {
name: this.options.author,
email: this.options.email,
project: this.options.software
})
);
}
if (!this.loaded_from_config && await new Confirm (
{ message: 'should those settings be saved for the next run?' }
)

View File

@ -56,8 +56,10 @@ export default class Node implements Snippet {
lint: 'eslint . --ext .js,.jsx,.ts,.tsx,.vue,.mjs',
test: 'nyc ava'
};
if (use_ts)
if (use_ts) {
(obj.scripts as Record<string, unknown>).compile = 'tsc';
(obj.scripts as Record<string, unknown>).test = 'tsc && nyc ava';
}
return obj;
}, path.join (folder, 'package.json'));
}

File diff suppressed because it is too large Load Diff