@sunasteriskrnd/takumi 0.12.0 → 0.12.1
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/dist/index.js +24 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -19815,7 +19815,7 @@ var package_default;
|
|
|
19815
19815
|
var init_package = __esm(() => {
|
|
19816
19816
|
package_default = {
|
|
19817
19817
|
name: "@sunasteriskrnd/takumi",
|
|
19818
|
-
version: "0.12.
|
|
19818
|
+
version: "0.12.1",
|
|
19819
19819
|
description: "CLI tool for bootstrapping and managing Takumi projects",
|
|
19820
19820
|
type: "module",
|
|
19821
19821
|
repository: {
|
|
@@ -54150,6 +54150,7 @@ import { join as join72, relative as relative14 } from "node:path";
|
|
|
54150
54150
|
var MAX_FILE_BYTES = 20 * 1024 * 1024;
|
|
54151
54151
|
var IGNORE_FILES = [".gitignore", ".tkmignore"];
|
|
54152
54152
|
var HARD_IGNORES = [".git", ".gitignore", ".tkmignore"];
|
|
54153
|
+
var HARD_IGNORE_NAMES = new Set(HARD_IGNORES);
|
|
54153
54154
|
|
|
54154
54155
|
class FolderLimitError extends Error {
|
|
54155
54156
|
constructor(message) {
|
|
@@ -54167,10 +54168,13 @@ async function buildIgnoreMatcher(rootDir) {
|
|
|
54167
54168
|
ig.add(HARD_IGNORES);
|
|
54168
54169
|
return ig;
|
|
54169
54170
|
}
|
|
54170
|
-
async function walkFolder(rootDir) {
|
|
54171
|
+
async function walkFolder(rootDir, skipped) {
|
|
54171
54172
|
const ig = await buildIgnoreMatcher(rootDir);
|
|
54172
54173
|
const entries = [];
|
|
54173
|
-
|
|
54174
|
+
const collectedSkips = [];
|
|
54175
|
+
await walk(rootDir, rootDir, ig, entries, collectedSkips);
|
|
54176
|
+
if (skipped)
|
|
54177
|
+
skipped.push(...collectedSkips);
|
|
54174
54178
|
entries.sort((a3, b3) => a3.relPath.localeCompare(b3.relPath));
|
|
54175
54179
|
const oversized = entries.find((e2) => e2.size > MAX_FILE_BYTES);
|
|
54176
54180
|
if (oversized) {
|
|
@@ -54179,7 +54183,7 @@ async function walkFolder(rootDir) {
|
|
|
54179
54183
|
}
|
|
54180
54184
|
return entries;
|
|
54181
54185
|
}
|
|
54182
|
-
async function walk(rootDir, dir, ig, out) {
|
|
54186
|
+
async function walk(rootDir, dir, ig, out, skipped) {
|
|
54183
54187
|
let dirents;
|
|
54184
54188
|
try {
|
|
54185
54189
|
dirents = await fs12.readdir(dir, { withFileTypes: true });
|
|
@@ -54193,12 +54197,18 @@ async function walk(rootDir, dir, ig, out) {
|
|
|
54193
54197
|
const absPath = join72(dir, name);
|
|
54194
54198
|
const relPath = relative14(rootDir, absPath).split("\\").join("/");
|
|
54195
54199
|
if (dirent.isDirectory()) {
|
|
54196
|
-
if (ig.ignores(`${relPath}/`))
|
|
54200
|
+
if (ig.ignores(`${relPath}/`)) {
|
|
54201
|
+
if (!HARD_IGNORE_NAMES.has(name))
|
|
54202
|
+
skipped.push(`${relPath}/`);
|
|
54197
54203
|
continue;
|
|
54198
|
-
|
|
54204
|
+
}
|
|
54205
|
+
await walk(rootDir, absPath, ig, out, skipped);
|
|
54199
54206
|
} else if (dirent.isFile()) {
|
|
54200
|
-
if (ig.ignores(relPath))
|
|
54207
|
+
if (ig.ignores(relPath)) {
|
|
54208
|
+
if (!HARD_IGNORE_NAMES.has(name))
|
|
54209
|
+
skipped.push(relPath);
|
|
54201
54210
|
continue;
|
|
54211
|
+
}
|
|
54202
54212
|
const stat8 = await fs12.stat(absPath);
|
|
54203
54213
|
out.push({ absPath, relPath, size: stat8.size });
|
|
54204
54214
|
}
|
|
@@ -54343,8 +54353,9 @@ async function uploadFolder(absPath, displayPath, token, opts) {
|
|
|
54343
54353
|
const spinner = de();
|
|
54344
54354
|
spinner.start(`Scanning ${displayPath}…`);
|
|
54345
54355
|
let entries;
|
|
54356
|
+
const skippedPaths = [];
|
|
54346
54357
|
try {
|
|
54347
|
-
entries = await walkFolder(absPath);
|
|
54358
|
+
entries = await walkFolder(absPath, skippedPaths);
|
|
54348
54359
|
} catch (err) {
|
|
54349
54360
|
spinner.stop("Scan failed.", 1);
|
|
54350
54361
|
if (err instanceof FolderLimitError) {
|
|
@@ -54361,6 +54372,11 @@ async function uploadFolder(absPath, displayPath, token, opts) {
|
|
|
54361
54372
|
process.exitCode = 1;
|
|
54362
54373
|
return;
|
|
54363
54374
|
}
|
|
54375
|
+
if (skippedPaths.length > 0) {
|
|
54376
|
+
const preview = skippedPaths.slice(0, 5).join(", ");
|
|
54377
|
+
const more = skippedPaths.length > 5 ? `, +${skippedPaths.length - 5} more` : "";
|
|
54378
|
+
console.warn(`Skipped ${skippedPaths.length} path(s) matched by .gitignore/.tkmignore: ${preview}${more}`);
|
|
54379
|
+
}
|
|
54364
54380
|
let files;
|
|
54365
54381
|
let folderHash;
|
|
54366
54382
|
try {
|