@yarn-tool/static-file 2.0.5 → 2.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 +42 -0
- package/__root.d.ts +1 -2
- package/__root.js +2 -2
- package/__root.js.map +1 -1
- package/file/gitignore +2 -1
- package/file/npmignore +2 -0
- package/lib/copyStaticFiles.js +2 -3
- package/lib/copyStaticFiles.js.map +1 -1
- package/lib/copyStaticFilesEntry.js +2 -3
- package/lib/copyStaticFilesEntry.js.map +1 -1
- package/package.json +8 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,48 @@
|
|
|
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.8](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/static-file@2.0.7...@yarn-tool/static-file@2.0.8) (2022-09-06)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### 📚 Documentation
|
|
11
|
+
|
|
12
|
+
* add directory ([442a552](https://github.com/bluelovers/ws-yarn-workspaces/commit/442a55232619f7fe2b9bad6f8eccfffc4f8f47d2))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### 📌 Dependencies
|
|
16
|
+
|
|
17
|
+
* update deps ([aeb5e41](https://github.com/bluelovers/ws-yarn-workspaces/commit/aeb5e416e8ea6c7d37ed7d38fedd6ff5c8c371df))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### 🔖 Miscellaneous
|
|
21
|
+
|
|
22
|
+
* . ([3a7fdc9](https://github.com/bluelovers/ws-yarn-workspaces/commit/3a7fdc924ada93b1d0ac0160f8d77e46ff060588))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## [2.0.7](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/static-file@2.0.6...@yarn-tool/static-file@2.0.7) (2022-08-28)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### 📌 Dependencies
|
|
31
|
+
|
|
32
|
+
* update deps ([9c67e20](https://github.com/bluelovers/ws-yarn-workspaces/commit/9c67e20ac4960ee2c98d89c448a2ea5a7495a3bf))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
## [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)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
### 🔖 Miscellaneous
|
|
41
|
+
|
|
42
|
+
* . ([b3cfb9b](https://github.com/bluelovers/ws-yarn-workspaces/commit/b3cfb9bd8105fed14522ee3d3898141ba831471a))
|
|
43
|
+
* . ([157d5dc](https://github.com/bluelovers/ws-yarn-workspaces/commit/157d5dc8959261d9326f6e633987182898ae9670))
|
|
44
|
+
* . ([dafc19c](https://github.com/bluelovers/ws-yarn-workspaces/commit/dafc19c43afb42c904b6e7dcc49d93567897c092))
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
6
48
|
## [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)
|
|
7
49
|
|
|
8
50
|
|
package/__root.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
declare const
|
|
2
|
-
export default __root;
|
|
1
|
+
export declare const __STATIC_ROOT: string;
|
package/__root.js
CHANGED
package/__root.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"__root.js","sourceRoot":"","sources":["__root.ts"],"names":[],"mappings":"
|
|
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/gitignore
CHANGED
package/file/npmignore
CHANGED
package/lib/copyStaticFiles.js
CHANGED
|
@@ -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 =
|
|
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.
|
|
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":"
|
|
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 =
|
|
8
|
-
function copyStaticFilesEntry(entry, cwd, staticRoot = __root_1.
|
|
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":"
|
|
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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yarn-tool/static-file",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.8",
|
|
4
4
|
"description": "",
|
|
5
5
|
"homepage": "https://github.com/bluelovers/ws-yarn-workspaces/tree/master/packages/@yarn-tool/static-file#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
},
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/bluelovers/ws-yarn-workspaces.git"
|
|
11
|
+
"url": "git+https://github.com/bluelovers/ws-yarn-workspaces.git",
|
|
12
|
+
"directory": "packages/@yarn-tool/static-file"
|
|
12
13
|
},
|
|
13
14
|
"license": "ISC",
|
|
14
15
|
"author": "",
|
|
@@ -17,6 +18,9 @@
|
|
|
17
18
|
"coverage": "npx nyc npm run test",
|
|
18
19
|
"lint": "npx eslint **/*.ts",
|
|
19
20
|
"test": "echo \"Error: no test specified\"",
|
|
21
|
+
"test:jest": "jest --passWithNoTests",
|
|
22
|
+
"test:jest:snapshot": "yarn run test:jest -- -u",
|
|
23
|
+
"test:snapshot": "yarn run test -- -u",
|
|
20
24
|
"npm:publish": "npm publish",
|
|
21
25
|
"preversion": "yarn run test",
|
|
22
26
|
"prepublishOnly": "echo prepublishOnly",
|
|
@@ -26,10 +30,10 @@
|
|
|
26
30
|
},
|
|
27
31
|
"dependencies": {
|
|
28
32
|
"fs-extra": "^10.1.0",
|
|
29
|
-
"tslib": "
|
|
33
|
+
"tslib": ">=2"
|
|
30
34
|
},
|
|
31
35
|
"publishConfig": {
|
|
32
36
|
"access": "public"
|
|
33
37
|
},
|
|
34
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "fccc2913440df31b04f2971e479fbe1d4c3a7a0c"
|
|
35
39
|
}
|