arylo-init
Advanced tools
Comparing version 2.1.15 to 2.1.16
@@ -67,7 +67,11 @@ "use strict"; | ||
const versionList = UPDATE_MAP[filePoint]; | ||
if (!fs.existsSync(path.resolve(constants.targetPath, filePoint))) { | ||
utils_1.exit(`Miss \`${filePoint}\``); | ||
} | ||
for (const version of versionList) { | ||
patches_1.getVersion(version).update(filePoint.replace(/^\.\//, "")); | ||
const versionObj = patches_1.getVersion(version); | ||
if (!fs.existsSync(path.resolve(constants.targetPath, filePoint))) { | ||
if (versionObj.IGNORE_CHECK_LIST.indexOf(filePoint.replace(/^\.\//, "")) === -1) { | ||
utils_1.exit(`Miss \`${filePoint}\``); | ||
} | ||
continue; | ||
} | ||
versionObj.update(filePoint.replace(/^\.\//, "")); | ||
} | ||
@@ -74,0 +78,0 @@ out.pipe("UPDATE", filePoint); |
@@ -7,2 +7,3 @@ "use strict"; | ||
const pkg_1 = require("../utils/pkg"); | ||
exports.IGNORE_CHECK_LIST = ["test/index.spec.ts"]; | ||
exports.UPDATE_LIST = ["package.json", "test/index.spec.ts"]; | ||
@@ -9,0 +10,0 @@ exports.update = (filePoint) => { |
@@ -12,2 +12,3 @@ import fs = require("fs"); | ||
import { diffVersions, getVersion } from "../patches"; | ||
import { IObj } from "../utils/config"; | ||
@@ -32,5 +33,5 @@ export const handler = () => { | ||
} | ||
const ADD_MAP = {}; | ||
const UPDATE_MAP = {}; | ||
const REMOVE_MAP = {}; | ||
const ADD_MAP: IObj<string[]> = {}; | ||
const UPDATE_MAP: IObj<string[]> = {}; | ||
const REMOVE_MAP: IObj<string[]> = {}; | ||
@@ -80,7 +81,15 @@ const versions = diffVersions(sourceProjectVersion); | ||
const versionList = UPDATE_MAP[filePoint]; | ||
if (!fs.existsSync(path.resolve(constants.targetPath, filePoint))) { | ||
exit(`Miss \`${filePoint}\``); | ||
} | ||
for (const version of versionList) { | ||
getVersion(version).update(filePoint.replace(/^\.\//, "")); | ||
const versionObj = getVersion(version); | ||
if (!fs.existsSync(path.resolve(constants.targetPath, filePoint))) { | ||
if ( | ||
versionObj.IGNORE_CHECK_LIST.indexOf( | ||
filePoint.replace(/^\.\//, "") | ||
) === -1 | ||
) { | ||
exit(`Miss \`${filePoint}\``); | ||
} | ||
continue; | ||
} | ||
versionObj.update(filePoint.replace(/^\.\//, "")); | ||
} | ||
@@ -87,0 +96,0 @@ out.pipe( |
@@ -6,2 +6,4 @@ import * as ftconfig from "ftconfig"; | ||
export const IGNORE_CHECK_LIST = ["test/index.spec.ts"]; | ||
export const UPDATE_LIST = ["package.json", "test/index.spec.ts"]; | ||
@@ -8,0 +10,0 @@ |
@@ -14,2 +14,3 @@ import * as fs from "fs"; | ||
REMOVE_LIST?: string[]; | ||
IGNORE_CHECK_LIST?: string[]; | ||
update?: (filePoint: string) => any; | ||
@@ -16,0 +17,0 @@ } |
import * as path from "path"; | ||
import { IObj } from "./utils/config"; | ||
@@ -39,7 +40,8 @@ export const exit = (msg: string | string[], code = 1) => { | ||
export const getCommand = (name: string): { | ||
export const getCommand = ( | ||
name: string | ||
): { | ||
handler(): boolean; | ||
[key: string]: any; | ||
} => { | ||
} & IObj => { | ||
return require(`./commands/${name}`); | ||
}; |
@@ -1,3 +0,3 @@ | ||
export interface IAnyObj { | ||
[key: string]: any; | ||
export interface IObj<T = any> { | ||
[key: string]: T; | ||
} |
@@ -1,4 +0,4 @@ | ||
import { IAnyObj } from "./config.d"; | ||
import { IObj } from "./config.d"; | ||
export interface IPackage extends IAnyObj { | ||
export interface IPackage extends IObj { | ||
name: string; | ||
@@ -14,26 +14,14 @@ version: string; | ||
files: string[]; | ||
scripts?: { | ||
[name: string]: string; | ||
}; | ||
dependencies?: { | ||
[name: string]: string; | ||
}; | ||
devDependencies?: { | ||
[name: string]: string; | ||
}; | ||
scripts?: IObj<string>; | ||
dependencies?: IObj<string>; | ||
devDependencies?: IObj<string>; | ||
} | ||
export interface ILintstagedrc extends IAnyObj { | ||
linters: { | ||
[key: string]: string[]; | ||
}; | ||
globOptions: { | ||
[key: string]: any; | ||
}; | ||
export interface ILintstagedrc extends IObj { | ||
linters: IObj<string[]>; | ||
globOptions: IObj; | ||
} | ||
export interface IHuskyrc extends IAnyObj { | ||
hooks: { | ||
[key: string]: string; | ||
}; | ||
export interface IHuskyrc extends IObj { | ||
hooks: IObj<string>; | ||
} |
@@ -1,4 +0,4 @@ | ||
import { IAnyObj } from "./config.d"; | ||
import { IObj } from "./config.d"; | ||
export interface ITravis extends IAnyObj { | ||
export interface ITravis extends IObj { | ||
language?: string; | ||
@@ -21,4 +21,4 @@ os?: string[]; | ||
}; | ||
}; | ||
} & IObj; | ||
after_deploy?: string[]; | ||
} |
{ | ||
"name": "arylo-init", | ||
"version": "2.1.15", | ||
"version": "2.1.16", | ||
"description": "Initial Node.js Project for Arylo Edition", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
73607
1800
74