@bscotch/stitch-config 0.4.1 → 0.5.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/README.md +31 -0
- package/dist/cli.d.mts +3 -0
- package/dist/cli.d.mts.map +1 -0
- package/dist/cli.mjs +30 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/project.d.ts +26 -0
- package/dist/project.d.ts.map +1 -0
- package/dist/project.js +117 -0
- package/dist/project.js.map +1 -0
- package/dist/schema.d.ts +1 -0
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +3 -2
- package/dist/schema.js.map +1 -1
- package/package.json +16 -2
package/README.md
CHANGED
|
@@ -9,3 +9,34 @@ The `stitch.config.json` file is used for configuration options that:
|
|
|
9
9
|
- Are specific to the project (i.e. not general configuration)
|
|
10
10
|
- Must be followed by all collaborators on that project
|
|
11
11
|
- Are not machine-dependent nor user-dependent
|
|
12
|
+
|
|
13
|
+
It should therefore be tracked in your project's Git history.
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
### Programmatic
|
|
18
|
+
|
|
19
|
+
You can import the schemas from the main entrypoint:
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import { stitchConfigSchema } from '@bscotch/stitch-config';
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
And a few GameMaker project-management functions from the 'projects' entrypoint:
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
import {
|
|
29
|
+
findProjectConfigPath,
|
|
30
|
+
ensureProjectConfig, // Initialize a config file
|
|
31
|
+
loadProjectConfig,
|
|
32
|
+
saveProjectConfig,
|
|
33
|
+
applyGroupAssignments, // Apply texture group and audio group assignments from a config to its project
|
|
34
|
+
} from '@bscotch/stitch-config/project';
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### CLI
|
|
38
|
+
|
|
39
|
+
If you install globally you can use the CLI via `stitch-config`. Otherwise you can call it in a local install with `npx stitch-config`.
|
|
40
|
+
|
|
41
|
+
- `stitch-config init <yypFile>`: Ensure a Stitch config file exists for the target project
|
|
42
|
+
- `stitch-config sync-groups <yypFile>`: The Stitch config allows specifying audio and texture group assignment rules. This command updates the sprites and sounds to follow those rules.
|
package/dist/cli.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.mts","sourceRoot":"","sources":["../src/cli.mts"],"names":[],"mappings":""}
|
package/dist/cli.mjs
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { applyGroupAssignments, ensureProjectConfig } from './project.js';
|
|
3
|
+
const [command, ...args] = process.argv.slice(2);
|
|
4
|
+
if (command === 'init') {
|
|
5
|
+
const [yypFile] = args;
|
|
6
|
+
if (!yypFile || askingForHelp(yypFile)) {
|
|
7
|
+
console.error('Usage: stitch-config init <yypFile>');
|
|
8
|
+
console.error('\nEnsures that a Stitch Config file exists for the target project.');
|
|
9
|
+
process.exit(1);
|
|
10
|
+
}
|
|
11
|
+
await ensureProjectConfig(yypFile);
|
|
12
|
+
}
|
|
13
|
+
else if (command === 'sync-groups') {
|
|
14
|
+
const [yypFile] = args;
|
|
15
|
+
if (!yypFile || askingForHelp(yypFile)) {
|
|
16
|
+
console.error('Usage: stitch-config sync-groups <yypFile>');
|
|
17
|
+
console.error('\nUpdate Sprites and Sounds so that their texture/audio groups match what the config says they should have.');
|
|
18
|
+
process.exit(1);
|
|
19
|
+
}
|
|
20
|
+
await applyGroupAssignments(yypFile);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
console.error(`Unknown command: ${command}`);
|
|
24
|
+
console.error(`Available commands: init, sync-groups`);
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
function askingForHelp(arg) {
|
|
28
|
+
return ['-h', '--help', 'help'].includes(arg);
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=cli.mjs.map
|
package/dist/cli.mjs.map
ADDED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C,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type StitchConfig } from './schema.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Ensure that any texture/audio group assignments set in the config
|
|
4
|
+
* (if found) are being applied to the appropriate assets.
|
|
5
|
+
*/
|
|
6
|
+
export declare function applyGroupAssignments(yypPath: string): Promise<void>;
|
|
7
|
+
export declare function ensureProjectConfig(yypPath: string): Promise<void>;
|
|
8
|
+
/**
|
|
9
|
+
* Given a path to a GameMaker project's YYP file, load
|
|
10
|
+
* its Stitch Config file if it has one. Else return an
|
|
11
|
+
* empty config.
|
|
12
|
+
*/
|
|
13
|
+
export declare function loadProjectConfig(yypPath: string): Promise<StitchConfig>;
|
|
14
|
+
export declare function saveProjectConfig(yypPath: string, config: StitchConfig): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Given a path to a GameMaker project's YYP file, get
|
|
17
|
+
* the path to where its config file should be. Asserts
|
|
18
|
+
* existence of the yyp file.
|
|
19
|
+
*/
|
|
20
|
+
export declare function findProjectConfigPath(yypPath: string): Promise<{
|
|
21
|
+
filename: string;
|
|
22
|
+
fullpath: string;
|
|
23
|
+
parent: string;
|
|
24
|
+
ext: `.${string}`;
|
|
25
|
+
}>;
|
|
26
|
+
//# sourceMappingURL=project.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../src/project.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,KAAK,YAAY,EAGlB,MAAM,aAAa,CAAC;AAErB;;;GAGG;AACH,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,MAAM,iBAoE1D;AAED,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAKxE;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,YAAY,CAAC,CAcvB;AAED,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,iBAQ5E;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,MAAM;;;;;GAK1D"}
|
package/dist/project.js
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { ensureGroups, joinPaths, listYyFiles, parsePath, Yy, } from '@bscotch/yy';
|
|
2
|
+
import { ok } from 'node:assert';
|
|
3
|
+
import fsp from 'node:fs/promises';
|
|
4
|
+
import { stitchConfigFilename, stitchConfigSchema, } from "./schema.js";
|
|
5
|
+
/**
|
|
6
|
+
* Ensure that any texture/audio group assignments set in the config
|
|
7
|
+
* (if found) are being applied to the appropriate assets.
|
|
8
|
+
*/
|
|
9
|
+
export async function applyGroupAssignments(yypPath) {
|
|
10
|
+
const config = await loadProjectConfig(yypPath);
|
|
11
|
+
for (const kind of ['audio', 'texture']) {
|
|
12
|
+
// Make sure the group exists in the YYP file
|
|
13
|
+
const groupNames = Object.values(config[`${kind}GroupAssignments`] || {});
|
|
14
|
+
if (!groupNames.length)
|
|
15
|
+
continue;
|
|
16
|
+
await ensureGroups(yypPath, kind, groupNames);
|
|
17
|
+
// For each folder in the assignment config, find all matching
|
|
18
|
+
// resources and update their group. They apply by specificy, so
|
|
19
|
+
// can sort them by *longest* folder and apply the first match.
|
|
20
|
+
const assignments = Object.entries(config[`${kind}GroupAssignments`] || {});
|
|
21
|
+
// Sort by folder length
|
|
22
|
+
assignments.sort((a, b) => b[0].length - a[0].length);
|
|
23
|
+
const resourceParentFolder = joinPaths(parsePath(yypPath).parent, kind === 'audio' ? 'sounds' : 'sprites');
|
|
24
|
+
const yys = await listYyFiles(resourceParentFolder);
|
|
25
|
+
// Try to allow for some parallelization since we have to read a LOT
|
|
26
|
+
// of files.
|
|
27
|
+
const waits = [];
|
|
28
|
+
for (const yyFile of yys) {
|
|
29
|
+
waits.push(Yy.read(yyFile.path, kind === 'audio' ? 'sounds' : 'sprites').then(async (yy) => {
|
|
30
|
+
// Start from the *end* of the assignments and apply the first
|
|
31
|
+
// that matches (if any)
|
|
32
|
+
for (const [targetFolder, targetGroup] of assignments) {
|
|
33
|
+
const inFolder = yy.parent.path.replace(/^folders[/\\](.*)\.yy$/, '$1');
|
|
34
|
+
const isMatch = inFolder === targetFolder ||
|
|
35
|
+
inFolder.startsWith(`${targetFolder}/`);
|
|
36
|
+
if (!isMatch)
|
|
37
|
+
continue;
|
|
38
|
+
// Update the assigned group if it's different
|
|
39
|
+
if (kind === 'audio') {
|
|
40
|
+
const yySound = yy;
|
|
41
|
+
if (yySound.audioGroupId.name !== targetGroup) {
|
|
42
|
+
yySound.audioGroupId = {
|
|
43
|
+
name: targetGroup,
|
|
44
|
+
path: `audiogroups/${targetGroup}`,
|
|
45
|
+
};
|
|
46
|
+
await Yy.write(yyFile.path, yySound, 'sounds');
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
const yySprite = yy;
|
|
51
|
+
if (yySprite.textureGroupId.name !== targetGroup) {
|
|
52
|
+
yySprite.textureGroupId = {
|
|
53
|
+
name: targetGroup,
|
|
54
|
+
path: `texturegroups/${targetGroup}`,
|
|
55
|
+
};
|
|
56
|
+
await Yy.write(yyFile.path, yySprite, 'sprites');
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// No need to keep going if we got a match!
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
}));
|
|
63
|
+
}
|
|
64
|
+
await Promise.allSettled(waits);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
export async function ensureProjectConfig(yypPath) {
|
|
68
|
+
const configPath = await findProjectConfigPath(yypPath);
|
|
69
|
+
if (!(await fileExists(configPath.fullpath))) {
|
|
70
|
+
await saveProjectConfig(yypPath, stitchConfigSchema.parse({}));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Given a path to a GameMaker project's YYP file, load
|
|
75
|
+
* its Stitch Config file if it has one. Else return an
|
|
76
|
+
* empty config.
|
|
77
|
+
*/
|
|
78
|
+
export async function loadProjectConfig(yypPath) {
|
|
79
|
+
const configPath = await findProjectConfigPath(yypPath);
|
|
80
|
+
if (!(await fileExists(configPath.fullpath))) {
|
|
81
|
+
return stitchConfigSchema.parse({});
|
|
82
|
+
}
|
|
83
|
+
try {
|
|
84
|
+
const raw = await fsp.readFile(configPath.fullpath, 'utf8');
|
|
85
|
+
return stitchConfigSchema.parse(JSON.parse(raw));
|
|
86
|
+
}
|
|
87
|
+
catch (err) {
|
|
88
|
+
console.error('Failed to load existing Stitch config. Check for syntax and content errors.');
|
|
89
|
+
throw err;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
export async function saveProjectConfig(yypPath, config) {
|
|
93
|
+
const configPath = await findProjectConfigPath(yypPath);
|
|
94
|
+
config = stitchConfigSchema.parse(config);
|
|
95
|
+
await fsp.writeFile(configPath.fullpath, JSON.stringify(config, null, 2), 'utf8');
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Given a path to a GameMaker project's YYP file, get
|
|
99
|
+
* the path to where its config file should be. Asserts
|
|
100
|
+
* existence of the yyp file.
|
|
101
|
+
*/
|
|
102
|
+
export async function findProjectConfigPath(yypPath) {
|
|
103
|
+
ok(yypPath.endsWith('.yyp'), 'Target file must be a .yyp');
|
|
104
|
+
ok(await fileExists(yypPath), 'yyp file not found');
|
|
105
|
+
const configFile = joinPaths(parsePath(yypPath).parent, stitchConfigFilename);
|
|
106
|
+
return parsePath(configFile);
|
|
107
|
+
}
|
|
108
|
+
async function fileExists(path) {
|
|
109
|
+
try {
|
|
110
|
+
await fsp.access(path);
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
113
|
+
catch {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
//#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EH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,eAAO,MAAM,0BAA0B;;;;;;iBA2BrC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,eAAO,MAAM,sBAAsB;;;;;;;;;iBAiBhC,CAAC;AAEJ,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;iBA6C5B,CAAC"}
|
package/dist/schema.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
export const stitchConfigFilename = 'stitch.config.json';
|
|
2
3
|
export const permissiveStringRecord = z.object({}).catchall(z.string());
|
|
3
4
|
const allowedNames = z
|
|
4
5
|
.array(z.string())
|
|
@@ -49,11 +50,11 @@ export const stitchConfigSchema = z
|
|
|
49
50
|
textureGroupAssignments: z
|
|
50
51
|
.record(z.string(), z.string())
|
|
51
52
|
.optional()
|
|
52
|
-
.describe('A map of resource tree paths to texture
|
|
53
|
+
.describe('A map of resource tree paths to texture group names. Supported Stitch utilities will use this to assign sprites in those paths (recursively) to the specified texture group. The most specific match is the on that gets applied.'),
|
|
53
54
|
audioGroupAssignments: z
|
|
54
55
|
.record(z.string(), z.string())
|
|
55
56
|
.optional()
|
|
56
|
-
.describe('A map of resource tree paths to audio
|
|
57
|
+
.describe('A map of resource tree paths to audio group names. Supported Stitch utilities will use this to assign sounds in those paths (recursively) to the specified audio group. The most specific match is the on that gets applied.'),
|
|
57
58
|
runtimeVersion: z
|
|
58
59
|
.string()
|
|
59
60
|
.optional()
|
package/dist/schema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../src/schema.ts"],"names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iF,CAClF;IACH,gBAAgB,EAAE,sBAAsB,CAAC,QAAQ,EAAE;CACpD,CAAC;KACD,QAAQ,CACP,0FAA0F,CAC3F,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bscotch/stitch-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Schemas and utilities for the stitch.config.json file.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"stitch",
|
|
@@ -14,9 +14,23 @@
|
|
|
14
14
|
},
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"type": "module",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"import": "./dist/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./project": {
|
|
23
|
+
"types": "./dist/project.d.ts",
|
|
24
|
+
"import": "./dist/project.js"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
17
27
|
"main": "dist/index.js",
|
|
28
|
+
"bin": {
|
|
29
|
+
"stitch-config": "./dist/cli.mjs"
|
|
30
|
+
},
|
|
18
31
|
"dependencies": {
|
|
19
|
-
"zod": "4.0.15"
|
|
32
|
+
"zod": "4.0.15",
|
|
33
|
+
"@bscotch/yy": "2.6.0"
|
|
20
34
|
},
|
|
21
35
|
"devDependencies": {
|
|
22
36
|
"@bscotch/pathy": "^2.12.1",
|