tsds-validate 1.0.2
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/README.md +27 -0
- package/dist/cjs/command.cjs +49 -0
- package/dist/cjs/command.cjs.map +1 -0
- package/dist/cjs/index.cjs +17 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/esm/command.mjs +33 -0
- package/dist/esm/command.mjs.map +1 -0
- package/dist/esm/index.mjs +1 -0
- package/dist/esm/index.mjs.map +1 -0
- package/dist/types/command.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +59 -0
package/README.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
## tsds-validate
|
|
2
|
+
|
|
3
|
+
Development stack for TypeScript libraries
|
|
4
|
+
|
|
5
|
+
For an example, check out [parser-multipart](https://github.com/kmalakoff/parser-multipart)
|
|
6
|
+
|
|
7
|
+
# Example 1: CLI
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
# build
|
|
11
|
+
$ npm run build
|
|
12
|
+
|
|
13
|
+
# run coverage tests (default on "test/**/*.test.*" only) using c8
|
|
14
|
+
$ tsds coverage
|
|
15
|
+
|
|
16
|
+
# deploy library using np
|
|
17
|
+
$ tsds deploy
|
|
18
|
+
|
|
19
|
+
# format library using prettier
|
|
20
|
+
$ tsds format
|
|
21
|
+
|
|
22
|
+
# run tests on current version of node
|
|
23
|
+
$ tsds test:node
|
|
24
|
+
|
|
25
|
+
# run tests on browser only
|
|
26
|
+
$ tsds test:browser
|
|
27
|
+
```
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return publish;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
var _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
12
|
+
var _url = /*#__PURE__*/ _interop_require_default(require("url"));
|
|
13
|
+
var _crossspawncb = /*#__PURE__*/ _interop_require_default(require("cross-spawn-cb"));
|
|
14
|
+
var _queuecb = /*#__PURE__*/ _interop_require_default(require("queue-cb"));
|
|
15
|
+
var _resolvebinsync = /*#__PURE__*/ _interop_require_default(require("resolve-bin-sync"));
|
|
16
|
+
var _tsdsbiome = /*#__PURE__*/ _interop_require_default(require("tsds-biome"));
|
|
17
|
+
var _tsdsbuild = /*#__PURE__*/ _interop_require_default(require("tsds-build"));
|
|
18
|
+
var _tsdslib = require("tsds-lib");
|
|
19
|
+
var _tsdstypedoc = /*#__PURE__*/ _interop_require_default(require("tsds-typedoc"));
|
|
20
|
+
function _interop_require_default(obj) {
|
|
21
|
+
return obj && obj.__esModule ? obj : {
|
|
22
|
+
default: obj
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
var __dirname = _path.default.dirname(typeof __filename === 'undefined' ? _url.default.fileURLToPath(require("url").pathToFileURL(__filename).toString()) : __filename);
|
|
26
|
+
var major = +process.versions.node.split('.')[0];
|
|
27
|
+
var version = major > 18 ? 'local' : 'stable';
|
|
28
|
+
var dist = _path.default.join(__dirname, '..', '..');
|
|
29
|
+
var workerWrapper = (0, _tsdslib.wrapWorker)(_path.default.join(dist, 'cjs', 'commands', 'validate.cjs'));
|
|
30
|
+
function worker(_args, options, callback) {
|
|
31
|
+
try {
|
|
32
|
+
var depcheck = (0, _resolvebinsync.default)('depcheck');
|
|
33
|
+
var sortPackageJSON = (0, _resolvebinsync.default)('sort-package-json');
|
|
34
|
+
var queue = new _queuecb.default(1);
|
|
35
|
+
queue.defer(_crossspawncb.default.bind(null, depcheck, [], options));
|
|
36
|
+
queue.defer(_tsdsbiome.default.bind(null, [], options));
|
|
37
|
+
queue.defer(_crossspawncb.default.bind(null, sortPackageJSON, [], options));
|
|
38
|
+
queue.defer(_tsdstypedoc.default.bind(null, [], options));
|
|
39
|
+
queue.defer(_tsdsbuild.default.bind(null, [], options));
|
|
40
|
+
queue.await(callback);
|
|
41
|
+
} catch (err) {
|
|
42
|
+
console.log(err.message);
|
|
43
|
+
return callback(err);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function publish(args, options, callback) {
|
|
47
|
+
major < 14 ? workerWrapper(version, args, options, callback) : worker(args, options, callback);
|
|
48
|
+
}
|
|
49
|
+
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) { exports.default[key] = exports[key]; } } catch (_) {}; module.exports = exports.default; }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/typescript/ts-dev-stack/packages/tsds-validate/src/command.ts"],"sourcesContent":["import path from 'path';\nimport url from 'url';\nimport spawn from 'cross-spawn-cb';\nimport Queue from 'queue-cb';\nimport resolveBin from 'resolve-bin-sync';\nimport format from 'tsds-biome';\nimport build from 'tsds-build';\nimport { wrapWorker } from 'tsds-lib';\nimport docs from 'tsds-typedoc';\n\nconst __dirname = path.dirname(typeof __filename === 'undefined' ? url.fileURLToPath(import.meta.url) : __filename);\nconst major = +process.versions.node.split('.')[0];\nconst version = major > 18 ? 'local' : 'stable';\nconst dist = path.join(__dirname, '..', '..');\nconst workerWrapper = wrapWorker(path.join(dist, 'cjs', 'commands', 'validate.cjs'));\n\nfunction worker(_args, options, callback) {\n try {\n const depcheck = resolveBin('depcheck');\n const sortPackageJSON = resolveBin('sort-package-json');\n\n const queue = new Queue(1);\n queue.defer(spawn.bind(null, depcheck, [], options));\n queue.defer(format.bind(null, [], options));\n queue.defer(spawn.bind(null, sortPackageJSON, [], options));\n queue.defer(docs.bind(null, [], options));\n queue.defer(build.bind(null, [], options));\n queue.await(callback);\n } catch (err) {\n console.log(err.message);\n return callback(err);\n }\n}\n\nexport default function publish(args, options, callback) {\n major < 14 ? workerWrapper(version, args, options, callback) : worker(args, options, callback);\n}\n"],"names":["publish","__dirname","path","dirname","__filename","url","fileURLToPath","major","process","versions","node","split","version","dist","join","workerWrapper","wrapWorker","worker","_args","options","callback","depcheck","resolveBin","sortPackageJSON","queue","Queue","defer","spawn","bind","format","docs","build","await","err","console","log","message","args"],"mappings":";;;;+BAkCA;;;eAAwBA;;;2DAlCP;0DACD;mEACE;8DACA;qEACK;gEACJ;gEACD;uBACS;kEACV;;;;;;AAEjB,IAAMC,YAAYC,aAAI,CAACC,OAAO,CAAC,OAAOC,eAAe,cAAcC,YAAG,CAACC,aAAa,CAAC,uDAAmBF;AACxG,IAAMG,QAAQ,CAACC,QAAQC,QAAQ,CAACC,IAAI,CAACC,KAAK,CAAC,IAAI,CAAC,EAAE;AAClD,IAAMC,UAAUL,QAAQ,KAAK,UAAU;AACvC,IAAMM,OAAOX,aAAI,CAACY,IAAI,CAACb,WAAW,MAAM;AACxC,IAAMc,gBAAgBC,IAAAA,mBAAU,EAACd,aAAI,CAACY,IAAI,CAACD,MAAM,OAAO,YAAY;AAEpE,SAASI,OAAOC,KAAK,EAAEC,OAAO,EAAEC,QAAQ;IACtC,IAAI;QACF,IAAMC,WAAWC,IAAAA,uBAAU,EAAC;QAC5B,IAAMC,kBAAkBD,IAAAA,uBAAU,EAAC;QAEnC,IAAME,QAAQ,IAAIC,gBAAK,CAAC;QACxBD,MAAME,KAAK,CAACC,qBAAK,CAACC,IAAI,CAAC,MAAMP,UAAU,EAAE,EAAEF;QAC3CK,MAAME,KAAK,CAACG,kBAAM,CAACD,IAAI,CAAC,MAAM,EAAE,EAAET;QAClCK,MAAME,KAAK,CAACC,qBAAK,CAACC,IAAI,CAAC,MAAML,iBAAiB,EAAE,EAAEJ;QAClDK,MAAME,KAAK,CAACI,oBAAI,CAACF,IAAI,CAAC,MAAM,EAAE,EAAET;QAChCK,MAAME,KAAK,CAACK,kBAAK,CAACH,IAAI,CAAC,MAAM,EAAE,EAAET;QACjCK,MAAMQ,KAAK,CAACZ;IACd,EAAE,OAAOa,KAAK;QACZC,QAAQC,GAAG,CAACF,IAAIG,OAAO;QACvB,OAAOhB,SAASa;IAClB;AACF;AAEe,SAASjC,QAAQqC,IAAI,EAAElB,OAAO,EAAEC,QAAQ;IACrDb,QAAQ,KAAKQ,cAAcH,SAASyB,MAAMlB,SAASC,YAAYH,OAAOoB,MAAMlB,SAASC;AACvF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return _command.default;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
var _command = /*#__PURE__*/ _interop_require_default(require("./command.cjs"));
|
|
12
|
+
function _interop_require_default(obj) {
|
|
13
|
+
return obj && obj.__esModule ? obj : {
|
|
14
|
+
default: obj
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) { exports.default[key] = exports[key]; } } catch (_) {}; module.exports = exports.default; }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/typescript/ts-dev-stack/packages/tsds-validate/src/index.ts"],"sourcesContent":["export { default } from './command';\n"],"names":["default"],"mappings":";;;;+BAASA;;;eAAAA,gBAAO;;;8DAAQ"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import url from 'url';
|
|
3
|
+
import spawn from 'cross-spawn-cb';
|
|
4
|
+
import Queue from 'queue-cb';
|
|
5
|
+
import resolveBin from 'resolve-bin-sync';
|
|
6
|
+
import format from 'tsds-biome';
|
|
7
|
+
import build from 'tsds-build';
|
|
8
|
+
import { wrapWorker } from 'tsds-lib';
|
|
9
|
+
import docs from 'tsds-typedoc';
|
|
10
|
+
const __dirname = path.dirname(typeof __filename === 'undefined' ? url.fileURLToPath(import.meta.url) : __filename);
|
|
11
|
+
const major = +process.versions.node.split('.')[0];
|
|
12
|
+
const version = major > 18 ? 'local' : 'stable';
|
|
13
|
+
const dist = path.join(__dirname, '..', '..');
|
|
14
|
+
const workerWrapper = wrapWorker(path.join(dist, 'cjs', 'commands', 'validate.cjs'));
|
|
15
|
+
function worker(_args, options, callback) {
|
|
16
|
+
try {
|
|
17
|
+
const depcheck = resolveBin('depcheck');
|
|
18
|
+
const sortPackageJSON = resolveBin('sort-package-json');
|
|
19
|
+
const queue = new Queue(1);
|
|
20
|
+
queue.defer(spawn.bind(null, depcheck, [], options));
|
|
21
|
+
queue.defer(format.bind(null, [], options));
|
|
22
|
+
queue.defer(spawn.bind(null, sortPackageJSON, [], options));
|
|
23
|
+
queue.defer(docs.bind(null, [], options));
|
|
24
|
+
queue.defer(build.bind(null, [], options));
|
|
25
|
+
queue.await(callback);
|
|
26
|
+
} catch (err) {
|
|
27
|
+
console.log(err.message);
|
|
28
|
+
return callback(err);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export default function publish(args, options, callback) {
|
|
32
|
+
major < 14 ? workerWrapper(version, args, options, callback) : worker(args, options, callback);
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/typescript/ts-dev-stack/packages/tsds-validate/src/command.ts"],"sourcesContent":["import path from 'path';\nimport url from 'url';\nimport spawn from 'cross-spawn-cb';\nimport Queue from 'queue-cb';\nimport resolveBin from 'resolve-bin-sync';\nimport format from 'tsds-biome';\nimport build from 'tsds-build';\nimport { wrapWorker } from 'tsds-lib';\nimport docs from 'tsds-typedoc';\n\nconst __dirname = path.dirname(typeof __filename === 'undefined' ? url.fileURLToPath(import.meta.url) : __filename);\nconst major = +process.versions.node.split('.')[0];\nconst version = major > 18 ? 'local' : 'stable';\nconst dist = path.join(__dirname, '..', '..');\nconst workerWrapper = wrapWorker(path.join(dist, 'cjs', 'commands', 'validate.cjs'));\n\nfunction worker(_args, options, callback) {\n try {\n const depcheck = resolveBin('depcheck');\n const sortPackageJSON = resolveBin('sort-package-json');\n\n const queue = new Queue(1);\n queue.defer(spawn.bind(null, depcheck, [], options));\n queue.defer(format.bind(null, [], options));\n queue.defer(spawn.bind(null, sortPackageJSON, [], options));\n queue.defer(docs.bind(null, [], options));\n queue.defer(build.bind(null, [], options));\n queue.await(callback);\n } catch (err) {\n console.log(err.message);\n return callback(err);\n }\n}\n\nexport default function publish(args, options, callback) {\n major < 14 ? workerWrapper(version, args, options, callback) : worker(args, options, callback);\n}\n"],"names":["path","url","spawn","Queue","resolveBin","format","build","wrapWorker","docs","__dirname","dirname","__filename","fileURLToPath","major","process","versions","node","split","version","dist","join","workerWrapper","worker","_args","options","callback","depcheck","sortPackageJSON","queue","defer","bind","await","err","console","log","message","publish","args"],"mappings":"AAAA,OAAOA,UAAU,OAAO;AACxB,OAAOC,SAAS,MAAM;AACtB,OAAOC,WAAW,iBAAiB;AACnC,OAAOC,WAAW,WAAW;AAC7B,OAAOC,gBAAgB,mBAAmB;AAC1C,OAAOC,YAAY,aAAa;AAChC,OAAOC,WAAW,aAAa;AAC/B,SAASC,UAAU,QAAQ,WAAW;AACtC,OAAOC,UAAU,eAAe;AAEhC,MAAMC,YAAYT,KAAKU,OAAO,CAAC,OAAOC,eAAe,cAAcV,IAAIW,aAAa,CAAC,YAAYX,GAAG,IAAIU;AACxG,MAAME,QAAQ,CAACC,QAAQC,QAAQ,CAACC,IAAI,CAACC,KAAK,CAAC,IAAI,CAAC,EAAE;AAClD,MAAMC,UAAUL,QAAQ,KAAK,UAAU;AACvC,MAAMM,OAAOnB,KAAKoB,IAAI,CAACX,WAAW,MAAM;AACxC,MAAMY,gBAAgBd,WAAWP,KAAKoB,IAAI,CAACD,MAAM,OAAO,YAAY;AAEpE,SAASG,OAAOC,KAAK,EAAEC,OAAO,EAAEC,QAAQ;IACtC,IAAI;QACF,MAAMC,WAAWtB,WAAW;QAC5B,MAAMuB,kBAAkBvB,WAAW;QAEnC,MAAMwB,QAAQ,IAAIzB,MAAM;QACxByB,MAAMC,KAAK,CAAC3B,MAAM4B,IAAI,CAAC,MAAMJ,UAAU,EAAE,EAAEF;QAC3CI,MAAMC,KAAK,CAACxB,OAAOyB,IAAI,CAAC,MAAM,EAAE,EAAEN;QAClCI,MAAMC,KAAK,CAAC3B,MAAM4B,IAAI,CAAC,MAAMH,iBAAiB,EAAE,EAAEH;QAClDI,MAAMC,KAAK,CAACrB,KAAKsB,IAAI,CAAC,MAAM,EAAE,EAAEN;QAChCI,MAAMC,KAAK,CAACvB,MAAMwB,IAAI,CAAC,MAAM,EAAE,EAAEN;QACjCI,MAAMG,KAAK,CAACN;IACd,EAAE,OAAOO,KAAK;QACZC,QAAQC,GAAG,CAACF,IAAIG,OAAO;QACvB,OAAOV,SAASO;IAClB;AACF;AAEA,eAAe,SAASI,QAAQC,IAAI,EAAEb,OAAO,EAAEC,QAAQ;IACrDZ,QAAQ,KAAKQ,cAAcH,SAASmB,MAAMb,SAASC,YAAYH,OAAOe,MAAMb,SAASC;AACvF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './command.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/typescript/ts-dev-stack/packages/tsds-validate/src/index.ts"],"sourcesContent":["export { default } from './command';\n"],"names":["default"],"mappings":"AAAA,SAASA,OAAO,QAAQ,YAAY"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function publish(args: any, options: any, callback: any): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './command';
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "tsds-validate",
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "Development stack for TypeScript libraries",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"c8",
|
|
7
|
+
"dev",
|
|
8
|
+
"development",
|
|
9
|
+
"mocha",
|
|
10
|
+
"rollup",
|
|
11
|
+
"stack",
|
|
12
|
+
"test",
|
|
13
|
+
"typescript"
|
|
14
|
+
],
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+ssh://git@github.com/kmalakoff/tsds-validate.git"
|
|
18
|
+
},
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"type": "module",
|
|
21
|
+
"exports": {
|
|
22
|
+
"import": "./dist/esm/index.mjs",
|
|
23
|
+
"require": "./dist/cjs/index.cjs",
|
|
24
|
+
"types": "./dist/types/index.d.ts"
|
|
25
|
+
},
|
|
26
|
+
"main": "dist/cjs/index.cjs",
|
|
27
|
+
"module": "dist/esm/index.mjs",
|
|
28
|
+
"types": "dist/types/index.d.ts",
|
|
29
|
+
"files": [
|
|
30
|
+
"dist",
|
|
31
|
+
"assets",
|
|
32
|
+
"scripts"
|
|
33
|
+
],
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "node ../../dev/build/scripts/build.cjs",
|
|
36
|
+
"format": "biome check --write --unsafe src/ test/",
|
|
37
|
+
"test": "",
|
|
38
|
+
"test:engines": "npm test",
|
|
39
|
+
"version": ""
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"cross-spawn-cb": "^2.1.2",
|
|
43
|
+
"queue-cb": "^1.4.10",
|
|
44
|
+
"resolve-bin-sync": "^0.1.4"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@biomejs/biome": "^1.9.4",
|
|
48
|
+
"@types/mocha": "^10.0.10",
|
|
49
|
+
"@types/node": "^22.10.5",
|
|
50
|
+
"tsds-lib-test": "^1.13.2",
|
|
51
|
+
"typescript": "^5.7.3"
|
|
52
|
+
},
|
|
53
|
+
"engines": {
|
|
54
|
+
"node": ">=0.8"
|
|
55
|
+
},
|
|
56
|
+
"tsds": {
|
|
57
|
+
"source": "src/index.ts"
|
|
58
|
+
}
|
|
59
|
+
}
|