@yarn-tool/setup-module-env 1.0.4 → 1.0.8

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.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)
7
+
8
+
9
+ ### 🔖 Miscellaneous
10
+
11
+ * . ([f199a8f](https://github.com/bluelovers/ws-yarn-workspaces/commit/f199a8f961c45b8aa78eb9d17cf044aa42f7ee80))
12
+
13
+
14
+
15
+
16
+
17
+ ## [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)
18
+
19
+
20
+ ### ♻️ Chores
21
+
22
+ * **deps:** update deps ([9d91e96](https://github.com/bluelovers/ws-yarn-workspaces/commit/9d91e960a0e02ec2896b791cb5933f47d86b0bc5))
23
+
24
+
25
+
26
+
27
+
28
+ ## [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)
29
+
30
+
31
+ ### ✨ Features
32
+
33
+ * support `defaultCopyStaticFilesTsdx` ([4efc0fa](https://github.com/bluelovers/ws-yarn-workspaces/commit/4efc0fa6df9fe4c356844224c11f68aa047ecbcc))
34
+
35
+
36
+
37
+
38
+
39
+ ## [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)
40
+
41
+
42
+ ### ✨ Features
43
+
44
+ * unpkg ([a033315](https://github.com/bluelovers/ws-yarn-workspaces/commit/a0333156ace648ee4a7fa874bf910022e5f242c1))
45
+
46
+
47
+
48
+
49
+
6
50
  ## [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)
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,32 +1,47 @@
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 _h, _j, _k, _l;
5
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
6
+ var _m, _o, _p, _q, _r, _s, _t;
7
7
  (_a = pkg.scripts) !== null && _a !== void 0 ? _a : (pkg.scripts = {});
8
- (_b = (_h = pkg.scripts)["posttest"]) !== null && _b !== void 0 ? _b : (_h["posttest"] = "yarn run build");
9
- pkg.scripts["build"] = "yarn run build:tsdx && yarn run build:dts";
10
- (_c = (_j = pkg.scripts)["build:dts"]) !== null && _c !== void 0 ? _c : (_j["build:dts"] = "ynpx dts-bundle-generator -o ./dist/index.d.ts ./src/index.ts --no-banner & echo build:dts");
11
- (_d = (_k = pkg.scripts)["build:tsdx"]) !== null && _d !== void 0 ? _d : (_k["build:tsdx"] = "ynpx @bluelovers/tsdx build --target node --name index");
8
+ (_b = (_m = pkg.scripts)["posttest"]) !== null && _b !== void 0 ? _b : (_m["posttest"] = "yarn run build");
9
+ pkg.scripts["build"] = "yarn run build:tsdx && yarn run build:dts:bundle";
10
+ (_c = (_o = pkg.scripts)["build:dts:bundle"]) !== null && _c !== void 0 ? _c : (_o["build:dts:bundle"] = "ynpx dts-bundle-generator -o ./dist/index.d.ts ./src/index.ts --no-banner & echo build:dts");
11
+ (_d = (_p = pkg.scripts)["build:tsdx"]) !== null && _d !== void 0 ? _d : (_p["build:tsdx"] = "ynpx @bluelovers/tsdx build --target node --name index");
12
+ (_e = (_q = pkg.scripts)["build:dts:copy"]) !== null && _e !== void 0 ? _e : (_q["build:dts:copy"] = "copy .\\src\\index.d.ts .\\dist\\index.d.ts & echo build:dts");
13
+ (_f = (_r = pkg.scripts)["build:dts:tsc:emit"]) !== null && _f !== void 0 ? _f : (_r["build:dts:tsc:emit"] = "tsc --emitDeclarationOnly --declaration --noEmit false");
14
+ (_g = (_s = pkg.scripts)["build:dts:tsc"]) !== null && _g !== void 0 ? _g : (_s["build:dts:tsc"] = "yarn run build:dts:tsc:emit && yarn run build:dts:copy");
12
15
  pkg.main = "dist/index.cjs";
13
16
  pkg.module = "dist/index.esm.mjs";
14
17
  pkg.types = pkg.typings = "dist/index.d.ts";
15
- (_e = pkg.exports) !== null && _e !== void 0 ? _e : (pkg.exports = {});
16
- (_f = (_l = pkg.exports)['.']) !== null && _f !== void 0 ? _f : (_l['.'] = {});
18
+ (_h = pkg.unpkg) !== null && _h !== void 0 ? _h : (pkg.unpkg = "dist/index.umd.js");
19
+ (_j = pkg.exports) !== null && _j !== void 0 ? _j : (pkg.exports = {});
20
+ (_k = (_t = pkg.exports)['.']) !== null && _k !== void 0 ? _k : (_t['.'] = {});
17
21
  pkg.exports['.'].types = "./dist/index.d.ts";
18
22
  pkg.exports['.'].import = "./dist/index.esm.mjs";
19
23
  pkg.exports['.'].require = "./dist/index.cjs";
20
- (_g = pkg.keywords) !== null && _g !== void 0 ? _g : (pkg.keywords = []);
24
+ (_l = pkg.keywords) !== null && _l !== void 0 ? _l : (pkg.keywords = []);
21
25
  pkg.keywords.push('create-by-tsdx');
22
26
  return pkg;
23
27
  }
24
28
  exports.updatePackageJson = updatePackageJson;
29
+ const _defaultCopyStaticFilesTsdx = [
30
+ ['tsconfig.json', 'file/tsconfig.tsdx.json.tpl', 'tsconfig.json'],
31
+ ['test/tsconfig.json', 'file/test/tsconfig.json.tpl', 'test/tsconfig.json'],
32
+ ];
33
+ exports.defaultCopyStaticFilesTsdx = Object.freeze(_defaultCopyStaticFilesTsdx);
25
34
  function setup(config) {
26
- let { pkg } = config;
35
+ let { pkg, file_map, } = config;
27
36
  pkg = updatePackageJson(pkg);
37
+ file_map = [
38
+ ...exports.defaultCopyStaticFilesTsdx,
39
+ ...file_map,
40
+ ];
28
41
  return {
42
+ ...config,
29
43
  pkg,
44
+ file_map,
30
45
  };
31
46
  }
32
47
  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,OAAO,GAAK,EAAE,EAAC;IAEnB,YAAA,GAAG,CAAC,OAAO,EAAC,UAAU,wCAAV,UAAU,IAAM,gBAAgB,EAAC;IAC7C,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,2CAA2C,CAAC;IACnE,YAAA,GAAG,CAAC,OAAO,EAAC,WAAW,wCAAX,WAAW,IAAM,4FAA4F,EAAC;IAC1H,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;IAE5C,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;AAvBD,8CAuBC;AAED,SAAgB,KAAK,CAAyB,MAG7C;IAEA,IAAI,EAAE,GAAG,EAAE,GAAG,MAAM,CAAC;IAErB,GAAG,GAAG,iBAAiB,CAAC,GAAG,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\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;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,YAAA,GAAG,CAAC,OAAO,EAAC,gBAAgB,wCAAhB,gBAAgB,IAAM,8DAA8D,EAAC;IACjG,YAAA,GAAG,CAAC,OAAO,EAAC,oBAAoB,wCAApB,o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AG,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.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.4",
3
+ "version": "1.0.8",
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": "5f3f55cb482d8903c42bc8e45e85542b24605b92"
59
+ "gitHead": "5124e69f5c4a82c77db0a188af52d5c246617c59"
60
60
  }