@yarn-tool/setup-module-env 1.0.5 → 1.0.9

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 CHANGED
@@ -3,6 +3,50 @@
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.9](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/setup-module-env@1.0.8...@yarn-tool/setup-module-env@1.0.9) (2022-02-01)
7
+
8
+
9
+ ### 🐛 Bug Fixes
10
+
11
+ * keep old build script if it is tsdx ([aa9727f](https://github.com/bluelovers/ws-yarn-workspaces/commit/aa9727f9d599f678eba830b8e96931c5c04a788b))
12
+
13
+
14
+
15
+
16
+
17
+ ## [1.0.8](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/setup-module-env@1.0.7...@yarn-tool/setup-module-env@1.0.8) (2022-02-01)
18
+
19
+
20
+ ### 🔖 Miscellaneous
21
+
22
+ * . ([f199a8f](https://github.com/bluelovers/ws-yarn-workspaces/commit/f199a8f961c45b8aa78eb9d17cf044aa42f7ee80))
23
+
24
+
25
+
26
+
27
+
28
+ ## [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)
29
+
30
+
31
+ ### ♻️ Chores
32
+
33
+ * **deps:** update deps ([9d91e96](https://github.com/bluelovers/ws-yarn-workspaces/commit/9d91e960a0e02ec2896b791cb5933f47d86b0bc5))
34
+
35
+
36
+
37
+
38
+
39
+ ## [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)
40
+
41
+
42
+ ### ✨ Features
43
+
44
+ * support `defaultCopyStaticFilesTsdx` ([4efc0fa](https://github.com/bluelovers/ws-yarn-workspaces/commit/4efc0fa6df9fe4c356844224c11f68aa047ecbcc))
45
+
46
+
47
+
48
+
49
+
6
50
  ## [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)
7
51
 
8
52
 
@@ -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 function setup<P extends IPackageJson>(config: {
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
  };
@@ -1,33 +1,49 @@
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, _h;
6
- var _j, _k, _l, _m;
5
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
6
+ var _o, _p, _q, _r, _s, _t, _u;
7
7
  (_a = pkg.scripts) !== null && _a !== void 0 ? _a : (pkg.scripts = {});
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";
10
- (_c = (_k = pkg.scripts)["build:dts"]) !== null && _c !== void 0 ? _c : (_k["build:dts"] = "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");
8
+ (_b = (_o = pkg.scripts)["posttest"]) !== null && _b !== void 0 ? _b : (_o["posttest"] = "yarn run build");
9
+ if (!((_c = pkg.scripts["build"]) === null || _c === void 0 ? void 0 : _c.includes('run build:tsdx'))) {
10
+ pkg.scripts["build"] = "yarn run build:tsdx && yarn run build:dts:bundle";
11
+ }
12
+ (_d = (_p = pkg.scripts)["build:dts:bundle"]) !== null && _d !== void 0 ? _d : (_p["build:dts:bundle"] = "ynpx dts-bundle-generator -o ./dist/index.d.ts ./src/index.ts --no-banner & echo build:dts");
13
+ (_e = (_q = pkg.scripts)["build:tsdx"]) !== null && _e !== void 0 ? _e : (_q["build:tsdx"] = "ynpx @bluelovers/tsdx build --target node --name index");
14
+ (_f = (_r = pkg.scripts)["build:dts:copy"]) !== null && _f !== void 0 ? _f : (_r["build:dts:copy"] = "copy .\\src\\index.d.ts .\\dist\\index.d.ts & echo build:dts");
15
+ (_g = (_s = pkg.scripts)["build:dts:tsc:emit"]) !== null && _g !== void 0 ? _g : (_s["build:dts:tsc:emit"] = "tsc --emitDeclarationOnly --declaration --noEmit false");
16
+ (_h = (_t = pkg.scripts)["build:dts:tsc"]) !== null && _h !== void 0 ? _h : (_t["build:dts:tsc"] = "yarn run build:dts:tsc:emit && yarn run build:dts:copy");
12
17
  pkg.main = "dist/index.cjs";
13
18
  pkg.module = "dist/index.esm.mjs";
14
19
  pkg.types = pkg.typings = "dist/index.d.ts";
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['.'] = {});
20
+ (_j = pkg.unpkg) !== null && _j !== void 0 ? _j : (pkg.unpkg = "dist/index.umd.js");
21
+ (_k = pkg.exports) !== null && _k !== void 0 ? _k : (pkg.exports = {});
22
+ (_l = (_u = pkg.exports)['.']) !== null && _l !== void 0 ? _l : (_u['.'] = {});
18
23
  pkg.exports['.'].types = "./dist/index.d.ts";
19
24
  pkg.exports['.'].import = "./dist/index.esm.mjs";
20
25
  pkg.exports['.'].require = "./dist/index.cjs";
21
- (_h = pkg.keywords) !== null && _h !== void 0 ? _h : (pkg.keywords = []);
26
+ (_m = pkg.keywords) !== null && _m !== void 0 ? _m : (pkg.keywords = []);
22
27
  pkg.keywords.push('create-by-tsdx');
23
28
  return pkg;
24
29
  }
25
30
  exports.updatePackageJson = updatePackageJson;
31
+ const _defaultCopyStaticFilesTsdx = [
32
+ ['tsconfig.json', 'file/tsconfig.tsdx.json.tpl', 'tsconfig.json'],
33
+ ['test/tsconfig.json', 'file/test/tsconfig.json.tpl', 'test/tsconfig.json'],
34
+ ];
35
+ exports.defaultCopyStaticFilesTsdx = Object.freeze(_defaultCopyStaticFilesTsdx);
26
36
  function setup(config) {
27
- let { pkg } = config;
37
+ let { pkg, file_map, } = config;
28
38
  pkg = updatePackageJson(pkg);
39
+ file_map = [
40
+ ...exports.defaultCopyStaticFilesTsdx,
41
+ ...file_map,
42
+ ];
29
43
  return {
44
+ ...config,
30
45
  pkg,
46
+ file_map,
31
47
  };
32
48
  }
33
49
  exports.setup = setup;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAEA,SAAgB,iBAAiB,CAAyB,GAAM;;;IAE/D,MAAA,GAAG,CAAC,OAAO,oCAAX,GAAG,CAAC,OAA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AAG,CAAC,CAAC;IAE7B,OAAO;QACN,GAAG;KACH,CAAA;AACF,CAAC;AAZD,sBAYC","sourcesContent":["import { IPackageJson } from '@ts-type/package-dts/package-json';\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\";\n\tpkg.scripts[\"build:dts\"] ??= \"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\nexport function setup<P extends IPackageJson>(config: {\n\tpkg: P,\n\n})\n{\n\tlet { pkg } = config;\n\n\tpkg = updatePackageJson(pkg);\n\n\treturn {\n\t\tpkg,\n\t}\n}\n"]}
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;IAE7C,IAAI,CAAC,CAAA,MAAA,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,0CAAE,QAAQ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BAAgB,CAAC,CAAC;IAEpC,OAAO,GAAG,CAAA;AACX,CAAC;AAjCD,8CAiCC;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\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\"] ??= \"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.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\"] ??= \"yarn run build:dts:tsc:emit && yarn run build:dts:copy\";\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.5",
3
+ "version": "1.0.9",
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": "1e6163c54a28b6fcc9adba88f1b227707bc4634c"
59
+ "gitHead": "06fdafdf2381935e0ea65e48216d81e994412baf"
60
60
  }