This commit is contained in:
2020-05-07 18:40:35 +02:00
parent ab66113c89
commit c25b352041
32 changed files with 124 additions and 138 deletions

View File

@ -2,7 +2,7 @@
* Copyright (C) SapphireCode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@sapphirecode.ovh>, April 2020
* Created by Timo Hocker <timo@scode.ovh>, May 2020
*/
module.exports = {

View File

@ -1,3 +1,10 @@
/*
* Copyright (C) SapphireCode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, May 2020
*/
import path from 'path';
import child_process from 'child_process';
import fs from 'fs-extra';

View File

@ -2,7 +2,7 @@
* Copyright (C) SapphireCode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, April 2020
* Created by Timo Hocker <timo@scode.ovh>, May 2020
*/
export interface Snippet {

View File

@ -2,7 +2,7 @@
* Copyright (C) SapphireCode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, April 2020
* Created by Timo Hocker <timo@scode.ovh>, May 2020
*/
export class DialogHandler {

2
lib/enquirer.d.ts vendored
View File

@ -2,7 +2,7 @@
* Copyright (C) SapphireCode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, April 2020
* Created by Timo Hocker <timo@scode.ovh>, May 2020
*/
declare module 'enquirer';

View File

@ -2,7 +2,7 @@
* Copyright (C) SapphireCode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, April 2020
* Created by Timo Hocker <timo@scode.ovh>, May 2020
*/
import path from 'path';

View File

@ -2,7 +2,7 @@
* Copyright (C) SapphireCode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, April 2020
* Created by Timo Hocker <timo@scode.ovh>, May 2020
*/
import { CopyrightOptions } from './copyright_options';

View File

@ -2,7 +2,7 @@
* Copyright (C) SapphireCode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, April 2020
* Created by Timo Hocker <timo@scode.ovh>, May 2020
*/
export class CopyrightOptions {

View File

@ -2,7 +2,7 @@
* Copyright (C) SapphireCode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, April 2020
* Created by Timo Hocker <timo@scode.ovh>, May 2020
*/
/* eslint-disable no-await-in-loop */

View File

@ -2,7 +2,7 @@
* Copyright (C) SapphireCode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, April 2020
* Created by Timo Hocker <timo@scode.ovh>, May 2020
*/
/* eslint-disable no-await-in-loop */

View File

@ -1,3 +1,10 @@
/*
* Copyright (C) SapphireCode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, May 2020
*/
import { ColumnType } from './ColumnType';
import { Relation } from './Relation';

View File

@ -1,3 +1,10 @@
/*
* Copyright (C) SapphireCode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, May 2020
*/
export enum ColumnType {
string = 'string',
text = 'text',

View File

@ -1,3 +1,10 @@
/*
* Copyright (C) SapphireCode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, May 2020
*/
import { Table } from './Table';
export class Database {

View File

@ -1,3 +1,10 @@
/*
* Copyright (C) SapphireCode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, May 2020
*/
import { Database } from './Database';
export interface PatchAction {

View File

@ -1,3 +1,10 @@
/*
* Copyright (C) SapphireCode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, May 2020
*/
export enum PatchActions {
rename_column = 'rc',
add_column = 'ac',

View File

@ -1,3 +1,10 @@
/*
* Copyright (C) SapphireCode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, May 2020
*/
export class Relation {
public column: string;
public table: string;

View File

@ -1,3 +1,10 @@
/*
* Copyright (C) SapphireCode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, May 2020
*/
export interface Serializable {
serialize(): string;
}

View File

@ -1,3 +1,10 @@
/*
* Copyright (C) SapphireCode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, May 2020
*/
import { Column } from './Column';
export class Table {

View File

@ -1,3 +1,10 @@
/*
* Copyright (C) SapphireCode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, May 2020
*/
import { Snippet } from '../../Snippet';
export default class Database implements Snippet {

View File

@ -1,3 +1,10 @@
/*
* Copyright (C) SapphireCode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, May 2020
*/
import { Serializable } from '../classes/Serializable';
import { PatchAction } from '../classes/PatchAction';
import { Database } from '../classes/Database';

View File

@ -1,3 +1,10 @@
/*
* Copyright (C) SapphireCode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, May 2020
*/
/* eslint-disable max-len */
import { files } from '@sapphirecode/standard';

View File

@ -2,7 +2,7 @@
* Copyright (C) SapphireCode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, April 2020
* Created by Timo Hocker <timo@scode.ovh>, May 2020
*/
import { Confirm } from 'enquirer';

View File

@ -1,3 +1,10 @@
/*
* Copyright (C) SapphireCode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, May 2020
*/
const eslintrc = `module.exports = {
env: {
commonjs: true,
@ -5,7 +12,7 @@ const eslintrc = `module.exports = {
node: true
},
extends: [
'@scode'
'@sapphirecode'
],
globals: {
Atomics: 'readonly',
@ -24,7 +31,7 @@ const eslintrc_ts = `module.exports = {
node: true
},
extends: [
'@scode/eslint-config-ts'
'@sapphirecode/eslint-config-ts'
],
globals: {
Atomics: 'readonly',
@ -42,9 +49,6 @@ const gitignore = `/node_modules/
/coverage/
`;
const npmrc = `@scode:registry=https://npm.scode.ovh
`;
const tsconfig = `{
"compilerOptions": {
"target": "es5",
@ -63,4 +67,4 @@ const eslintignore = `/dist/
*.d.ts
`;
export { eslintrc, gitignore, npmrc, tsconfig, eslintrc_ts, eslintignore };
export { eslintrc, gitignore, tsconfig, eslintrc_ts, eslintignore };

View File

@ -2,7 +2,7 @@
* Copyright (C) SapphireCode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, April 2020
* Created by Timo Hocker <timo@scode.ovh>, May 2020
*/
import path from 'path';
@ -12,7 +12,7 @@ import { Snippet } from '../../Snippet';
import { apply_template, modify_json, run_command } from '../../Helper';
import {
eslintrc, gitignore, npmrc,
eslintrc, gitignore,
tsconfig, eslintrc_ts, eslintignore
} from './Assets';
@ -75,7 +75,6 @@ export default class Node implements Snippet {
.run ();
await apply_template (eslintrc, path.join (folder, '.eslintrc.js'));
await apply_template (npmrc, path.join (folder, '.npmrc'));
await apply_template (gitignore, path.join (folder, '.gitignore'));
await apply_template (
eslintignore,
@ -91,7 +90,7 @@ export default class Node implements Snippet {
run_command ('git init', folder);
run_command ('yarn init -y', folder);
run_command (
`yarn add --dev @scode/eslint-config${use_ts
`yarn add --dev @sapphirecode/eslint-config${use_ts
? '-ts typescript @ava/typescript'
: ''} eslint nyc ava`,
folder