@yarn-tool/setup-module-env 2.0.6 → 2.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 CHANGED
@@ -3,6 +3,16 @@
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.7](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/setup-module-env@2.0.6...@yarn-tool/setup-module-env@2.0.7) (2022-09-12)
7
+
8
+
9
+
10
+ ### 🔖 Miscellaneous
11
+
12
+ * . ([823293e](https://github.com/bluelovers/ws-yarn-workspaces/commit/823293ed5eac74c0269b9fde70ab752809c94a62))
13
+
14
+
15
+
6
16
  ## [2.0.6](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/setup-module-env@2.0.5...@yarn-tool/setup-module-env@2.0.6) (2022-09-10)
7
17
 
8
18
 
@@ -4,44 +4,47 @@ exports.setup = exports.defaultCopyStaticFilesTsdx = exports.updatePackageJson =
4
4
  const scripts_1 = require("@yarn-tool/pkg-entry-util/lib/field/scripts");
5
5
  const dot_values2_1 = require("dot-values2");
6
6
  function updatePackageJson(pkg, config) {
7
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
8
- var _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
7
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
8
+ var _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5;
9
9
  (_a = pkg.scripts) !== null && _a !== void 0 ? _a : (pkg.scripts = {});
10
10
  if ((0, scripts_1.scriptsEntryIsNoTestSpecified)(pkg.scripts["test"])) {
11
11
  pkg.scripts["test"] = void 0;
12
12
  }
13
- (_b = (_u = pkg.scripts)["test"]) !== null && _b !== void 0 ? _b : (_u["test"] = "jest --passWithNoTests" /* EnumScriptsEntry.JEST_TEST */);
14
- (_c = (_v = pkg.scripts)["posttest"]) !== null && _c !== void 0 ? _c : (_v["posttest"] = "yarn run build");
13
+ (_b = (_v = pkg.scripts)["test"]) !== null && _b !== void 0 ? _b : (_v["test"] = "jest --passWithNoTests" /* EnumScriptsEntry.JEST_TEST */);
14
+ (_c = (_w = pkg.scripts)["posttest"]) !== null && _c !== void 0 ? _c : (_w["posttest"] = "yarn run build");
15
15
  if (!((_d = pkg.scripts["build"]) === null || _d === void 0 ? void 0 : _d.includes('run build:tsdx'))) {
16
16
  pkg.scripts["build"] = "yarn run build:tsdx && yarn run build:dts:bundle";
17
17
  }
18
- (_e = (_w = pkg.scripts)["build:dts:bundle"]) !== null && _e !== void 0 ? _e : (_w["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 */);
19
- (_f = (_x = pkg.scripts)["build:tsdx"]) !== null && _f !== void 0 ? _f : (_x["build:tsdx"] = "ynpx @bluelovers/tsdx build --target node");
20
- (_g = (_y = pkg.scripts)["build:dts:copy"]) !== null && _g !== void 0 ? _g : (_y["build:dts:copy"] = "copy .\\src\\index.d.ts .\\dist\\index.d.ts & echo build:dts");
21
- (_h = (_z = pkg.scripts)["build:dts:tsc:emit"]) !== null && _h !== void 0 ? _h : (_z["build:dts:tsc:emit"] = "tsc --emitDeclarationOnly --declaration --noEmit false");
22
- (_j = (_0 = pkg.scripts)["build:dts:tsc"]) !== null && _j !== void 0 ? _j : (_0["build:dts:tsc"] = "yarn run build:dts:tsc:emit && yarn run build:dts:copy");
18
+ (_e = (_x = pkg.scripts)["build:dts:bundle"]) !== null && _e !== void 0 ? _e : (_x["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 */);
19
+ (_f = (_y = pkg.scripts)["build:tsdx"]) !== null && _f !== void 0 ? _f : (_y["build:tsdx"] = "ynpx @bluelovers/tsdx build --target node");
20
+ (_g = (_z = pkg.scripts)["build:dts:copy"]) !== null && _g !== void 0 ? _g : (_z["build:dts:copy"] = "copy .\\src\\index.d.ts .\\dist\\index.d.ts & echo build:dts");
21
+ (_h = (_0 = pkg.scripts)["build:dts:tsc:emit"]) !== null && _h !== void 0 ? _h : (_0["build:dts:tsc:emit"] = "tsc --emitDeclarationOnly --declaration --noEmit false");
22
+ (_j = (_1 = pkg.scripts)["build:dts:tsc"]) !== null && _j !== void 0 ? _j : (_1["build:dts:tsc"] = "yarn run build:dts:tsc:emit && yarn run build:dts:copy");
23
23
  pkg.main = "dist/index.cjs";
24
24
  pkg.module = "dist/index.esm.mjs";
25
25
  pkg.types = pkg.typings = "dist/index.d.ts";
26
26
  (_k = pkg.unpkg) !== null && _k !== void 0 ? _k : (pkg.unpkg = "dist/index.umd.production.min.cjs");
27
27
  (_l = pkg.exports) !== null && _l !== void 0 ? _l : (pkg.exports = {});
28
- (_m = (_1 = pkg.exports)['.']) !== null && _m !== void 0 ? _m : (_1['.'] = {});
28
+ (_m = (_2 = pkg.exports)['.']) !== null && _m !== void 0 ? _m : (_2['.'] = {});
29
29
  pkg.exports['.'].types = "./dist/index.d.ts";
30
30
  pkg.exports['.'].import = "./dist/index.esm.mjs";
31
31
  pkg.exports['.'].require = "./dist/index.cjs";
32
32
  pkg.exports['./src/*'] = './src/*';
33
- (_o = (_2 = pkg.exports)['./package.json']) !== null && _o !== void 0 ? _o : (_2['./package.json'] = './package.json');
33
+ (_o = (_3 = pkg.exports)['./package.json']) !== null && _o !== void 0 ? _o : (_3['./package.json'] = './package.json');
34
34
  (_p = pkg.keywords) !== null && _p !== void 0 ? _p : (pkg.keywords = []);
35
35
  pkg.keywords.push('create-by-tsdx');
36
- if (((_r = (_q = pkg.dependencies) === null || _q === void 0 ? void 0 : _q['tslib']) === null || _r === void 0 ? void 0 : _r.length) > 0) {
37
- (_s = pkg.devDependencies) !== null && _s !== void 0 ? _s : (pkg.devDependencies = {});
38
- (_t = (_3 = pkg.devDependencies)['tslib']) !== null && _t !== void 0 ? _t : (_3['tslib'] = pkg.dependencies['tslib']);
39
- (0, dot_values2_1.deleteValue)(pkg, ['dependencies', 'tslib']);
40
- }
41
36
  if ((config === null || config === void 0 ? void 0 : config.rootData.hasWorkspace) && !config.rootData.isWorkspace) {
42
37
  (0, dot_values2_1.deleteValue)(pkg, ['dependencies', 'tslib']);
43
38
  (0, dot_values2_1.deleteValue)(pkg, ['devDependencies', 'tslib']);
44
39
  }
40
+ else {
41
+ (_q = pkg.devDependencies) !== null && _q !== void 0 ? _q : (pkg.devDependencies = {});
42
+ if (((_s = (_r = pkg.dependencies) === null || _r === void 0 ? void 0 : _r['tslib']) === null || _s === void 0 ? void 0 : _s.length) > 0) {
43
+ (_t = (_4 = pkg.devDependencies)['tslib']) !== null && _t !== void 0 ? _t : (_4['tslib'] = pkg.dependencies['tslib']);
44
+ (0, dot_values2_1.deleteValue)(pkg, ['dependencies', 'tslib']);
45
+ }
46
+ (_u = (_5 = pkg.devDependencies)['@bluelovers/tsconfig']) !== null && _u !== void 0 ? _u : (_5['@bluelovers/tsconfig'] = '*');
47
+ }
45
48
  return pkg;
46
49
  }
47
50
  exports.updatePackageJson = updatePackageJson;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAGA,yEAA8G;AAC9G,6CAA0C;AAE1C,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;IA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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,EAAE,MAAM,CAAC,CAAC;IAErC,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';\nimport { EnumScriptsEntry, scriptsEntryIsNoTestSpecified } from '@yarn-tool/pkg-entry-util/lib/field/scripts';\nimport { deleteValue } from 'dot-values2';\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\"] ??= \"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.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\tpkg.keywords.push('create-by-tsdx');\n\n\tif (pkg.dependencies?.['tslib']?.length > 0)\n\t{\n\t\tpkg.devDependencies ??= {};\n\t\tpkg.devDependencies['tslib'] ??= pkg.dependencies['tslib'];\n\t\tdeleteValue(pkg, ['dependencies', 'tslib']);\n\t}\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\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, config);\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"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAGA,yEAA8G;AAC9G,6CAA0C;AAE1C,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,OAAO,CAAC,GAAG,kDAAkD,CAAC;KAC1E;IAED,YAAA,GAAG,CAAC,OAAO,EAAC,kBAAkB,wCAAlB,kBAAkB,yKAAwC;IACtE,YAAA,GAAG,CAAC,OAAO,EAAC,YAAY,wCAAZ,YAAY,IAAM,2CAA2C,EAAC;IAE1E,YAAA,GAAG,CAAC,OAAO,EAAC,gBAAgB,wCAAhB,gBAAgB,IAAM,8DAA8D,EAAC;IACjG,YAAA,GAAG,CAAC,OAAO,EAAC,oBAAoB,wCAApB,oBAAoB,I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CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC,CAAC;KAC/C;SAED;QACC,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;YACC,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;SAC5C;QAED,YAAA,GAAG,CAAC,eAAe,EAAC,sBAAsB,wCAAtB,sBAAsB,IAAM,GAAG,EAAC;KACpD;IAED,OAAO,GAAG,CAAA;AACX,CAAC;AA7DD,8CA6DC;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,EAAE,MAAM,CAAC,CAAC;IAErC,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';\nimport { EnumScriptsEntry, scriptsEntryIsNoTestSpecified } from '@yarn-tool/pkg-entry-util/lib/field/scripts';\nimport { deleteValue } from 'dot-values2';\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\"] ??= \"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.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\tpkg.keywords.push('create-by-tsdx');\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\tpkg.devDependencies['@bluelovers/tsconfig'] ??= '*';\n\t}\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, config);\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": "2.0.6",
3
+ "version": "2.0.7",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "yarn",
@@ -61,5 +61,5 @@
61
61
  "publishConfig": {
62
62
  "access": "public"
63
63
  },
64
- "gitHead": "5d2376805123a3e87de1fc5fd4938e1c5d2e4bf0"
64
+ "gitHead": "f1ecaa59749bcb8c8ecd9f4ef17b3522bf9337c1"
65
65
  }