strictr 0.0.4 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/check.js +9 -2
- package/lib/check.js.map +1 -1
- package/lib/functions/bail.d.ts +3 -0
- package/lib/functions/bail.js +6 -0
- package/lib/functions/bail.js.map +1 -0
- package/lib/functions/check.folder.js +6 -2
- package/lib/functions/check.folder.js.map +1 -1
- package/lib/functions/convert.files.to.objects.js +6 -3
- package/lib/functions/convert.files.to.objects.js.map +1 -1
- package/package.json +83 -81
package/lib/check.js
CHANGED
|
@@ -29,13 +29,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
30
|
const path = __importStar(require("path"));
|
|
31
31
|
const _ = __importStar(require("lodash"));
|
|
32
|
+
const bail_1 = __importDefault(require("./functions/bail"));
|
|
32
33
|
const get_config_1 = __importDefault(require("./functions/get.config"));
|
|
33
34
|
const check_folder_1 = __importDefault(require("./functions/check.folder"));
|
|
35
|
+
const add_use_strict_1 = __importDefault(require("./functions/add.use.strict"));
|
|
34
36
|
const get_files_listing_1 = __importDefault(require("./functions/get.files.listing"));
|
|
35
37
|
const convert_files_to_objects_1 = __importDefault(require("./functions/convert.files.to.objects"));
|
|
36
38
|
const missing_strict_statement_1 = __importDefault(require("./functions/missing.strict.statement"));
|
|
37
39
|
const get_table_from_file_objects_1 = __importDefault(require("./functions/get.table.from.file.objects"));
|
|
38
|
-
const add_use_strict_1 = __importDefault(require("./functions/add.use.strict"));
|
|
39
40
|
exports.default = {
|
|
40
41
|
run(commander) {
|
|
41
42
|
console.clear();
|
|
@@ -79,8 +80,14 @@ exports.default = {
|
|
|
79
80
|
(0, add_use_strict_1.default)(file);
|
|
80
81
|
});
|
|
81
82
|
}
|
|
83
|
+
console.log('\n');
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
if (!_.isEmpty(srcFiles))
|
|
87
|
+
(0, bail_1.default)();
|
|
88
|
+
if (!_.isEmpty(testFiles))
|
|
89
|
+
(0, bail_1.default)();
|
|
82
90
|
}
|
|
83
|
-
console.log('\n');
|
|
84
91
|
}
|
|
85
92
|
};
|
|
86
93
|
//# sourceMappingURL=check.js.map
|
package/lib/check.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.js","sourceRoot":"","sources":["../src/check.ts"],"names":[],"mappings":";AACA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,2CAA6B;AAE7B,0CAA4B;AAE5B,wEAA+C;AAC/C,4EAAmD;AACnD,sFAA4D;AAC5D,oGAAyE;AACzE,oGAA0E;AAC1E,0GAA8E;
|
|
1
|
+
{"version":3,"file":"check.js","sourceRoot":"","sources":["../src/check.ts"],"names":[],"mappings":";AACA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,2CAA6B;AAE7B,0CAA4B;AAE5B,4DAAoC;AACpC,wEAA+C;AAC/C,4EAAmD;AACnD,gFAAsD;AACtD,sFAA4D;AAC5D,oGAAyE;AACzE,oGAA0E;AAC1E,0GAA8E;AAE9E,kBAAe;IACd,GAAG,CAAC,SAAc;QACjB,OAAO,CAAC,KAAK,EAAE,CAAC;QAEhB,MAAM,OAAO,GAAQ,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;QAC1D,MAAM,EAAC,GAAG,GAAG,KAAK,EAAC,GAAG,OAAO,CAAC;QAE9B,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,IAAA,oBAAS,EAAC,IAAI,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,CAAC,CAAC;QAEhD,MAAM,EAAC,aAAa,EAAE,cAAc,EAAC,GAAG,MAAM,CAAC;QAC/C,IAAI,EAAC,cAAc,EAAC,GAAG,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AQ,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;gBAChD,OAAO,CAAC,GAAG,CAAC,oDAAoD,CAAC,CAAC;aAClE;iBAAM;gBACN,OAAO,CAAC,GAAG,CAAC,6DAA6D,CAAC,CAAC;gBAE3E,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE;oBACzB,IAAA,wBAAY,EAAC,IAAI,CAAC,CAAC;gBACpB,CAAC,CAAC,CAAC;gBACH,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;gBAChB,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE;oBAC1B,IAAA,wBAAY,EAAC,IAAI,CAAC,CAAC;gBACpB,CAAC,CAAC,CAAC;aACH;YAED,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;SAClB;aAAM;YACN,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;gBAAE,IAAA,cAAI,GAAE,CAAC;YACjC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;gBAAE,IAAA,cAAI,GAAE,CAAC;SAClC;IACF,CAAC;CACD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bail.js","sourceRoot":"","sources":["../../src/functions/bail.ts"],"names":[],"mappings":";AACA,YAAY,CAAC;;AAEb,MAAM,IAAI,GAAG,CAAC,OAAe,CAAC,EAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5D,kBAAe,IAAI,CAAC"}
|
|
@@ -23,16 +23,20 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
__setModuleDefault(result, mod);
|
|
24
24
|
return result;
|
|
25
25
|
};
|
|
26
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
27
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
|
+
};
|
|
26
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
30
|
const fs = __importStar(require("fs"));
|
|
31
|
+
const bail_1 = __importDefault(require("./bail"));
|
|
28
32
|
const checkFolder = (folder, name) => {
|
|
29
33
|
if (!fs.existsSync(folder)) {
|
|
30
34
|
console.log(`\nERROR: ${name} folder ${folder} does not exist.`);
|
|
31
|
-
|
|
35
|
+
(0, bail_1.default)();
|
|
32
36
|
}
|
|
33
37
|
if (!fs.lstatSync(folder).isDirectory()) {
|
|
34
38
|
console.log(`\nERROR: ${name} folder ${folder} is not a directory.`);
|
|
35
|
-
|
|
39
|
+
(0, bail_1.default)();
|
|
36
40
|
}
|
|
37
41
|
};
|
|
38
42
|
exports.default = checkFolder;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.folder.js","sourceRoot":"","sources":["../../src/functions/check.folder.ts"],"names":[],"mappings":";AACA,YAAY,CAAC
|
|
1
|
+
{"version":3,"file":"check.folder.js","sourceRoot":"","sources":["../../src/functions/check.folder.ts"],"names":[],"mappings":";AACA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,uCAAyB;AACzB,kDAA0B;AAE1B,MAAM,WAAW,GAAG,CAAC,MAAc,EAAE,IAAY,EAAQ,EAAE;IAC1D,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;QAC3B,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,WAAW,MAAM,kBAAkB,CAAC,CAAC;QACjE,IAAA,cAAI,GAAE,CAAC;KACP;IACD,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,EAAE;QACxC,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,WAAW,MAAM,sBAAsB,CAAC,CAAC;QACrE,IAAA,cAAI,GAAE,CAAC;KACP;AACF,CAAC,CAAC;AAEF,kBAAe,WAAW,CAAC"}
|
|
@@ -24,13 +24,16 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
return result;
|
|
25
25
|
};
|
|
26
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
const os = __importStar(require("node:os"));
|
|
27
28
|
const _ = __importStar(require("lodash"));
|
|
28
29
|
const convertFilesToObjects = (files) => {
|
|
30
|
+
const platform = os.platform();
|
|
31
|
+
const separator = 'win32' === platform ? '\\' : '/';
|
|
29
32
|
return _.map(files, (f) => {
|
|
30
|
-
const parts = _.split(f,
|
|
33
|
+
const parts = _.split(f, separator);
|
|
31
34
|
const name = parts.pop();
|
|
32
|
-
const path = _.join(parts,
|
|
33
|
-
const full = path +
|
|
35
|
+
const path = _.join(parts, separator);
|
|
36
|
+
const full = path + separator + name;
|
|
34
37
|
return { name, path, full };
|
|
35
38
|
});
|
|
36
39
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert.files.to.objects.js","sourceRoot":"","sources":["../../src/functions/convert.files.to.objects.ts"],"names":[],"mappings":";AACA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,0CAA4B;AAE5B,MAAM,qBAAqB,GAAG,CAAC,KAAe,EAAS,EAAE;IACxD,OAAO,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE;QACzB,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"convert.files.to.objects.js","sourceRoot":"","sources":["../../src/functions/convert.files.to.objects.ts"],"names":[],"mappings":";AACA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,4CAA8B;AAE9B,0CAA4B;AAE5B,MAAM,qBAAqB,GAAG,CAAC,KAAe,EAAS,EAAE;IACxD,MAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;IAC/B,MAAM,SAAS,GAAG,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;IAEpD,OAAO,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE;QACzB,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;QACpC,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC;QACzB,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QACtC,MAAM,IAAI,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAAC;QACrC,OAAO,EAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,qBAAqB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,81 +1,83 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "strictr",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "strict statement checker",
|
|
5
|
-
"engines": {
|
|
6
|
-
"node": ">=16.0.0"
|
|
7
|
-
},
|
|
8
|
-
"main": "./lib/strictr.js",
|
|
9
|
-
"types": "./lib/strictr.d.ts",
|
|
10
|
-
"scripts": {
|
|
11
|
-
"go": "ts-node ./src/strictr.ts",
|
|
12
|
-
"all": "pnpm i & tsc & pnpm clean & pnpm format & pnpm build & pnpm test & pnpm docs",
|
|
13
|
-
"build": "del /S /Q lib\\* && tsc",
|
|
14
|
-
"build:watch": "tsc --watch",
|
|
15
|
-
"lint": "tslint -p tsconfig.json",
|
|
16
|
-
"docs": "typedoc --readme none --out docs src",
|
|
17
|
-
"test": "nyc mocha -r ts-node/register test/**/*.spec.ts",
|
|
18
|
-
"clean": "tslint --config tslint-imports.json --fix --project .",
|
|
19
|
-
"imports": "tslint --project tsconfig.json --config tslint-imports.json",
|
|
20
|
-
"fiximports": "tslint --project tsconfig.json --config tslint-imports.json --fix --project",
|
|
21
|
-
"format": "prettier --write \"src/**/*.ts\"",
|
|
22
|
-
"up": "pnpm up -i",
|
|
23
|
-
"upgrade": "pnpm up",
|
|
24
|
-
"latest": "pnpm up -i -L"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
"@types/
|
|
66
|
-
"@types/
|
|
67
|
-
"@types/
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"tslint
|
|
77
|
-
"tslint-
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
|
|
81
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "strictr",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "strict statement checker",
|
|
5
|
+
"engines": {
|
|
6
|
+
"node": ">=16.0.0"
|
|
7
|
+
},
|
|
8
|
+
"main": "./lib/strictr.js",
|
|
9
|
+
"types": "./lib/strictr.d.ts",
|
|
10
|
+
"scripts": {
|
|
11
|
+
"go": "ts-node ./src/strictr.ts",
|
|
12
|
+
"all": "pnpm i & tsc & pnpm clean & pnpm format & pnpm build & pnpm test & pnpm docs",
|
|
13
|
+
"build": "del /S /Q lib\\* && tsc",
|
|
14
|
+
"build:watch": "tsc --watch",
|
|
15
|
+
"lint": "tslint -p tsconfig.json",
|
|
16
|
+
"docs": "typedoc --readme none --out docs src",
|
|
17
|
+
"test": "nyc mocha -r ts-node/register test/**/*.spec.ts",
|
|
18
|
+
"clean": "tslint --config tslint-imports.json --fix --project .",
|
|
19
|
+
"imports": "tslint --project tsconfig.json --config tslint-imports.json",
|
|
20
|
+
"fiximports": "tslint --project tsconfig.json --config tslint-imports.json --fix --project",
|
|
21
|
+
"format": "prettier --write \"src/**/*.ts\"",
|
|
22
|
+
"up": "pnpm up -i",
|
|
23
|
+
"upgrade": "pnpm up",
|
|
24
|
+
"latest": "pnpm up -i -L",
|
|
25
|
+
"l": "pnpm i & pnpm latest",
|
|
26
|
+
"preinstall": "npx only-allow pnpm"
|
|
27
|
+
},
|
|
28
|
+
"preferGlobal": true,
|
|
29
|
+
"bin": {
|
|
30
|
+
"strictr": "./lib/strictr.js"
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"lib/**/*"
|
|
34
|
+
],
|
|
35
|
+
"nyc": {
|
|
36
|
+
"include": [
|
|
37
|
+
"src/**/*.ts"
|
|
38
|
+
],
|
|
39
|
+
"exclude": [
|
|
40
|
+
"test/**/*.ts"
|
|
41
|
+
],
|
|
42
|
+
"extension": [
|
|
43
|
+
".ts"
|
|
44
|
+
],
|
|
45
|
+
"require": [
|
|
46
|
+
"ts-node/register"
|
|
47
|
+
],
|
|
48
|
+
"reporter": [
|
|
49
|
+
"text-summary",
|
|
50
|
+
"html"
|
|
51
|
+
],
|
|
52
|
+
"sourceMap": true,
|
|
53
|
+
"instrument": true
|
|
54
|
+
},
|
|
55
|
+
"repository": "https://github.com/cope/strictr.git",
|
|
56
|
+
"author": "Predrag Stojadinovic <Predrag@Stojadinovic.net>",
|
|
57
|
+
"license": "MIT",
|
|
58
|
+
"dependencies": {
|
|
59
|
+
"@types/cli-table": "^0.3.1",
|
|
60
|
+
"cli-table": "^0.3.11",
|
|
61
|
+
"commander": "^9.4.1",
|
|
62
|
+
"lodash": "^4.17.21"
|
|
63
|
+
},
|
|
64
|
+
"devDependencies": {
|
|
65
|
+
"@types/chai": "^4.3.4",
|
|
66
|
+
"@types/commander": "^2.12.2",
|
|
67
|
+
"@types/lodash": "^4.14.191",
|
|
68
|
+
"@types/mocha": "^10.0.1",
|
|
69
|
+
"@types/node": "^18.11.18",
|
|
70
|
+
"chai": "^4.3.7",
|
|
71
|
+
"mocha": "^10.2.0",
|
|
72
|
+
"nyc": "^15.1.0",
|
|
73
|
+
"prettier": "^2.8.1",
|
|
74
|
+
"source-map-support": "^0.5.21",
|
|
75
|
+
"ts-node": "^10.4.0",
|
|
76
|
+
"tslint": "^6.1.3",
|
|
77
|
+
"tslint-config-prettier": "^1.18.0",
|
|
78
|
+
"tslint-etc": "^1.13.10",
|
|
79
|
+
"tslint-no-unused-expression-chai": "^0.1.4",
|
|
80
|
+
"typedoc": "^0.23.23",
|
|
81
|
+
"typescript": "^4.9.4"
|
|
82
|
+
}
|
|
83
|
+
}
|