@bscotch/yy 2.4.0 → 2.6.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.
Files changed (77) hide show
  1. package/README.md +41 -4
  2. package/dist/Yy.d.ts +2268 -9447
  3. package/dist/Yy.d.ts.map +1 -1
  4. package/dist/Yy.js +2 -4
  5. package/dist/Yy.js.map +1 -1
  6. package/dist/Yy.parse.d.ts +2 -2
  7. package/dist/Yy.parse.d.ts.map +1 -1
  8. package/dist/Yy.parse.js.map +1 -1
  9. package/dist/Yy.stringify.js +14 -0
  10. package/dist/Yy.stringify.js.map +1 -1
  11. package/dist/cli.d.mts +3 -0
  12. package/dist/cli.d.mts.map +1 -0
  13. package/dist/cli.mjs +39 -0
  14. package/dist/cli.mjs.map +1 -0
  15. package/dist/groups.d.ts +8 -0
  16. package/dist/groups.d.ts.map +1 -0
  17. package/dist/groups.js +26 -0
  18. package/dist/groups.js.map +1 -0
  19. package/dist/index.d.ts +6 -2
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +6 -2
  22. package/dist/index.js.map +1 -1
  23. package/dist/scripts.d.ts +17 -0
  24. package/dist/scripts.d.ts.map +1 -0
  25. package/dist/scripts.js +88 -0
  26. package/dist/scripts.js.map +1 -0
  27. package/dist/types/GameMakerVersionString.js.map +1 -1
  28. package/dist/types/YyBase.d.ts +5 -38
  29. package/dist/types/YyBase.d.ts.map +1 -1
  30. package/dist/types/YyBase.js +4 -1
  31. package/dist/types/YyBase.js.map +1 -1
  32. package/dist/types/YyExtension.d.ts +17 -753
  33. package/dist/types/YyExtension.d.ts.map +1 -1
  34. package/dist/types/YyExtension.js +4 -8
  35. package/dist/types/YyExtension.js.map +1 -1
  36. package/dist/types/YyObject.d.ts +25 -321
  37. package/dist/types/YyObject.d.ts.map +1 -1
  38. package/dist/types/YyRoom.d.ts +184 -2867
  39. package/dist/types/YyRoom.d.ts.map +1 -1
  40. package/dist/types/YyRoom.js +45 -43
  41. package/dist/types/YyRoom.js.map +1 -1
  42. package/dist/types/YyRoomUI.d.ts +4 -50
  43. package/dist/types/YyRoomUI.d.ts.map +1 -1
  44. package/dist/types/YyRoomUI.js +2 -4
  45. package/dist/types/YyRoomUI.js.map +1 -1
  46. package/dist/types/YyScript.d.ts +4 -38
  47. package/dist/types/YyScript.d.ts.map +1 -1
  48. package/dist/types/YyShader.d.ts +4 -52
  49. package/dist/types/YyShader.d.ts.map +1 -1
  50. package/dist/types/YySound.d.ts +150 -79
  51. package/dist/types/YySound.d.ts.map +1 -1
  52. package/dist/types/YySound.js +83 -16
  53. package/dist/types/YySound.js.map +1 -1
  54. package/dist/types/YySprite.d.ts +1385 -2633
  55. package/dist/types/YySprite.d.ts.map +1 -1
  56. package/dist/types/YySprite.js +40 -24
  57. package/dist/types/YySprite.js.map +1 -1
  58. package/dist/types/YySprite.lib.d.ts +564 -123
  59. package/dist/types/YySprite.lib.d.ts.map +1 -1
  60. package/dist/types/YySprite.lib.js.map +1 -1
  61. package/dist/types/Yyp.d.ts +50 -1100
  62. package/dist/types/Yyp.d.ts.map +1 -1
  63. package/dist/types/Yyp.js +15 -13
  64. package/dist/types/Yyp.js.map +1 -1
  65. package/dist/types/utility.d.ts +21 -28
  66. package/dist/types/utility.d.ts.map +1 -1
  67. package/dist/types/utility.js +42 -14
  68. package/dist/types/utility.js.map +1 -1
  69. package/dist/versioning.d.ts +12 -0
  70. package/dist/versioning.d.ts.map +1 -0
  71. package/dist/versioning.js +82 -0
  72. package/dist/versioning.js.map +1 -0
  73. package/package.json +13 -13
  74. package/dist/cli.d.ts +0 -2
  75. package/dist/cli.d.ts.map +0 -1
  76. package/dist/cli.js +0 -17
  77. package/dist/cli.js.map +0 -1
package/README.md CHANGED
@@ -35,7 +35,7 @@ In your project root:
35
35
 
36
36
  ### Programmatic
37
37
 
38
- In your Node code:
38
+ Main entrypoint for reading and writing Yy files:
39
39
 
40
40
  ```ts
41
41
  // In Typescript, or in an ES6 module:
@@ -48,9 +48,46 @@ parsedFile = await Yy.read('./my-project.yyp');
48
48
  const reStringified = Yy.stringify(parsedFile);
49
49
  ```
50
50
 
51
+ Update the version of a GameMaker project by setting the per-target version fields in all options files:
52
+
53
+ ```ts
54
+ import { setProjectVersion } from '@bscotch/yy';
55
+ await setProjectVersion('my/project.yyp', '1.2.3.4');
56
+ ```
57
+
58
+ Ensure a script exists, for example to update a script containing version information as part of a build pipeline (note that the [`@bscotch/gml-parser](https://www.npmjs.com/package/@bscotch/gml-parser) project is more full-featured for managing assets):
59
+
60
+ ```ts
61
+ import { addScript } from '@bscotch/yy';
62
+ await addScript('my/project.yyp', 'versioning', 'global.VERSION = 1.2.3.4');
63
+ ```
64
+
65
+ Ensure a collection of audio or texture groups exist, for example as part of an automatic group-assignment pipeline:
66
+
67
+ ```ts
68
+ import { ensureGroups } from '@bscotch/yy';
69
+ await ensureGroups('my/project.yyp', 'audio', [
70
+ 'MyAudioGroup',
71
+ 'MyOtherAudioGroup',
72
+ ]);
73
+ await ensureGroups('my/project.yyp', 'texture', [
74
+ 'MyTextureGroup',
75
+ 'MyOtherTextureGroup',
76
+ ]);
77
+ ```
78
+
51
79
  ### CLI
52
80
 
53
- Currently this package provides one CLI command, which generates a diff between two `.yy`/`.yyp`-like files:
81
+ This package provides a few CLI commands, available with the command `yy` if globally installed (e.g. by `npm i -g @bscotch/yy`) or by `npx yy` for a local install.
82
+
83
+ ### `yy diff`
84
+
85
+ Get a diff between two `.yy`/`.yyp`-like files:
86
+
87
+ `yy diff file1.yy file2.yy`
88
+
89
+ ### `yy version`
90
+
91
+ Set the projects version via all of its Options files, so that all platforms will be synced to a particular version:
54
92
 
55
- - If globally installed: `yy diff file1.yy file2.yy`
56
- - If locally installed: `npx yy diff file1.yy file2.yy` (or similar, depending on your Node package manager)
93
+ `yy version path/to/project.yyp 1.2.3.4`