@joycostudio/chopper 0.1.1 → 0.2.0
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/codecs/manifest.json +1 -1
- package/dist/browser/{chunk-MIIFUV4R.js → chunk-SKV4J3KF.js} +3 -3
- package/dist/browser/{chunk-MIIFUV4R.js.map → chunk-SKV4J3KF.js.map} +1 -1
- package/dist/browser/{in-process-W4MAY3WM.js → in-process-5733VKVB.js} +3 -3
- package/dist/browser/{in-process-W4MAY3WM.js.map → in-process-5733VKVB.js.map} +1 -1
- package/dist/browser/index.js +2 -2
- package/dist/browser/worker.js +1 -1
- package/dist/browser/worker.js.map +1 -1
- package/dist/cli/index.js +3 -9
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/node/index.d.ts +1 -2
- package/dist/node/index.js +3 -9
- package/dist/node/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -103,7 +103,7 @@ function outputMimeType(encoding) {
|
|
|
103
103
|
|
|
104
104
|
// package.json
|
|
105
105
|
var package_default = {
|
|
106
|
-
version: "0.
|
|
106
|
+
version: "0.2.0"};
|
|
107
107
|
|
|
108
108
|
// src/codecs/manifest.ts
|
|
109
109
|
var CODEC_MANIFEST_HASH = "2046d60deb0f9f224743f4404f3c6e8ba5399f81b2811fa50466e93fce3bd322";
|
|
@@ -1148,7 +1148,7 @@ async function runConfig(options = {}) {
|
|
|
1148
1148
|
const mode = options.mode ?? "write";
|
|
1149
1149
|
const loaded = options.config ? success(options.config) : await loadConfig(resolve(cwd, options.configPath ?? "chopper.config.ts"));
|
|
1150
1150
|
if (!loaded.ok) return loaded;
|
|
1151
|
-
const planned = await planAssets(loaded.data, cwd
|
|
1151
|
+
const planned = await planAssets(loaded.data, cwd);
|
|
1152
1152
|
if (!planned.ok) return planned;
|
|
1153
1153
|
const chopper2 = options.chopper ?? createNodeChopper();
|
|
1154
1154
|
const files = await mapConcurrent(
|
|
@@ -1158,8 +1158,7 @@ async function runConfig(options = {}) {
|
|
|
1158
1158
|
);
|
|
1159
1159
|
return success({ mode, files, totals: summarize(files) });
|
|
1160
1160
|
}
|
|
1161
|
-
async function planAssets(config, cwd
|
|
1162
|
-
const changed = changedPaths ? new Set(changedPaths.map((path) => normalizePath(path))) : void 0;
|
|
1161
|
+
async function planAssets(config, cwd) {
|
|
1163
1162
|
const planned = [];
|
|
1164
1163
|
for (const rule of config.rules) {
|
|
1165
1164
|
const valid = validateRecipe(rule.recipe);
|
|
@@ -1170,8 +1169,6 @@ async function planAssets(config, cwd, changedPaths) {
|
|
|
1170
1169
|
onlyFiles: true
|
|
1171
1170
|
});
|
|
1172
1171
|
for (const match of matches.sort()) {
|
|
1173
|
-
const normalized = normalizePath(match);
|
|
1174
|
-
if (changed && !changed.has(normalized)) continue;
|
|
1175
1172
|
planned.push({
|
|
1176
1173
|
input: resolve(cwd, match),
|
|
1177
1174
|
output: resolveOutput(rule, match, cwd),
|
|
@@ -1262,9 +1259,6 @@ function bytesEqual(left, right) {
|
|
|
1262
1259
|
if (left.byteLength !== right.byteLength) return false;
|
|
1263
1260
|
return left.every((value, index) => value === right[index]);
|
|
1264
1261
|
}
|
|
1265
|
-
function normalizePath(path) {
|
|
1266
|
-
return path.replaceAll("\\", "/");
|
|
1267
|
-
}
|
|
1268
1262
|
async function mapConcurrent(values, concurrency, operation) {
|
|
1269
1263
|
const results = new Array(values.length);
|
|
1270
1264
|
let next = 0;
|