@yarn-tool/setup-module-env 1.0.3 → 1.0.7
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 +45 -0
- package/lib/preset/tsdx/index.d.ts +18 -2
- package/lib/preset/tsdx/index.js +24 -12
- package/lib/preset/tsdx/index.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,51 @@
|
|
|
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
|
+
## [1.0.7](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/setup-module-env@1.0.6...@yarn-tool/setup-module-env@1.0.7) (2022-01-25)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### ♻️ Chores
|
|
10
|
+
|
|
11
|
+
* **deps:** update deps ([9d91e96](https://github.com/bluelovers/ws-yarn-workspaces/commit/9d91e960a0e02ec2896b791cb5933f47d86b0bc5))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [1.0.6](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/setup-module-env@1.0.5...@yarn-tool/setup-module-env@1.0.6) (2022-01-02)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### ✨ Features
|
|
21
|
+
|
|
22
|
+
* support `defaultCopyStaticFilesTsdx` ([4efc0fa](https://github.com/bluelovers/ws-yarn-workspaces/commit/4efc0fa6df9fe4c356844224c11f68aa047ecbcc))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
## [1.0.5](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/setup-module-env@1.0.4...@yarn-tool/setup-module-env@1.0.5) (2021-12-29)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### ✨ Features
|
|
32
|
+
|
|
33
|
+
* unpkg ([a033315](https://github.com/bluelovers/ws-yarn-workspaces/commit/a0333156ace648ee4a7fa874bf910022e5f242c1))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
## [1.0.4](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/setup-module-env@1.0.3...@yarn-tool/setup-module-env@1.0.4) (2021-12-06)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
### 🔖 Miscellaneous
|
|
43
|
+
|
|
44
|
+
* . ([d1aaa65](https://github.com/bluelovers/ws-yarn-workspaces/commit/d1aaa651f6bfc65be3a9d92dc31dc91178df11ab))
|
|
45
|
+
* . ([86a9c16](https://github.com/bluelovers/ws-yarn-workspaces/commit/86a9c16702133f525fafc50843f16c8c54a24df7))
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
6
51
|
## [1.0.3](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/setup-module-env@1.0.2...@yarn-tool/setup-module-env@1.0.3) (2021-12-06)
|
|
7
52
|
|
|
8
53
|
|
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
import { IPackageJson } from '@ts-type/package-dts/package-json';
|
|
2
|
+
import { IFindRootReturnType } from '@yarn-tool/find-root';
|
|
3
|
+
import { IStaticFilesMapArray } from '@yarn-tool/static-file/lib/types';
|
|
2
4
|
export declare function updatePackageJson<P extends IPackageJson>(pkg: P): P;
|
|
3
|
-
export declare
|
|
5
|
+
export declare const defaultCopyStaticFilesTsdx: IStaticFilesMapArray<"tsconfig.json" | "test/tsconfig.json">;
|
|
6
|
+
export interface ISetupTsdxOptions<P extends IPackageJson> {
|
|
7
|
+
targetDir: string;
|
|
4
8
|
pkg: P;
|
|
5
|
-
|
|
9
|
+
rootData: IFindRootReturnType;
|
|
10
|
+
file_map: IStaticFilesMapArray<string>;
|
|
11
|
+
mdFile: string;
|
|
12
|
+
existsReadme: boolean;
|
|
13
|
+
oldExists: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare function setup<P extends IPackageJson>(config: ISetupTsdxOptions<P>): {
|
|
6
16
|
pkg: P;
|
|
17
|
+
file_map: IStaticFilesMapArray<string>;
|
|
18
|
+
targetDir: string;
|
|
19
|
+
rootData: IFindRootReturnType;
|
|
20
|
+
mdFile: string;
|
|
21
|
+
existsReadme: boolean;
|
|
22
|
+
oldExists: boolean;
|
|
7
23
|
};
|
package/lib/preset/tsdx/index.js
CHANGED
|
@@ -1,32 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setup = exports.updatePackageJson = void 0;
|
|
3
|
+
exports.setup = exports.defaultCopyStaticFilesTsdx = exports.updatePackageJson = void 0;
|
|
4
4
|
function updatePackageJson(pkg) {
|
|
5
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
6
|
-
var
|
|
5
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
6
|
+
var _j, _k, _l, _m;
|
|
7
7
|
(_a = pkg.scripts) !== null && _a !== void 0 ? _a : (pkg.scripts = {});
|
|
8
|
-
(_b = (
|
|
9
|
-
pkg.scripts["build"] = "yarn run build:tsdx && yarn run build:dts";
|
|
10
|
-
(_c = (
|
|
11
|
-
(_d = (
|
|
8
|
+
(_b = (_j = pkg.scripts)["posttest"]) !== null && _b !== void 0 ? _b : (_j["posttest"] = "yarn run build");
|
|
9
|
+
pkg.scripts["build"] = "yarn run build:tsdx && yarn run build:dts:bundle";
|
|
10
|
+
(_c = (_k = pkg.scripts)["build:dts:bundle"]) !== null && _c !== void 0 ? _c : (_k["build:dts:bundle"] = "ynpx dts-bundle-generator -o ./dist/index.d.ts ./src/index.ts --no-banner & echo build:dts");
|
|
11
|
+
(_d = (_l = pkg.scripts)["build:tsdx"]) !== null && _d !== void 0 ? _d : (_l["build:tsdx"] = "ynpx @bluelovers/tsdx build --target node --name index");
|
|
12
12
|
pkg.main = "dist/index.cjs";
|
|
13
13
|
pkg.module = "dist/index.esm.mjs";
|
|
14
14
|
pkg.types = pkg.typings = "dist/index.d.ts";
|
|
15
|
-
(_e = pkg.
|
|
16
|
-
(_f =
|
|
15
|
+
(_e = pkg.unpkg) !== null && _e !== void 0 ? _e : (pkg.unpkg = "dist/index.umd.js");
|
|
16
|
+
(_f = pkg.exports) !== null && _f !== void 0 ? _f : (pkg.exports = {});
|
|
17
|
+
(_g = (_m = pkg.exports)['.']) !== null && _g !== void 0 ? _g : (_m['.'] = {});
|
|
18
|
+
pkg.exports['.'].types = "./dist/index.d.ts";
|
|
17
19
|
pkg.exports['.'].import = "./dist/index.esm.mjs";
|
|
18
20
|
pkg.exports['.'].require = "./dist/index.cjs";
|
|
19
|
-
pkg.
|
|
20
|
-
(_g = pkg.keywords) !== null && _g !== void 0 ? _g : (pkg.keywords = []);
|
|
21
|
+
(_h = pkg.keywords) !== null && _h !== void 0 ? _h : (pkg.keywords = []);
|
|
21
22
|
pkg.keywords.push('create-by-tsdx');
|
|
22
23
|
return pkg;
|
|
23
24
|
}
|
|
24
25
|
exports.updatePackageJson = updatePackageJson;
|
|
26
|
+
const _defaultCopyStaticFilesTsdx = [
|
|
27
|
+
['tsconfig.json', 'file/tsconfig.tsdx.json.tpl', 'tsconfig.json'],
|
|
28
|
+
['test/tsconfig.json', 'file/test/tsconfig.json.tpl', 'test/tsconfig.json'],
|
|
29
|
+
];
|
|
30
|
+
exports.defaultCopyStaticFilesTsdx = Object.freeze(_defaultCopyStaticFilesTsdx);
|
|
25
31
|
function setup(config) {
|
|
26
|
-
let { pkg } = config;
|
|
32
|
+
let { pkg, file_map, } = config;
|
|
27
33
|
pkg = updatePackageJson(pkg);
|
|
34
|
+
file_map = [
|
|
35
|
+
...exports.defaultCopyStaticFilesTsdx,
|
|
36
|
+
...file_map,
|
|
37
|
+
];
|
|
28
38
|
return {
|
|
39
|
+
...config,
|
|
29
40
|
pkg,
|
|
41
|
+
file_map,
|
|
30
42
|
};
|
|
31
43
|
}
|
|
32
44
|
exports.setup = setup;
|
|
@@ -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":";;;AAIA,SAAgB,iBAAiB,CAAyB,GAAM;;;IAE/D,MAAA,GAAG,CAAC,OAAO,oCAAX,GAAG,CAAC,OAAO,GAAK,EAAE,EAAC;IAEnB,YAAA,GAAG,CAAC,OAAO,EAAC,UAAU,wCAAV,UAAU,IAAM,gBAAgB,EAAC;IAC7C,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,kDAAkD,CAAC;IAC1E,YAAA,GAAG,CAAC,OAAO,EAAC,kBAAkB,wCAAlB,kBAAkB,IAAM,4FAA4F,EAAC;IACjI,YAAA,GAAG,CAAC,OAAO,EAAC,YAAY,wCAAZ,YAAY,IAAM,wDAAwD,EAAC;IAEvF,GAAG,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAC5B,GAAG,CAAC,MAAM,GAAG,oBAAoB,CAAC;IAClC,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,OAAO,GAAG,iBAAiB,CAAC;IAC5C,MAAA,GAAG,CAAC,KAAK,oCAAT,GAAG,CAAC,KAAK,GAAK,mBAAmB,EAAC;IAElC,MAAA,GAAG,CAAC,OAAO,oCAAX,GAAG,CAAC,OAAO,GAAK,EAAE,EAAC;IACnB,YAAA,GAAG,CAAC,OAAO,EAAC,GAAG,wCAAH,GAAG,IAAM,EAAE,EAAC;IACxB,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,mBAAmB,CAAC;IAC7C,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,sBAAsB,CAAC;IACjD,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,GAAG,kBAAkB,CAAC;IAE9C,MAAA,GAAG,CAAC,QAAQ,oCAAZ,GAAG,CAAC,QAAQ,GAAK,EAAE,EAAC;IACpB,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAEpC,OAAO,GAAG,CAAA;AACX,CAAC;AAxBD,8CAwBC;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,GACR,GAAG,MAAM,CAAC;IAEX,GAAG,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC;IAE7B,QAAQ,GAAG;QACV,GAAG,kCAA0B;QAC7B,GAAG,QAAQ;KACX,CAAC;IAEF,OAAO;QACN,GAAG,MAAM;QACT,GAAG;QACH,QAAQ;KACR,CAAA;AACF,CAAC;AAnBD,sBAmBC","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';\n\nexport function updatePackageJson<P extends IPackageJson>(pkg: P)\n{\n\tpkg.scripts ??= {};\n\n\tpkg.scripts[\"posttest\"] ??= \"yarn run build\";\n\tpkg.scripts[\"build\"] = \"yarn run build:tsdx && yarn run build:dts:bundle\";\n\tpkg.scripts[\"build:dts:bundle\"] ??= \"ynpx dts-bundle-generator -o ./dist/index.d.ts ./src/index.ts --no-banner & echo build:dts\";\n\tpkg.scripts[\"build:tsdx\"] ??= \"ynpx @bluelovers/tsdx build --target node --name index\";\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.js\";\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.keywords ??= [];\n\tpkg.keywords.push('create-by-tsdx');\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} = config;\n\n\tpkg = updatePackageJson(pkg);\n\n\tfile_map = [\n\t\t...defaultCopyStaticFilesTsdx,\n\t\t...file_map,\n\t];\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": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"yarn",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"access": "public"
|
|
57
57
|
},
|
|
58
58
|
"packageManager": "yarn@^1.22.11",
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "fbf381266d9eac5a9f129be640e2690e19cbb956"
|
|
60
60
|
}
|