msfs-layout-generator 0.1.0 → 0.1.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/LICENSE +674 -674
- package/dist/cli.js +22 -22
- package/package.json +5 -1
- package/dist/cli.d.ts +0 -2
- package/dist/constants/constants.d.ts +0 -1
- package/dist/errors/ManifestWritingError.d.ts +0 -3
- package/dist/errors/ReadingDirError.d.ts +0 -3
- package/dist/errors/ReadingJsonError.d.ts +0 -3
- package/dist/errors/index.d.ts +0 -4
- package/dist/index.d.ts +0 -26
- package/dist/utils/doExcludeFile.d.ts +0 -1
- package/dist/utils/doProcessLayoutFile.d.ts +0 -1
- package/dist/utils/doUpdateManifest.d.ts +0 -1
- package/dist/utils/getAllFiles.d.ts +0 -1
- package/dist/utils/getWindowsFileTime.d.ts +0 -1
- package/dist/utils/readJson.d.ts +0 -1
package/dist/cli.js
CHANGED
|
@@ -80,28 +80,28 @@ program
|
|
|
80
80
|
.action(async (directories, options) => {
|
|
81
81
|
await handleAction(directories, options);
|
|
82
82
|
})
|
|
83
|
-
.addHelpText('after', `
|
|
84
|
-
${chalk_1.default.bold('Examples:')}
|
|
85
|
-
${chalk_1.default.dim('# Process a single package')}
|
|
86
|
-
msfs-layout "
|
|
87
|
-
|
|
88
|
-
${chalk_1.default.dim('# Process multiple packages')}
|
|
89
|
-
msfs-layout "
|
|
90
|
-
|
|
91
|
-
${chalk_1.default.dim('# Process current directory')}
|
|
92
|
-
msfs-layout .
|
|
93
|
-
|
|
94
|
-
${chalk_1.default.dim('# Force overwrite existing layout.json')}
|
|
95
|
-
msfs-layout ./my-package --force
|
|
96
|
-
|
|
97
|
-
${chalk_1.default.dim('# Quiet mode - minimal output')}
|
|
98
|
-
msfs-layout ./my-package --quiet
|
|
99
|
-
|
|
100
|
-
${chalk_1.default.bold('Notes:')}
|
|
101
|
-
• Each directory should contain a ${chalk_1.default.cyan('manifest.json')} file
|
|
102
|
-
• Creates/updates ${chalk_1.default.cyan('layout.json')} in the same directory
|
|
103
|
-
• Automatically excludes ${chalk_1.default.yellow('_CVT_')} directories
|
|
104
|
-
• Updates ${chalk_1.default.cyan('total_package_size')} in manifest.json
|
|
83
|
+
.addHelpText('after', `
|
|
84
|
+
${chalk_1.default.bold('Examples:')}
|
|
85
|
+
${chalk_1.default.dim('# Process a single package')}
|
|
86
|
+
msfs-layout "C:\\Route To your\\Community\\Folder"
|
|
87
|
+
|
|
88
|
+
${chalk_1.default.dim('# Process multiple packages')}
|
|
89
|
+
msfs-layout "First root" "Second root" "Third one"
|
|
90
|
+
|
|
91
|
+
${chalk_1.default.dim('# Process current directory')}
|
|
92
|
+
msfs-layout .
|
|
93
|
+
|
|
94
|
+
${chalk_1.default.dim('# Force overwrite existing layout.json')}
|
|
95
|
+
msfs-layout ./my-package --force
|
|
96
|
+
|
|
97
|
+
${chalk_1.default.dim('# Quiet mode - minimal output')}
|
|
98
|
+
msfs-layout ./my-package --quiet
|
|
99
|
+
|
|
100
|
+
${chalk_1.default.bold('Notes:')}
|
|
101
|
+
• Each directory should contain a ${chalk_1.default.cyan('manifest.json')} file
|
|
102
|
+
• Creates/updates ${chalk_1.default.cyan('layout.json')} in the same directory
|
|
103
|
+
• Automatically excludes ${chalk_1.default.yellow('_CVT_')} directories
|
|
104
|
+
• Updates ${chalk_1.default.cyan('total_package_size')} in manifest.json
|
|
105
105
|
`);
|
|
106
106
|
// Handle the main action
|
|
107
107
|
async function handleAction(directories, options) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "msfs-layout-generator",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Generate layout.json for MSFS community packages",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/p-sergienko/msfs-layout-generator.git"
|
|
8
|
+
},
|
|
5
9
|
"main": "./dist/index.cjs",
|
|
6
10
|
"module": "./dist/index.js",
|
|
7
11
|
"types": "./dist/index.d.ts",
|
package/dist/cli.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const excludedFiles: Set<string>;
|
package/dist/errors/index.d.ts
DELETED
package/dist/index.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Process an MSFS package directory to generate/update layout.json
|
|
3
|
-
*
|
|
4
|
-
* This function scans all files in the package directory, creates a layout.json
|
|
5
|
-
* with file metadata, and updates the total_package_size in manifest.json.
|
|
6
|
-
*
|
|
7
|
-
* @param packageDir - Path to the MSFS package directory (must contain manifest.json)
|
|
8
|
-
* @returns Promise that resolves when layout.json has been generated
|
|
9
|
-
*
|
|
10
|
-
* @throws {Error} If package directory doesn't exist or doesn't contain manifest.json
|
|
11
|
-
* @throws {Error} If no valid files are found in the package
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* // Basic usage
|
|
15
|
-
* await doProcessLayoutFile("F:\\fs20\\Community\\my-package");
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* // With error handling
|
|
19
|
-
* try {
|
|
20
|
-
* await generateLayout("./my-package");
|
|
21
|
-
* console.log("Layout generated successfully");
|
|
22
|
-
* } catch (error) {
|
|
23
|
-
* console.error("Failed:", error.message);
|
|
24
|
-
* }
|
|
25
|
-
*/
|
|
26
|
-
export declare const generateLayout: (layoutPath: string) => Promise<void>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const doExcludeFile: (relativePath: string) => boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const doProcessLayoutFile: (layoutPath: string) => Promise<void>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const doUpdateManifest: (manifestPath: string, totalPackageSize: number) => Promise<void>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getAllFiles: (dirPath: string) => Promise<string[]>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getWindowsFileTime: (date: Date) => number;
|
package/dist/utils/readJson.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function readJson<T = unknown>(path: string): Promise<T | null>;
|