This commit is contained in:
Evert Prants 2021-12-18 10:36:28 +02:00
parent a72caa0cf9
commit c7bf60bd61
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
11 changed files with 2336 additions and 582 deletions

1
.eslintignore Normal file
View File

@ -0,0 +1 @@
*.js

46
.eslintrc.js Normal file
View File

@ -0,0 +1,46 @@
module.exports = {
'env': {
'es2021': true,
'node': true
},
'extends': [
'eslint:recommended',
'plugin:@typescript-eslint/recommended'
],
'parser': '@typescript-eslint/parser',
'parserOptions': {
'ecmaVersion': 13,
'sourceType': 'module',
'project': 'tsconfig.json',
'tsconfigRootDir': __dirname,
},
'plugins': [
'@typescript-eslint'
],
'rules': {
'no-empty': [
'error',
{
'allowEmptyCatch': true,
}
],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'indent': [
'error',
2
],
'linebreak-style': [
'error',
'unix'
],
'quotes': [
'error',
'single'
],
'semi': [
'error',
'always'
]
}
};

2635
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"name": "@squeebot/cli", "name": "@squeebot/cli",
"version": "3.4.2", "version": "3.4.3",
"description": "Squeebot v3 runtime, environments and configuration", "description": "Squeebot v3 runtime, environments and configuration",
"main": "dist/squeebot.js", "main": "dist/squeebot.js",
"bin": { "bin": {
@ -25,11 +25,12 @@
"@types/node": "^16.7.10", "@types/node": "^16.7.10",
"@types/tar": "^4.0.5", "@types/tar": "^4.0.5",
"@types/yargs": "^17.0.2", "@types/yargs": "^17.0.2",
"tslint": "^6.1.3", "@typescript-eslint/eslint-plugin": "^5.7.0",
"eslint": "^8.4.1",
"typescript": "^4.4.2" "typescript": "^4.4.2"
}, },
"dependencies": { "dependencies": {
"@squeebot/core": "^3.3.5", "@squeebot/core": "^3.3.6",
"fs-extra": "^10.0.0", "fs-extra": "^10.0.0",
"node-watch": "^0.7.1", "node-watch": "^0.7.1",
"tar": "^6.1.11", "tar": "^6.1.11",

View File

@ -1,4 +1,5 @@
export const gitignore = `/node_modules/ export const gitignore = `/node_modules/
/.out/ /.out/
deployment.json`; deployment.json
`;

View File

@ -48,7 +48,7 @@ export async function buildRepository(
if (onlyDeploy) { if (onlyDeploy) {
if (!await fs.pathExists(outDir)) { if (!await fs.pathExists(outDir)) {
throw new Error(`You need to build before deploying!`); throw new Error('You need to build before deploying!');
} else { } else {
return deploy(meta.name, location, outDir, doDeploy as string); return deploy(meta.name, location, outDir, doDeploy as string);
} }

View File

@ -43,8 +43,10 @@ export async function newRepository(
await executor.installPackage('typescript'); await executor.installPackage('typescript');
await fs.writeJson(path.join(location, 'tsconfig.json'), tsConfig); await fs.writeJson(path.join(location, 'tsconfig.json'), tsConfig);
gitIgnore += '\n*.js'; gitIgnore += '\n*.js';
gitIgnore += '\n!.eslintrc.js';
gitIgnore += '\n*.d.ts'; gitIgnore += '\n*.d.ts';
gitIgnore += '\n*.tsbuildinfo'; gitIgnore += '\n*.tsbuildinfo';
gitIgnore += '\n';
console.log('Adding TypeScript scripts to package.json'); console.log('Adding TypeScript scripts to package.json');
const pkgjson = path.join(location, 'package.json'); const pkgjson = path.join(location, 'package.json');

View File

@ -55,7 +55,7 @@ export class Squeebot implements ISqueebotCore {
constructor(public environment: IEnvironment) {} constructor(public environment: IEnvironment) {}
public async initialize(autostart: boolean = true): Promise<void> { public async initialize(autostart = true): Promise<void> {
// Load configuration // Load configuration
await this.config.load(); await this.config.load();

View File

@ -1,122 +0,0 @@
{
"extends": "tslint:recommended",
"rules": {
"align": {
"options": [
"parameters",
"statements"
]
},
"array-type": false,
"arrow-return-shorthand": true,
"curly": true,
"deprecation": {
"severity": "warning"
},
"eofline": true,
"import-spacing": true,
"indent": {
"options": [
"spaces"
]
},
"max-classes-per-file": false,
"max-line-length": [
true,
140
],
"member-ordering": [
true,
{
"order": [
"static-field",
"instance-field",
"static-method",
"instance-method"
]
}
],
"no-console": [
true,
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-empty": false,
"no-inferrable-types": [
true,
"ignore-params"
],
"no-non-null-assertion": true,
"no-redundant-jsdoc": true,
"no-switch-case-fall-through": true,
"no-var-requires": false,
"object-literal-key-quotes": [
true,
"as-needed"
],
"quotemark": [
true,
"single"
],
"semicolon": {
"options": [
"always"
]
},
"space-before-function-paren": {
"options": {
"anonymous": "never",
"asyncArrow": "always",
"constructor": "never",
"method": "never",
"named": "never"
}
},
"typedef": [
true,
"call-signature"
],
"forin": false,
"ban-types": {
"function": false
},
"typedef-whitespace": {
"options": [
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
},
{
"call-signature": "onespace",
"index-signature": "onespace",
"parameter": "onespace",
"property-declaration": "onespace",
"variable-declaration": "onespace"
}
]
},
"variable-name": {
"options": [
"ban-keywords",
"check-format",
"allow-pascal-case"
]
},
"whitespace": {
"options": [
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type",
"check-typecast"
]
}
}
}