@yarn-tool/setup-module-env 2.0.13 → 2.0.15
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/CHANGELOG.md +18 -0
- package/lib/preset/tsdx/index.js +5 -2
- package/lib/preset/tsdx/index.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.0.15](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/setup-module-env@2.0.14...@yarn-tool/setup-module-env@2.0.15) (2022-11-04)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @yarn-tool/setup-module-env
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [2.0.14](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/setup-module-env@2.0.13...@yarn-tool/setup-module-env@2.0.14) (2022-10-28)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### ✨ Features
|
|
19
|
+
|
|
20
|
+
* update tsdx config ([1593270](https://github.com/bluelovers/ws-yarn-workspaces/commit/159327075af829fb5c8ddd8a4246c423e4afcdcb))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
6
24
|
## [2.0.13](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/setup-module-env@2.0.12...@yarn-tool/setup-module-env@2.0.13) (2022-10-01)
|
|
7
25
|
|
|
8
26
|
|
package/lib/preset/tsdx/index.js
CHANGED
|
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.setup = exports.defaultCopyStaticFilesTsdx = exports.updatePackageJson = void 0;
|
|
4
4
|
const scripts_1 = require("@yarn-tool/pkg-entry-util/lib/field/scripts");
|
|
5
5
|
const fix_1 = require("./fix");
|
|
6
|
+
const fs_extra_1 = require("fs-extra");
|
|
7
|
+
const path_1 = require("path");
|
|
6
8
|
function updatePackageJson(pkg, config) {
|
|
7
9
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
8
10
|
var _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
@@ -15,7 +17,7 @@ function updatePackageJson(pkg, config) {
|
|
|
15
17
|
if (!((_d = pkg.scripts["build"]) === null || _d === void 0 ? void 0 : _d.includes('run build:tsdx'))) {
|
|
16
18
|
pkg.scripts["build"] = "yarn run build:tsdx && yarn run build:dts:bundle";
|
|
17
19
|
}
|
|
18
|
-
(_e = (_s = pkg.scripts)["build:dts:bundle"]) !== null && _e !== void 0 ? _e : (_s["build:dts:bundle"] = "ynpx dts-bundle-generator -o ./dist/index.d.ts ./src/index.ts --no-banner --inline-declare-global & echo build:dts:bundle" /* EnumScriptsEntry.BUILD_DTS_BUNDLE */);
|
|
20
|
+
(_e = (_s = pkg.scripts)["build:dts:bundle"]) !== null && _e !== void 0 ? _e : (_s["build:dts:bundle"] = "ynpx @bluelovers/dts-bundle-generator -o ./dist/index.d.ts ./src/index.ts --no-banner --inline-declare-global & echo build:dts:bundle" /* EnumScriptsEntry.BUILD_DTS_BUNDLE */);
|
|
19
21
|
(_f = (_t = pkg.scripts)["build:tsdx"]) !== null && _f !== void 0 ? _f : (_t["build:tsdx"] = "ynpx @bluelovers/tsdx build --target node");
|
|
20
22
|
(_g = (_u = pkg.scripts)["build:dts:copy"]) !== null && _g !== void 0 ? _g : (_u["build:dts:copy"] = "copy .\\src\\index.d.ts .\\dist\\index.d.ts & echo build:dts");
|
|
21
23
|
(_h = (_v = pkg.scripts)["build:dts:tsc:emit"]) !== null && _h !== void 0 ? _h : (_v["build:dts:tsc:emit"] = "tsc --emitDeclarationOnly --declaration --noEmit false");
|
|
@@ -49,12 +51,13 @@ const _defaultCopyStaticFilesTsdx = [
|
|
|
49
51
|
];
|
|
50
52
|
exports.defaultCopyStaticFilesTsdx = Object.freeze(_defaultCopyStaticFilesTsdx);
|
|
51
53
|
function setup(config) {
|
|
52
|
-
let { pkg, file_map, } = config;
|
|
54
|
+
let { pkg, file_map, targetDir, } = config;
|
|
53
55
|
pkg = updatePackageJson(pkg, config);
|
|
54
56
|
file_map = [
|
|
55
57
|
...exports.defaultCopyStaticFilesTsdx,
|
|
56
58
|
...file_map,
|
|
57
59
|
];
|
|
60
|
+
(0, fs_extra_1.ensureDirSync)((0, path_1.resolve)(targetDir, 'src'));
|
|
58
61
|
return {
|
|
59
62
|
...config,
|
|
60
63
|
pkg,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAGA,yEAA8G;AAG9G,+BAAuC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAGA,yEAA8G;AAG9G,+BAAuC;AACvC,uCAAyC;AACzC,+BAA+B;AAE/B,SAAgB,iBAAiB,CAAyB,GAAM,EAAE,MAA6B;;;IAE9F,MAAA,GAAG,CAAC,OAAO,oCAAX,GAAG,CAAC,OAAO,GAAK,EAAE,EAAC;IAEnB,IAAI,IAAA,uCAA6B,EAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EACtD;QACC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC;KAC7B;IAED,YAAA,GAAG,CAAC,OAAO,EAAC,MAAM,wCAAN,MAAM,+DAAiC;IAEnD,YAAA,GAAG,CAAC,OAAO,EAAC,UAAU,wCAAV,UAAU,IAAM,gBAAgB,EAAC;IAE7C,IAAI,CAAC,CAAA,MAAA,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,0CAAE,QAAQ,CAAC,gBAAgB,CAAC,CAAA,EACrD;QACC,GAAG,CAAC,OAAO,CAAC,OAA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M,gBAAgB,EAAC;IAEnD,MAAA,GAAG,CAAC,QAAQ,oCAAZ,GAAG,CAAC,QAAQ,GAAK,EAAE,EAAC;IACpB,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,yCAAkB,EAC5C;QACC,GAAG,CAAC,QAAQ,CAAC,IAAI,yCAAkB,CAAC;KACpC;IAED,IAAA,oBAAc,EAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAE5B,OAAO,GAAG,CAAA;AACX,CAAC;AApDD,8CAoDC;AAED,MAAM,2BAA2B,GAAG;IAEnC,CAAC,eAAe,EAAE,6BAA6B,EAAE,eAAe,CAAC;IACjE,CAAC,oBAAoB,EAAE,6BAA6B,EAAE,oBAAoB,CAAC;CAElE,CAAC;AAEE,QAAA,0BAA0B,GAAG,MAAM,CAAC,MAAM,CAAC,2BAA2B,CAA0E,CAAC;AAa9J,SAAgB,KAAK,CAAyB,MAA4B;IAEzE,IAAI,EACH,GAAG,EACH,QAAQ,EACR,SAAS,GACT,GAAG,MAAM,CAAC;IAEX,GAAG,GAAG,iBAAiB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAErC,QAAQ,GAAG;QACR,GAAG,kCAA0B;QAC/B,GAAG,QAAQ;KACX,CAAC;IAEF,IAAA,wBAAa,EAAC,IAAA,cAAO,EAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC;IAEzC,OAAO;QACN,GAAG,MAAM;QACT,GAAG;QACH,QAAQ;KACR,CAAA;AACF,CAAC;AAtBD,sBAsBC","sourcesContent":["import { IPackageJson } from '@ts-type/package-dts/package-json';\nimport { IFindRootReturnType } from '@yarn-tool/find-root';\nimport { _Key, IStaticFilesMapArray } from '@yarn-tool/static-file/lib/types';\nimport { EnumScriptsEntry, scriptsEntryIsNoTestSpecified } from '@yarn-tool/pkg-entry-util/lib/field/scripts';\nimport { deleteValue } from 'dot-values2';\nimport { EnumTsdx } from './const';\nimport { fixTsdxPackage } from './fix';\nimport { ensureDirSync } from 'fs-extra';\nimport { resolve } from 'path';\n\nexport function updatePackageJson<P extends IPackageJson>(pkg: P, config?: ISetupTsdxOptions<P>)\n{\n\tpkg.scripts ??= {};\n\n\tif (scriptsEntryIsNoTestSpecified(pkg.scripts[\"test\"]))\n\t{\n\t\tpkg.scripts[\"test\"] = void 0;\n\t}\n\n\tpkg.scripts[\"test\"] ??= EnumScriptsEntry.JEST_TEST;\n\n\tpkg.scripts[\"posttest\"] ??= \"yarn run build\";\n\n\tif (!pkg.scripts[\"build\"]?.includes('run build:tsdx'))\n\t{\n\t\tpkg.scripts[\"build\"] = \"yarn run build:tsdx && yarn run build:dts:bundle\";\n\t}\n\n\tpkg.scripts[\"build:dts:bundle\"] ??= EnumScriptsEntry.BUILD_DTS_BUNDLE;\n\tpkg.scripts[\"build:tsdx\"] ??= \"ynpx @bluelovers/tsdx build --target node\";\n\n\tpkg.scripts[\"build:dts:copy\"] ??= \"copy .\\\\src\\\\index.d.ts .\\\\dist\\\\index.d.ts & echo build:dts\";\n\tpkg.scripts[\"build:dts:tsc:emit\"] ??= \"tsc --emitDeclarationOnly --declaration --noEmit false\";\n\tpkg.scripts[\"build:dts:tsc\"] ??= [\n 'yarn run build:dts:copy',\n 'yarn run build:dts:tsc:emit',\n 'yarn run build:dts:copy',\n ].join(' && ');\n\n\tpkg.main = \"dist/index.cjs\";\n\tpkg.module = \"dist/index.esm.mjs\";\n\tpkg.types = pkg.typings = \"dist/index.d.ts\";\n\tpkg.unpkg ??= \"dist/index.umd.production.min.cjs\";\n\n\tpkg.exports ??= {};\n\tpkg.exports['.'] ??= {};\n\tpkg.exports['.'].types = \"./dist/index.d.ts\";\n\tpkg.exports['.'].import = \"./dist/index.esm.mjs\";\n\tpkg.exports['.'].require = \"./dist/index.cjs\";\n\n\tpkg.exports['./src/*'] = './src/*';\n\tpkg.exports['./package.json'] ??= './package.json';\n\n\tpkg.keywords ??= [];\n\tif (!pkg.keywords.includes(EnumTsdx.keyword))\n\t{\n\t\tpkg.keywords.push(EnumTsdx.keyword);\n\t}\n\n\tfixTsdxPackage(pkg, config);\n\n\treturn pkg\n}\n\nconst _defaultCopyStaticFilesTsdx = [\n\n\t['tsconfig.json', 'file/tsconfig.tsdx.json.tpl', 'tsconfig.json'],\n\t['test/tsconfig.json', 'file/test/tsconfig.json.tpl', 'test/tsconfig.json'],\n\n] as const;\n\nexport const defaultCopyStaticFilesTsdx = Object.freeze(_defaultCopyStaticFilesTsdx) as any as IStaticFilesMapArray<_Key<typeof _defaultCopyStaticFilesTsdx>>;\n\nexport interface ISetupTsdxOptions<P extends IPackageJson>\n{\n\ttargetDir: string,\n\tpkg: P,\n\trootData: IFindRootReturnType,\n\tfile_map: IStaticFilesMapArray<string>,\n\tmdFile: string,\n\texistsReadme: boolean,\n\toldExists: boolean,\n}\n\nexport function setup<P extends IPackageJson>(config: ISetupTsdxOptions<P>)\n{\n\tlet {\n\t\tpkg,\n\t\tfile_map,\n\t\ttargetDir,\n\t} = config;\n\n\tpkg = updatePackageJson(pkg, config);\n\n\tfile_map = [\n ...defaultCopyStaticFilesTsdx,\n\t\t...file_map,\n\t];\n\n\tensureDirSync(resolve(targetDir, 'src'));\n\n\treturn {\n\t\t...config,\n\t\tpkg,\n\t\tfile_map,\n\t}\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yarn-tool/setup-module-env",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.15",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"yarn",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"tsc:showConfig": "ynpx get-current-tsconfig -p"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@yarn-tool/pkg-entry-util": "^2.0.
|
|
57
|
+
"@yarn-tool/pkg-entry-util": "^2.0.23",
|
|
58
58
|
"dot-values2": "^2.0.6",
|
|
59
59
|
"tslib": ">=2"
|
|
60
60
|
},
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"publishConfig": {
|
|
63
63
|
"access": "public"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "d3d9a1d2fc0fde3c33879283979bc2bbeb91cfea"
|
|
66
66
|
}
|