@embroider/compat 3.5.7-unstable.ce8f3cf → 3.5.7-unstable.dce753f
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/package.json +4 -5
- package/src/compat-app-builder.d.ts +2 -21
- package/src/compat-app-builder.js +17 -183
- package/src/compat-app-builder.js.map +1 -1
- package/src/compat-app.d.ts +0 -6
- package/src/compat-app.js +5 -63
- package/src/compat-app.js.map +1 -1
- package/src/http-audit.js +17 -2
- package/src/http-audit.js.map +1 -1
- package/src/options.d.ts +0 -2
- package/src/options.js.map +1 -1
- package/src/standalone-addon-build.js +4 -13
- package/src/standalone-addon-build.js.map +1 -1
- package/src/sync-dir.d.ts +0 -8
- package/src/sync-dir.js +0 -68
- package/src/sync-dir.js.map +0 -1
package/src/sync-dir.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.SyncDir = void 0;
|
|
7
|
-
const assert_never_1 = __importDefault(require("assert-never"));
|
|
8
|
-
const fs_tree_diff_1 = __importDefault(require("fs-tree-diff"));
|
|
9
|
-
const walk_sync_1 = __importDefault(require("walk-sync"));
|
|
10
|
-
const path_1 = require("path");
|
|
11
|
-
const fs_extra_1 = require("fs-extra");
|
|
12
|
-
// mirrors the changes in the src dir to the dest dir, while tracking the
|
|
13
|
-
// current set of files present. If dest is undefined, it only tracks the set of
|
|
14
|
-
// files without mirroring the changes to anywhere
|
|
15
|
-
class SyncDir {
|
|
16
|
-
constructor(src, dest) {
|
|
17
|
-
this.src = src;
|
|
18
|
-
this.dest = dest;
|
|
19
|
-
this.prev = new fs_tree_diff_1.default();
|
|
20
|
-
this.files = new Set();
|
|
21
|
-
}
|
|
22
|
-
update() {
|
|
23
|
-
let next = new fs_tree_diff_1.default({
|
|
24
|
-
entries: walk_sync_1.default.entries(this.src),
|
|
25
|
-
});
|
|
26
|
-
for (let [operation, relativePath] of this.prev.calculatePatch(next)) {
|
|
27
|
-
let outputPath;
|
|
28
|
-
if (this.dest) {
|
|
29
|
-
outputPath = (0, path_1.resolve)(this.dest, relativePath);
|
|
30
|
-
}
|
|
31
|
-
switch (operation) {
|
|
32
|
-
case 'unlink':
|
|
33
|
-
if (outputPath) {
|
|
34
|
-
(0, fs_extra_1.unlinkSync)(outputPath);
|
|
35
|
-
}
|
|
36
|
-
this.files.delete(relativePath);
|
|
37
|
-
break;
|
|
38
|
-
case 'rmdir':
|
|
39
|
-
if (outputPath) {
|
|
40
|
-
(0, fs_extra_1.rmdirSync)(outputPath);
|
|
41
|
-
}
|
|
42
|
-
break;
|
|
43
|
-
case 'mkdir':
|
|
44
|
-
if (outputPath) {
|
|
45
|
-
(0, fs_extra_1.mkdirpSync)(outputPath);
|
|
46
|
-
}
|
|
47
|
-
break;
|
|
48
|
-
case 'change':
|
|
49
|
-
if (outputPath) {
|
|
50
|
-
(0, fs_extra_1.removeSync)(outputPath);
|
|
51
|
-
(0, fs_extra_1.copySync)((0, path_1.resolve)(this.src, relativePath), outputPath, { dereference: true });
|
|
52
|
-
}
|
|
53
|
-
break;
|
|
54
|
-
case 'create':
|
|
55
|
-
if (outputPath) {
|
|
56
|
-
(0, fs_extra_1.copySync)((0, path_1.resolve)(this.src, relativePath), outputPath, { dereference: true });
|
|
57
|
-
}
|
|
58
|
-
this.files.add(relativePath);
|
|
59
|
-
break;
|
|
60
|
-
default:
|
|
61
|
-
(0, assert_never_1.default)(operation);
|
|
62
|
-
}
|
|
63
|
-
this.prev = next;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
exports.SyncDir = SyncDir;
|
|
68
|
-
//# sourceMappingURL=sync-dir.js.map
|
package/src/sync-dir.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
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U,CAAC,CAAC;oBACzB,CAAC;oBACD,MAAM;gBACR,KAAK,QAAQ;oBACX,IAAI,UAAU,EAAE,CAAC;wBACf,IAAA,qBAAU,EAAC,UAAU,CAAC,CAAC;wBACvB,IAAA,mBAAQ,EAAC,IAAA,cAAO,EAAC,IAAI,CAAC,GAAG,EAAE,YAAY,CAAC,EAAE,UAAU,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/E,CAAC;oBACD,MAAM;gBACR,KAAK,QAAQ;oBACX,IAAI,UAAU,EAAE,CAAC;wBACf,IAAA,mBAAQ,EAAC,IAAA,cAAO,EAAC,IAAI,CAAC,GAAG,EAAE,YAAY,CAAC,EAAE,UAAU,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/E,CAAC;oBACD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;oBAC7B,MAAM;gBACR;oBACE,IAAA,sBAAW,EAAC,SAAS,CAAC,CAAC;YAC3B,CAAC;YACD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACnB,CAAC;IACH,CAAC;CACF;AAlDD,0BAkDC","sourcesContent":["import assertNever from 'assert-never';\nimport FSTree from 'fs-tree-diff';\nimport walkSync from 'walk-sync';\nimport { resolve } from 'path';\nimport { copySync, mkdirpSync, removeSync, rmdirSync, unlinkSync } from 'fs-extra';\n\n// mirrors the changes in the src dir to the dest dir, while tracking the\n// current set of files present. If dest is undefined, it only tracks the set of\n// files without mirroring the changes to anywhere\nexport class SyncDir {\n private prev: FSTree = new FSTree();\n readonly files: Set<string> = new Set();\n\n constructor(private src: string, private dest: string | undefined) {}\n\n update(): void {\n let next = new FSTree({\n entries: walkSync.entries(this.src),\n });\n for (let [operation, relativePath] of this.prev.calculatePatch(next)) {\n let outputPath: string | undefined;\n if (this.dest) {\n outputPath = resolve(this.dest, relativePath);\n }\n switch (operation) {\n case 'unlink':\n if (outputPath) {\n unlinkSync(outputPath);\n }\n this.files.delete(relativePath);\n break;\n case 'rmdir':\n if (outputPath) {\n rmdirSync(outputPath);\n }\n break;\n case 'mkdir':\n if (outputPath) {\n mkdirpSync(outputPath);\n }\n break;\n case 'change':\n if (outputPath) {\n removeSync(outputPath);\n copySync(resolve(this.src, relativePath), outputPath, { dereference: true });\n }\n break;\n case 'create':\n if (outputPath) {\n copySync(resolve(this.src, relativePath), outputPath, { dereference: true });\n }\n this.files.add(relativePath);\n break;\n default:\n assertNever(operation);\n }\n this.prev = next;\n }\n }\n}\n"]}
|