@yarn-tool/static-file 2.0.3 → 2.0.6

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
+ ## [2.0.6](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/static-file@2.0.5...@yarn-tool/static-file@2.0.6) (2022-08-26)
7
+
8
+
9
+
10
+ ### 🔖 Miscellaneous
11
+
12
+ * . ([b3cfb9b](https://github.com/bluelovers/ws-yarn-workspaces/commit/b3cfb9bd8105fed14522ee3d3898141ba831471a))
13
+ * . ([157d5dc](https://github.com/bluelovers/ws-yarn-workspaces/commit/157d5dc8959261d9326f6e633987182898ae9670))
14
+ * . ([dafc19c](https://github.com/bluelovers/ws-yarn-workspaces/commit/dafc19c43afb42c904b6e7dcc49d93567897c092))
15
+
16
+
17
+
18
+ ## [2.0.5](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/static-file@2.0.4...@yarn-tool/static-file@2.0.5) (2022-08-25)
19
+
20
+
21
+
22
+ ### 🔖 Miscellaneous
23
+
24
+ * . ([e41ae72](https://github.com/bluelovers/ws-yarn-workspaces/commit/e41ae7243ba638952956984fbd582ded499a7f0b))
25
+ * . ([8e0574e](https://github.com/bluelovers/ws-yarn-workspaces/commit/8e0574e7e94ebb50a2335d6e0a74114e633812dc))
26
+
27
+
28
+
29
+ ## [2.0.4](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/static-file@2.0.3...@yarn-tool/static-file@2.0.4) (2022-08-19)
30
+
31
+
32
+ ### ✨ Features
33
+
34
+ * getRootCopyStaticFilesAuto ([2b857c0](https://github.com/bluelovers/ws-yarn-workspaces/commit/2b857c07566a6cdcb7018d9f1b9efbe4f0a5202b))
35
+
36
+
37
+ ### 📦 Code Refactoring
38
+
39
+ * move `getWsCopyStaticFiles` ([f3f6349](https://github.com/bluelovers/ws-yarn-workspaces/commit/f3f634995b504794d189cbba564da2d46488fb18))
40
+
41
+
42
+ ### 🔖 Miscellaneous
43
+
44
+ * . ([b76c5a8](https://github.com/bluelovers/ws-yarn-workspaces/commit/b76c5a8902781abb3bee14492e652b89307ffacd))
45
+
46
+
47
+
48
+
49
+
6
50
  ## [2.0.3](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/static-file@2.0.2...@yarn-tool/static-file@2.0.3) (2022-08-13)
7
51
 
8
52
 
package/README.md ADDED
@@ -0,0 +1,12 @@
1
+ # README.md
2
+
3
+ <%= description %>
4
+
5
+ ## install
6
+
7
+ ```bash
8
+ yarn add <%= name %>
9
+ yarn-tool add <%= name %>
10
+ yt add <%= name %>
11
+ ```
12
+
package/__root.d.ts CHANGED
@@ -1,2 +1 @@
1
- declare const __root: string;
2
- export default __root;
1
+ export declare const __STATIC_ROOT: string;
package/__root.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const __root = __dirname;
4
- exports.default = __root;
3
+ exports.__STATIC_ROOT = void 0;
4
+ exports.__STATIC_ROOT = __dirname;
5
5
  //# sourceMappingURL=__root.js.map
package/__root.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"__root.js","sourceRoot":"","sources":["__root.ts"],"names":[],"mappings":";;AACA,MAAM,MAAM,GAAG,SAAS,CAAC;AACzB,kBAAe,MAAM,CAAA","sourcesContent":["\nconst __root = __dirname;\nexport default __root\n"]}
1
+ {"version":3,"file":"__root.js","sourceRoot":"","sources":["__root.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG,SAAS,CAAC","sourcesContent":["export const __STATIC_ROOT = __dirname;\n"]}
package/file/npmignore CHANGED
@@ -35,10 +35,10 @@ node_modules
35
35
  /bin/**/*.d.cts
36
36
  /bin/*.d.cts
37
37
 
38
- !./src/**/*.ts
39
- !./src/**/*.cts
40
- !./src/**/*.mts
41
- !./src/**/*.tsx
38
+ !/src/**/*.ts
39
+ !/src/**/*.cts
40
+ !/src/**/*.mts
41
+ !/src/**/*.tsx
42
42
 
43
43
  /src/**/*.d.ts
44
44
  /src/**/*.js
@@ -0,0 +1,12 @@
1
+ // DO NOT EDIT THIS FILE
2
+ const { resolve } = require('path');
3
+
4
+ /**
5
+ * // @type { import('@jest/types').Config.InitialOptions }
6
+ * @type { import('ts-jest').InitialOptionsTsJest }
7
+ */
8
+ const jestConfig = {
9
+ preset: __dirname,
10
+ };
11
+
12
+ module.exports = jestConfig
@@ -1,12 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.copyStaticFiles = void 0;
4
- const tslib_1 = require("tslib");
5
4
  const fs_extra_1 = require("fs-extra");
6
5
  const const_1 = require("./const");
7
6
  const parseStaticMap_1 = require("./parseStaticMap");
8
7
  const copyStaticFilesEntry_1 = require("./copyStaticFilesEntry");
9
- const __root_1 = tslib_1.__importDefault(require("../__root"));
8
+ const __root_1 = require("../__root");
10
9
  function copyStaticFiles(options) {
11
10
  var _a, _b;
12
11
  if (typeof options.cwd !== 'string' || !((_a = options.cwd) === null || _a === void 0 ? void 0 : _a.length) || !options.cwd) {
@@ -19,7 +18,7 @@ function copyStaticFiles(options) {
19
18
  if (!ls.length) {
20
19
  throw new TypeError(`Invalid file map: ${options.file_map}`);
21
20
  }
22
- const staticRoot = options.staticRoot || __root_1.default;
21
+ const staticRoot = options.staticRoot || __root_1.__STATIC_ROOT;
23
22
  const { cwd, overwrite } = options;
24
23
  return ls.filter((entry) => {
25
24
  return (0, copyStaticFilesEntry_1.copyStaticFilesEntry)(entry, cwd, staticRoot, overwrite);
@@ -1 +1 @@
1
- {"version":3,"file":"copyStaticFiles.js","sourceRoot":"","sources":["copyStaticFiles.ts"],"names":[],"mappings":";;;;AACA,uCAAgG;AAEhG,mCAAiD;AACjD,qDAAkD;AAClD,iEAA8D;AAC9D,+DAA+B;AAE/B,SAAgB,eAAe,CAAmB,OAAmC;;IAEpF,IAAI,OAAO,OAAO,CAAC,GAAG,KAAK,QAAQ,IAAI,CAAC,CAAA,MAAA,OAAO,CAAC,GAAG,0CAAE,MAAM,CAAA,IAAI,CAAC,OAAO,CAAC,GAAG,EAC3E;QACC,MAAM,IAAI,SAAS,CAAC,4BAA4B,CAAC,CAAA;KACjD;IAED,IAAI,CAAC,IAAA,yBAAc,EAAC,OAAO,CAAC,GAAG,CAAC,EAChC;QACC,MAAM,IAAI,SAAS,CAAC,wBAAwB,CAAC,CAAA;KAC7C;IAED,IAAI,EAAE,GAAG,IAAA,+BAAc,EAAI,MAAA,OAAO,CAAC,QAAQ,mCAAI,8BAAiD,CAAC,CAAC;IAElG,IAAI,CAAC,EAAE,CAAC,MAAM,EACd;QACC,MAAM,IAAI,SAAS,CAAC,qBAAqB,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAA;KAC5D;IAED,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,gBAAM,CAAC;IAChD,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAEnC,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;QAEzB,OAAO,IAAA,2CAAoB,EAAC,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,CAAC,CAAA;IAC/D,CAAC,CAAC,CACD;AACH,CAAC;AA3BD,0CA2BC","sourcesContent":["import { ICopyStaticFilesOptions, IStaticFilesMapArray, IStaticFilesMapArrayEntry } from './types';\nimport { CopyOptionsSync, copySync, ensureDirSync, existsSync, pathExistsSync } from 'fs-extra';\nimport { dirname, resolve } from 'path';\nimport { defaultCopyStaticFiles } from './const';\nimport { parseStaticMap } from './parseStaticMap';\nimport { copyStaticFilesEntry } from './copyStaticFilesEntry';\nimport __root from '../__root';\n\nexport function copyStaticFiles<K extends string>(options: ICopyStaticFilesOptions<K>)\n{\n\tif (typeof options.cwd !== 'string' || !options.cwd?.length || !options.cwd)\n\t{\n\t\tthrow new TypeError(`options.cwd must is string`)\n\t}\n\n\tif (!pathExistsSync(options.cwd))\n\t{\n\t\tthrow new TypeError(`options.cwd not exists`)\n\t}\n\n\tlet ls = parseStaticMap<K>(options.file_map ?? defaultCopyStaticFiles as IStaticFilesMapArray<K>);\n\n\tif (!ls.length)\n\t{\n\t\tthrow new TypeError(`Invalid file map: ${options.file_map}`)\n\t}\n\n\tconst staticRoot = options.staticRoot || __root;\n\tconst { cwd, overwrite } = options;\n\n\treturn ls.filter((entry) =>\n\t\t{\n\t\t\treturn copyStaticFilesEntry(entry, cwd, staticRoot, overwrite)\n\t\t})\n\t\t;\n}\n\n"]}
1
+ {"version":3,"file":"copyStaticFiles.js","sourceRoot":"","sources":["copyStaticFiles.ts"],"names":[],"mappings":";;;AACA,uCAAgG;AAEhG,mCAAiD;AACjD,qDAAkD;AAClD,iEAA8D;AAC9D,sCAA0C;AAE1C,SAAgB,eAAe,CAAmB,OAAmC;;IAEpF,IAAI,OAAO,OAAO,CAAC,GAAG,KAAK,QAAQ,IAAI,CAAC,CAAA,MAAA,OAAO,CAAC,GAAG,0CAAE,MAAM,CAAA,IAAI,CAAC,OAAO,CAAC,GAAG,EAC3E;QACC,MAAM,IAAI,SAAS,CAAC,4BAA4B,CAAC,CAAA;KACjD;IAED,IAAI,CAAC,IAAA,yBAAc,EAAC,OAAO,CAAC,GAAG,CAAC,EAChC;QACC,MAAM,IAAI,SAAS,CAAC,wBAAwB,CAAC,CAAA;KAC7C;IAED,IAAI,EAAE,GAAG,IAAA,+BAAc,EAAI,MAAA,OAAO,CAAC,QAAQ,mCAAI,8BAAiD,CAAC,CAAC;IAElG,IAAI,CAAC,EAAE,CAAC,MAAM,EACd;QACC,MAAM,IAAI,SAAS,CAAC,qBAAqB,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAA;KAC5D;IAED,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,sBAAa,CAAC;IACvD,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAEnC,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;QAEzB,OAAO,IAAA,2CAAoB,EAAC,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,CAAC,CAAA;IAC/D,CAAC,CAAC,CACD;AACH,CAAC;AA3BD,0CA2BC","sourcesContent":["import { ICopyStaticFilesOptions, IStaticFilesMapArray, IStaticFilesMapArrayEntry } from './types';\nimport { CopyOptionsSync, copySync, ensureDirSync, existsSync, pathExistsSync } from 'fs-extra';\nimport { dirname, resolve } from 'path';\nimport { defaultCopyStaticFiles } from './const';\nimport { parseStaticMap } from './parseStaticMap';\nimport { copyStaticFilesEntry } from './copyStaticFilesEntry';\nimport { __STATIC_ROOT } from '../__root';\n\nexport function copyStaticFiles<K extends string>(options: ICopyStaticFilesOptions<K>)\n{\n\tif (typeof options.cwd !== 'string' || !options.cwd?.length || !options.cwd)\n\t{\n\t\tthrow new TypeError(`options.cwd must is string`)\n\t}\n\n\tif (!pathExistsSync(options.cwd))\n\t{\n\t\tthrow new TypeError(`options.cwd not exists`)\n\t}\n\n\tlet ls = parseStaticMap<K>(options.file_map ?? defaultCopyStaticFiles as IStaticFilesMapArray<K>);\n\n\tif (!ls.length)\n\t{\n\t\tthrow new TypeError(`Invalid file map: ${options.file_map}`)\n\t}\n\n\tconst staticRoot = options.staticRoot || __STATIC_ROOT;\n\tconst { cwd, overwrite } = options;\n\n\treturn ls.filter((entry) =>\n\t\t{\n\t\t\treturn copyStaticFilesEntry(entry, cwd, staticRoot, overwrite)\n\t\t})\n\t\t;\n}\n"]}
@@ -1,11 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.copyStaticFilesEntry = void 0;
4
- const tslib_1 = require("tslib");
5
4
  const path_1 = require("path");
6
5
  const fs_extra_1 = require("fs-extra");
7
- const __root_1 = tslib_1.__importDefault(require("../__root"));
8
- function copyStaticFilesEntry(entry, cwd, staticRoot = __root_1.default, overwrite) {
6
+ const __root_1 = require("../__root");
7
+ function copyStaticFilesEntry(entry, cwd, staticRoot = __root_1.__STATIC_ROOT, overwrite) {
9
8
  const [targetFile, staticFile, detectFile] = entry;
10
9
  if (detectFile === null || detectFile === void 0 ? void 0 : detectFile.length) {
11
10
  const fc = (0, path_1.resolve)(cwd, detectFile);
@@ -1 +1 @@
1
- {"version":3,"file":"copyStaticFilesEntry.js","sourceRoot":"","sources":["copyStaticFilesEntry.ts"],"names":[],"mappings":";;;;AACA,+BAAwC;AACxC,uCAA+D;AAC/D,+DAA+B;AAE/B,SAAgB,oBAAoB,CAAC,KAAwC,EAC5E,GAAW,EACX,aAAqB,gBAAM,EAC3B,SAAmB;IAGnB,MAAM,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC;IAEnD,IAAI,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,MAAM,EACtB;QACC,MAAM,EAAE,GAAG,IAAA,cAAO,EAAC,GAAG,EAAE,UAAU,CAAC,CAAC;QAEpC,IAAI,IAAA,qBAAU,EAAC,EAAE,CAAC,EAClB;YACC,OAAO;SACP;KACD;IAED,MAAM,EAAE,GAAG,IAAA,cAAO,EAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IAE3C,IAAI,CAAC,IAAA,qBAAU,EAAC,EAAE,CAAC,EACnB;QACC,MAAM,IAAI,KAAK,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAA;KACzC;IAED,MAAM,EAAE,GAAG,IAAA,cAAO,EAAC,GAAG,EAAE,UAAU,CAAC,CAAC;IAEpC,IAAA,wBAAa,EAAC,IAAA,cAAO,EAAC,EAAE,CAAC,CAAC,CAAA;IAC1B,IAAA,mBAAQ,EAAC,EAAE,EAAE,EAAE,EAAE;QAChB,SAAS,EAAE,SAAS,IAAI,KAAK;QAC7B,kBAAkB,EAAE,IAAI;QACxB,YAAY,EAAE,KAAK;KACnB,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AACb,CAAC;AAnCD,oDAmCC","sourcesContent":["import { IStaticFilesMapArrayEntry } from './types';\nimport { dirname, resolve } from 'path';\nimport { copySync, ensureDirSync, existsSync } from 'fs-extra';\nimport __root from '../__root';\n\nexport function copyStaticFilesEntry(entry: IStaticFilesMapArrayEntry<string>,\n\tcwd: string,\n\tstaticRoot: string = __root,\n\toverwrite?: boolean,\n)\n{\n\tconst [targetFile, staticFile, detectFile] = entry;\n\n\tif (detectFile?.length)\n\t{\n\t\tconst fc = resolve(cwd, detectFile);\n\n\t\tif (existsSync(fc))\n\t\t{\n\t\t\treturn;\n\t\t}\n\t}\n\n\tconst fb = resolve(staticRoot, staticFile);\n\n\tif (!existsSync(fb))\n\t{\n\t\tthrow new Error(`file not exists. ${fb}`)\n\t}\n\n\tconst fa = resolve(cwd, targetFile);\n\n\tensureDirSync(dirname(fa))\n\tcopySync(fb, fa, {\n\t\toverwrite: overwrite || false,\n\t\tpreserveTimestamps: true,\n\t\terrorOnExist: false,\n\t});\n\n\treturn true;\n}\n"]}
1
+ {"version":3,"file":"copyStaticFilesEntry.js","sourceRoot":"","sources":["copyStaticFilesEntry.ts"],"names":[],"mappings":";;;AACA,+BAAwC;AACxC,uCAA+D;AAC/D,sCAA0C;AAE1C,SAAgB,oBAAoB,CAAC,KAAwC,EAC5E,GAAW,EACX,aAAqB,sBAAa,EAClC,SAAmB;IAGnB,MAAM,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC;IAEnD,IAAI,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,MAAM,EACtB;QACC,MAAM,EAAE,GAAG,IAAA,cAAO,EAAC,GAAG,EAAE,UAAU,CAAC,CAAC;QAEpC,IAAI,IAAA,qBAAU,EAAC,EAAE,CAAC,EAClB;YACC,OAAO;SACP;KACD;IAED,MAAM,EAAE,GAAG,IAAA,cAAO,EAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IAE3C,IAAI,CAAC,IAAA,qBAAU,EAAC,EAAE,CAAC,EACnB;QACC,MAAM,IAAI,KAAK,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAA;KACzC;IAED,MAAM,EAAE,GAAG,IAAA,cAAO,EAAC,GAAG,EAAE,UAAU,CAAC,CAAC;IAEpC,IAAA,wBAAa,EAAC,IAAA,cAAO,EAAC,EAAE,CAAC,CAAC,CAAA;IAC1B,IAAA,mBAAQ,EAAC,EAAE,EAAE,EAAE,EAAE;QAChB,SAAS,EAAE,SAAS,IAAI,KAAK;QAC7B,kBAAkB,EAAE,IAAI;QACxB,YAAY,EAAE,KAAK;KACnB,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AACb,CAAC;AAnCD,oDAmCC","sourcesContent":["import { IStaticFilesMapArrayEntry } from './types';\nimport { dirname, resolve } from 'path';\nimport { copySync, ensureDirSync, existsSync } from 'fs-extra';\nimport { __STATIC_ROOT } from '../__root';\n\nexport function copyStaticFilesEntry(entry: IStaticFilesMapArrayEntry<string>,\n\tcwd: string,\n\tstaticRoot: string = __STATIC_ROOT,\n\toverwrite?: boolean,\n)\n{\n\tconst [targetFile, staticFile, detectFile] = entry;\n\n\tif (detectFile?.length)\n\t{\n\t\tconst fc = resolve(cwd, detectFile);\n\n\t\tif (existsSync(fc))\n\t\t{\n\t\t\treturn;\n\t\t}\n\t}\n\n\tconst fb = resolve(staticRoot, staticFile);\n\n\tif (!existsSync(fb))\n\t{\n\t\tthrow new Error(`file not exists. ${fb}`)\n\t}\n\n\tconst fa = resolve(cwd, targetFile);\n\n\tensureDirSync(dirname(fa))\n\tcopySync(fb, fa, {\n\t\toverwrite: overwrite || false,\n\t\tpreserveTimestamps: true,\n\t\terrorOnExist: false,\n\t});\n\n\treturn true;\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import { IFindRootReturnType } from '@yarn-tool/find-root';
2
+ import { IStaticFilesMapArray } from '../types';
3
+ export declare function getRootCopyStaticFilesAuto(rootData: Pick<IFindRootReturnType, 'isRoot' | 'hasWorkspace'>): IStaticFilesMapArray<string>;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRootCopyStaticFilesAuto = void 0;
4
+ const const_1 = require("../const");
5
+ function getRootCopyStaticFilesAuto(rootData) {
6
+ let file_map = [
7
+ ...const_1.defaultCopyStaticFiles,
8
+ ];
9
+ if (rootData.isRoot) {
10
+ if (!rootData.hasWorkspace) {
11
+ file_map = [
12
+ ...const_1.defaultCopyStaticFilesRootOnly,
13
+ ...file_map,
14
+ ];
15
+ }
16
+ }
17
+ return file_map;
18
+ }
19
+ exports.getRootCopyStaticFilesAuto = getRootCopyStaticFilesAuto;
20
+ //# sourceMappingURL=getRootCopyStaticFiles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getRootCopyStaticFiles.js","sourceRoot":"","sources":["getRootCopyStaticFiles.ts"],"names":[],"mappings":";;;AAEA,oCAAkF;AAElF,SAAgB,0BAA0B,CAAC,QAA6D;IAEvG,IAAI,QAAQ,GAAiC;QAC5C,GAAG,8BAAsB;KACzB,CAAC;IAEF,IAAI,QAAQ,CAAC,MAAM,EACnB;QACC,IAAI,CAAC,QAAQ,CAAC,YAAY,EAC1B;YACC,QAAQ,GAAG;gBACV,GAAG,sCAA8B;gBACjC,GAAG,QAAQ;aACX,CAAC;SACF;KACD;IAED,OAAO,QAAQ,CAAA;AAChB,CAAC;AAlBD,gEAkBC","sourcesContent":["import { IFindRootReturnType } from '@yarn-tool/find-root';\nimport { IStaticFilesMapArray } from '../types';\nimport { defaultCopyStaticFiles, defaultCopyStaticFilesRootOnly } from '../const';\n\nexport function getRootCopyStaticFilesAuto(rootData: Pick<IFindRootReturnType, 'isRoot'| 'hasWorkspace'>)\n{\n\tlet file_map: IStaticFilesMapArray<string> = [\n\t\t...defaultCopyStaticFiles,\n\t];\n\n\tif (rootData.isRoot)\n\t{\n\t\tif (!rootData.hasWorkspace)\n\t\t{\n\t\t\tfile_map = [\n\t\t\t\t...defaultCopyStaticFilesRootOnly,\n\t\t\t\t...file_map,\n\t\t\t];\n\t\t}\n\t}\n\n\treturn file_map\n}\n"]}
@@ -0,0 +1,9 @@
1
+ import { defaultCopyStaticFiles, defaultCopyStaticFilesRootOnly } from '../const';
2
+ import { IStaticFiles, IStaticFilesKey } from '../types';
3
+ declare const remap: {
4
+ readonly 'tsconfig.json': "tsconfig.json.tpl";
5
+ readonly 'lerna.json': "lerna.json.tpl";
6
+ readonly 'pnpm-workspace.yaml': "pnpm-workspace.yaml.tpl";
7
+ };
8
+ export declare function getWsCopyStaticFiles(): IStaticFiles<IStaticFilesKey<typeof defaultCopyStaticFiles | typeof defaultCopyStaticFilesRootOnly> | keyof typeof remap>;
9
+ export default getWsCopyStaticFiles;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getWsCopyStaticFiles = void 0;
4
+ const const_1 = require("../const");
5
+ const reMapStaticFilesMapArray_1 = require("../reMapStaticFilesMapArray");
6
+ const remap = {
7
+ 'tsconfig.json': 'tsconfig.json.tpl',
8
+ 'lerna.json': 'lerna.json.tpl',
9
+ 'pnpm-workspace.yaml': 'pnpm-workspace.yaml.tpl',
10
+ };
11
+ function getWsCopyStaticFiles() {
12
+ return (0, reMapStaticFilesMapArray_1.reMapStaticFilesMapArray)([
13
+ ...const_1.defaultCopyStaticFiles,
14
+ ...const_1.defaultCopyStaticFilesRootOnly,
15
+ ...const_1.defaultCopyStaticFilesWsRootOnly,
16
+ ], remap);
17
+ }
18
+ exports.getWsCopyStaticFiles = getWsCopyStaticFiles;
19
+ exports.default = getWsCopyStaticFiles;
20
+ //# sourceMappingURL=wsCopyStaticFiles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wsCopyStaticFiles.js","sourceRoot":"","sources":["wsCopyStaticFiles.ts"],"names":[],"mappings":";;;AAAA,oCAIkB;AAElB,0EAAuE;AAEvE,MAAM,KAAK,GAAG;IACb,eAAe,EAAE,mBAAmB;IACpC,YAAY,EAAE,gBAAgB;IAC9B,qBAAqB,EAAE,yBAAyB;CACvC,CAAA;AAEV,SAAgB,oBAAoB;IAEnC,OAAO,IAAA,mDAAwB,EAAC;QAC/B,GAAG,8BAAsB;QACzB,GAAG,sCAA8B;QACjC,GAAG,wCAAgC;KACnC,EAAE,KAAK,CAAC,CAAC;AACX,CAAC;AAPD,oDAOC;AAED,kBAAe,oBAAoB,CAAC","sourcesContent":["import {\n\tdefaultCopyStaticFiles,\n\tdefaultCopyStaticFilesRootOnly,\n\tdefaultCopyStaticFilesWsRootOnly,\n} from '../const';\nimport { IStaticFiles, IStaticFilesKey, IStaticFilesMapArray } from '../types';\nimport { reMapStaticFilesMapArray } from '../reMapStaticFilesMapArray';\n\nconst remap = {\n\t'tsconfig.json': 'tsconfig.json.tpl',\n\t'lerna.json': 'lerna.json.tpl',\n\t'pnpm-workspace.yaml': 'pnpm-workspace.yaml.tpl',\n} as const\n\nexport function getWsCopyStaticFiles(): IStaticFiles<IStaticFilesKey<typeof defaultCopyStaticFiles | typeof defaultCopyStaticFilesRootOnly> | keyof typeof remap>\n{\n\treturn reMapStaticFilesMapArray([\n\t\t...defaultCopyStaticFiles,\n\t\t...defaultCopyStaticFilesRootOnly,\n\t\t...defaultCopyStaticFilesWsRootOnly,\n\t], remap);\n}\n\nexport default getWsCopyStaticFiles;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yarn-tool/static-file",
3
- "version": "2.0.3",
3
+ "version": "2.0.6",
4
4
  "description": "",
5
5
  "homepage": "https://github.com/bluelovers/ws-yarn-workspaces/tree/master/packages/@yarn-tool/static-file#readme",
6
6
  "bugs": {
@@ -17,6 +17,9 @@
17
17
  "coverage": "npx nyc npm run test",
18
18
  "lint": "npx eslint **/*.ts",
19
19
  "test": "echo \"Error: no test specified\"",
20
+ "test:jest": "jest --passWithNoTests",
21
+ "test:jest:snapshot": "yarn run test:jest -- -u",
22
+ "test:snapshot": "yarn run test -- -u",
20
23
  "npm:publish": "npm publish",
21
24
  "preversion": "yarn run test",
22
25
  "prepublishOnly": "echo prepublishOnly",
@@ -31,5 +34,5 @@
31
34
  "publishConfig": {
32
35
  "access": "public"
33
36
  },
34
- "gitHead": "e34c95f09bf1ad26e3a721028a28f6b8bfb44510"
37
+ "gitHead": "150365d3846067505842c6503564abe98ebe508d"
35
38
  }