@evitcastudio/kit 1.3.0 → 1.3.2
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/lib/bundle/cli/cli.js +12 -8
- package/package.json +1 -1
package/lib/bundle/cli/cli.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
/*!
|
|
4
|
-
* @evitcastudio/kit@1.3.
|
|
5
|
-
* Compiled Sat, 04 Jan 2025
|
|
4
|
+
* @evitcastudio/kit@1.3.2 git+https://github.com/EvitcaStudio/Kit.git
|
|
5
|
+
* Compiled Sat, 04 Jan 2025 16:05:39 UTC
|
|
6
6
|
* Copyright (c) 2025 Jared Bates, Evitca Studio, "doubleactii"
|
|
7
7
|
*
|
|
8
8
|
* @evitcastudio/kit is licensed under the MIT License.
|
|
@@ -2437,8 +2437,8 @@ function initializeResourceJSON() {
|
|
|
2437
2437
|
}
|
|
2438
2438
|
function prepareFileForProcessing(filePath) {
|
|
2439
2439
|
const extension = extname(filePath).slice(1);
|
|
2440
|
-
const fileName = filePath
|
|
2441
|
-
const resourceIdentifier = `${v4_default()}
|
|
2440
|
+
const fileName = basename(filePath);
|
|
2441
|
+
const resourceIdentifier = `${v4_default()}.vyr`;
|
|
2442
2442
|
const type = getResourceType(extension);
|
|
2443
2443
|
if (!type)
|
|
2444
2444
|
return;
|
|
@@ -2499,7 +2499,8 @@ async function processAllFiles() {
|
|
|
2499
2499
|
throw new Error(`Resource not found for file: ${fileName}`);
|
|
2500
2500
|
}
|
|
2501
2501
|
const destination = join(resourceOutDirectory, "resources");
|
|
2502
|
-
|
|
2502
|
+
const resourceName = resource.resourceIdentifier;
|
|
2503
|
+
return copyFile(filePath, destination, resourceName);
|
|
2503
2504
|
});
|
|
2504
2505
|
await Promise.all(copyOperations);
|
|
2505
2506
|
logVerbose(`[Kit CLI] All resources have been processed.`);
|
|
@@ -2510,7 +2511,10 @@ async function processAllFiles() {
|
|
|
2510
2511
|
}
|
|
2511
2512
|
async function clearResourceTypeDirectories(pBaseDirectory) {
|
|
2512
2513
|
try {
|
|
2513
|
-
await fs.
|
|
2514
|
+
const directoryExists = await fs.stat(pBaseDirectory).then((stat) => stat.isDirectory()).catch(() => false);
|
|
2515
|
+
if (directoryExists) {
|
|
2516
|
+
await fs.rm(pBaseDirectory, { recursive: true });
|
|
2517
|
+
}
|
|
2514
2518
|
} catch (pError) {
|
|
2515
2519
|
log(`${error(`[Error]`)} clearing resource directory: ${pError}`);
|
|
2516
2520
|
}
|
|
@@ -2526,7 +2530,7 @@ async function copyFile(pSource, pDestinationDir, pNewName) {
|
|
|
2526
2530
|
async function saveResourceJSON() {
|
|
2527
2531
|
const filePath = join(resourceOutDirectory, "resources", "resource.json");
|
|
2528
2532
|
try {
|
|
2529
|
-
await fs.writeFile(filePath, JSON.stringify(resourceJSON, null,
|
|
2533
|
+
await fs.writeFile(filePath, JSON.stringify(resourceJSON, null, 4));
|
|
2530
2534
|
} catch (pError) {
|
|
2531
2535
|
logError(`[Error] Saving resource JSON: ${pError}`);
|
|
2532
2536
|
}
|
|
@@ -2569,7 +2573,7 @@ class KitCLI {
|
|
|
2569
2573
|
// package.json
|
|
2570
2574
|
var package_default = {
|
|
2571
2575
|
name: "@evitcastudio/kit",
|
|
2572
|
-
version: "1.3.
|
|
2576
|
+
version: "1.3.2",
|
|
2573
2577
|
author: "doubleactii 56242467+doubleactii@users.noreply.github.com (https://evitcastudio.com)",
|
|
2574
2578
|
main: "./lib/index.js",
|
|
2575
2579
|
types: "./lib/index.d.ts",
|