@yarn-tool/setup-module-env 3.0.0 → 3.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/CHANGELOG.md +23 -0
- package/lib/preset/tsdx/fix.js +1 -2
- package/lib/preset/tsdx/fix.js.map +1 -1
- package/lib/preset/tsdx/index.d.ts +4 -2
- package/lib/preset/tsdx/index.js +3 -3
- package/lib/preset/tsdx/index.js.map +1 -1
- package/lib/preset/tsdx/is-tsdx.js +1 -2
- package/lib/preset/tsdx/is-tsdx.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,29 @@
|
|
|
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
|
+
## [3.0.2](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/setup-module-env@3.0.1...@yarn-tool/setup-module-env@3.0.2) (2024-05-03)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### 🛠 Build System
|
|
11
|
+
|
|
12
|
+
* update typescript ([ffa656a](https://github.com/bluelovers/ws-yarn-workspaces/commit/ffa656aefe53966db445d52234eb0efe4651e3dd))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### 📌 Dependencies
|
|
16
|
+
|
|
17
|
+
* update deps ([f731d88](https://github.com/bluelovers/ws-yarn-workspaces/commit/f731d88db6e63d180e2db2e493beb42e84eb8e16))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
## [3.0.1](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/setup-module-env@3.0.0...@yarn-tool/setup-module-env@3.0.1) (2024-02-28)
|
|
22
|
+
|
|
23
|
+
**Note:** Version bump only for package @yarn-tool/setup-module-env
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
6
29
|
# [3.0.0](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/setup-module-env@2.0.18...@yarn-tool/setup-module-env@3.0.0) (2023-10-10)
|
|
7
30
|
|
|
8
31
|
|
package/lib/preset/tsdx/fix.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fixTsdxPackage =
|
|
3
|
+
exports.fixTsdxPackage = fixTsdxPackage;
|
|
4
4
|
const dot_values2_1 = require("dot-values2");
|
|
5
5
|
function fixTsdxPackage(pkg, config) {
|
|
6
6
|
var _a, _b, _c, _d, _e;
|
|
@@ -21,5 +21,4 @@ function fixTsdxPackage(pkg, config) {
|
|
|
21
21
|
}
|
|
22
22
|
return pkg;
|
|
23
23
|
}
|
|
24
|
-
exports.fixTsdxPackage = fixTsdxPackage;
|
|
25
24
|
//# sourceMappingURL=fix.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fix.js","sourceRoot":"","sources":["fix.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fix.js","sourceRoot":"","sources":["fix.ts"],"names":[],"mappings":";;AAKA,wCAwBC;AA3BD,6CAA0C;AAG1C,SAAgB,cAAc,CAAyB,GAAM,EAAE,MAAsD;;;IAEpH,IAAI,MAAM,CAAC,QAAQ,CAAC,YAAY,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,EAChE,CAAC;QACA,IAAA,yBAAW,EAAC,GAAG,EAAE,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC,CAAC;QAC5C,IAAA,yBAAW,EAAC,GAAG,EAAE,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC,CAAC;IAChD,CAAC;SAED,CAAC;QACA,MAAA,GAAG,CAAC,eAAe,oCAAnB,GAAG,CAAC,eAAe,GAAK,EAAE,EAAC;QAE3B,IAAI,CAAA,MAAA,MAAA,GAAG,CAAC,YAAY,0CAAG,OAAO,CAAC,0CAAE,MAAM,IAAG,CAAC,EAC3C,CAAC;YACA,YAAA,GAAG,CAAC,eAAe,EAAC,OAAO,wCAAP,OAAO,IAAM,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,EAAC;YAC3D,IAAA,yBAAW,EAAC,GAAG,EAAE,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC,CAAC;QAC7C,CAAC;QAED,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,EAC1B,CAAC;YACA,YAAA,GAAG,CAAC,eAAe,EAAC,sBAAsB,wCAAtB,sBAAsB,IAAM,GAAG,EAAC;QACrD,CAAC;IACF,CAAC;IAED,OAAO,GAAG,CAAA;AACX,CAAC","sourcesContent":["import { IPackageJson } from '@ts-type/package-dts/package-json';\nimport { ISetupTsdxOptions } from './index';\nimport { deleteValue } from 'dot-values2';\nimport { ITSPickExtra } from 'ts-type/lib/type/record';\n\nexport function fixTsdxPackage<P extends IPackageJson>(pkg: P, config: ITSPickExtra<ISetupTsdxOptions<P>, 'rootData'>)\n{\n\tif (config.rootData.hasWorkspace && !config.rootData.isWorkspace)\n\t{\n\t\tdeleteValue(pkg, ['dependencies', 'tslib']);\n\t\tdeleteValue(pkg, ['devDependencies', 'tslib']);\n\t}\n\telse\n\t{\n\t\tpkg.devDependencies ??= {};\n\n\t\tif (pkg.dependencies?.['tslib']?.length > 0)\n\t\t{\n\t\t\tpkg.devDependencies['tslib'] ??= pkg.dependencies['tslib'];\n\t\t\tdeleteValue(pkg, ['dependencies', 'tslib']);\n\t\t}\n\n\t\tif (config.rootData.isRoot)\n\t\t{\n\t\t\tpkg.devDependencies['@bluelovers/tsconfig'] ??= '*';\n\t\t}\n\t}\n\n\treturn pkg\n}\n"]}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { IPackageJson } from '@ts-type/package-dts/package-json';
|
|
2
2
|
import { IFindRootReturnType } from '@yarn-tool/find-root';
|
|
3
|
-
import { IStaticFilesMapArray } from '@yarn-tool/static-file/lib/types';
|
|
3
|
+
import { _Key, IStaticFilesMapArray } from '@yarn-tool/static-file/lib/types';
|
|
4
4
|
export declare function updatePackageJson<P extends IPackageJson>(pkg: P, config?: ISetupTsdxOptions<P>): P;
|
|
5
|
-
|
|
5
|
+
declare const _defaultCopyStaticFilesTsdx: readonly [readonly ["tsconfig.json", "file/tsconfig.tsdx.json.tpl", "tsconfig.json"], readonly ["test/tsconfig.json", "file/test/tsconfig.json.tpl", "test/tsconfig.json"], readonly ["src/index.cts", "file/tsdx/index.cts"]];
|
|
6
|
+
export declare const defaultCopyStaticFilesTsdx: IStaticFilesMapArray<_Key<typeof _defaultCopyStaticFilesTsdx>>;
|
|
6
7
|
export interface ISetupTsdxOptions<P extends IPackageJson> {
|
|
7
8
|
targetDir: string;
|
|
8
9
|
pkg: P;
|
|
@@ -21,3 +22,4 @@ export declare function setup<P extends IPackageJson>(config: ISetupTsdxOptions<
|
|
|
21
22
|
existsReadme: boolean;
|
|
22
23
|
oldExists: boolean;
|
|
23
24
|
};
|
|
25
|
+
export {};
|
package/lib/preset/tsdx/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.defaultCopyStaticFilesTsdx = void 0;
|
|
4
|
+
exports.updatePackageJson = updatePackageJson;
|
|
5
|
+
exports.setup = setup;
|
|
4
6
|
const scripts_1 = require("@yarn-tool/pkg-entry-util/lib/field/scripts");
|
|
5
7
|
const fix_1 = require("./fix");
|
|
6
8
|
const fs_extra_1 = require("fs-extra");
|
|
@@ -44,7 +46,6 @@ function updatePackageJson(pkg, config) {
|
|
|
44
46
|
(0, fix_1.fixTsdxPackage)(pkg, config);
|
|
45
47
|
return pkg;
|
|
46
48
|
}
|
|
47
|
-
exports.updatePackageJson = updatePackageJson;
|
|
48
49
|
const _defaultCopyStaticFilesTsdx = [
|
|
49
50
|
['tsconfig.json', 'file/tsconfig.tsdx.json.tpl', 'tsconfig.json'],
|
|
50
51
|
['test/tsconfig.json', 'file/test/tsconfig.json.tpl', 'test/tsconfig.json'],
|
|
@@ -65,5 +66,4 @@ function setup(config) {
|
|
|
65
66
|
file_map,
|
|
66
67
|
};
|
|
67
68
|
}
|
|
68
|
-
exports.setup = setup;
|
|
69
69
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAUA,8CAoDC;AAuBD,sBAsBC;AAxGD,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,CAAC;QACA,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC;IAC9B,CAAC;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,CAAC;QACA,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,kDAAkD,CAAC;IAC3E,CAAC;IAED,YAAA,GAAG,CAAC,OAAO,EAAC,kBAAkB,wCAAlB,kBAAkB,qLAAwC;IACtE,YAAA,GAAG,CAAC,OAAO,EAAC,YAAY,wCAAZ,Y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C5C,CAAC;QACA,GAAG,CAAC,QAAQ,CAAC,IAAI,yCAAkB,CAAC;IACrC,CAAC;IAED,IAAA,oBAAc,EAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAE5B,OAAO,GAAG,CAAA;AACX,CAAC;AAED,MAAM,2BAA2B,GAAG;IAEnC,CAAC,eAAe,EAAE,6BAA6B,EAAE,eAAe,CAAC;IACjE,CAAC,oBAAoB,EAAE,6BAA6B,EAAE,oBAAoB,CAAC;IAC3E,CAAC,eAAe,EAAE,qBAAqB,CAAC;CAE/B,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","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\t['src/index.cts', 'file/tsdx/index.cts'],\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"]}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isTsdxPackage =
|
|
3
|
+
exports.isTsdxPackage = isTsdxPackage;
|
|
4
4
|
function isTsdxPackage(pkg, config) {
|
|
5
5
|
var _a, _b;
|
|
6
6
|
return ((_a = pkg.keywords) === null || _a === void 0 ? void 0 : _a.includes("create-by-tsdx" /* EnumTsdx.keyword */)) && typeof ((_b = pkg.exports) === null || _b === void 0 ? void 0 : _b['.']) === 'object';
|
|
7
7
|
}
|
|
8
|
-
exports.isTsdxPackage = isTsdxPackage;
|
|
9
8
|
//# sourceMappingURL=is-tsdx.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-tsdx.js","sourceRoot":"","sources":["is-tsdx.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"is-tsdx.js","sourceRoot":"","sources":["is-tsdx.ts"],"names":[],"mappings":";;AAIA,sCAGC;AAHD,SAAgB,aAAa,CAAyB,GAAM,EAAE,MAA6B;;IAE1F,OAAO,CAAA,MAAA,GAAG,CAAC,QAAQ,0CAAE,QAAQ,yCAAkB,KAAI,OAAO,CAAA,MAAA,GAAG,CAAC,OAAO,0CAAG,GAAG,CAAC,CAAA,KAAK,QAAQ,CAAA;AAC1F,CAAC","sourcesContent":["import { IPackageJson } from '@ts-type/package-dts/package-json';\nimport { ISetupTsdxOptions } from './index';\nimport { EnumTsdx } from './const';\n\nexport function isTsdxPackage<P extends IPackageJson>(pkg: P, config?: ISetupTsdxOptions<P>)\n{\n\treturn pkg.keywords?.includes(EnumTsdx.keyword) && typeof pkg.exports?.['.'] === 'object'\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yarn-tool/setup-module-env",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"yarn",
|
|
@@ -55,13 +55,13 @@
|
|
|
55
55
|
"tsc:showConfig": "ynpx get-current-tsconfig -p"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@yarn-tool/pkg-entry-util": "^3.0.
|
|
59
|
-
"dot-values2": "^2.0.
|
|
58
|
+
"@yarn-tool/pkg-entry-util": "^3.0.2",
|
|
59
|
+
"dot-values2": "^2.0.7",
|
|
60
60
|
"tslib": ">=2"
|
|
61
61
|
},
|
|
62
62
|
"packageManager": "yarn@1.22.19",
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "089606f66f3c5501a8f3fdfc42e5a85b57f4d0e9"
|
|
67
67
|
}
|