@ms-cloudpack/config 0.32.4 → 0.33.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.
Files changed (177) hide show
  1. package/lib/builtInSettings/builtInSettings.d.ts +3895 -0
  2. package/lib/builtInSettings/builtInSettings.d.ts.map +1 -0
  3. package/lib/builtInSettings/builtInSettings.js +143 -0
  4. package/lib/builtInSettings/builtInSettings.js.map +1 -0
  5. package/lib/builtInSettings/createBuiltInSettingsTransform.d.ts +8 -0
  6. package/lib/builtInSettings/createBuiltInSettingsTransform.d.ts.map +1 -0
  7. package/lib/builtInSettings/createBuiltInSettingsTransform.js +21 -0
  8. package/lib/builtInSettings/createBuiltInSettingsTransform.js.map +1 -0
  9. package/lib/builtInSettings/deepFreeze.d.ts +14 -0
  10. package/lib/builtInSettings/deepFreeze.d.ts.map +1 -0
  11. package/lib/builtInSettings/deepFreeze.js +17 -0
  12. package/lib/builtInSettings/deepFreeze.js.map +1 -0
  13. package/lib/builtInSettings/getBuiltInSettings.d.ts +12 -0
  14. package/lib/builtInSettings/getBuiltInSettings.d.ts.map +1 -0
  15. package/lib/builtInSettings/getBuiltInSettings.js +44 -0
  16. package/lib/builtInSettings/getBuiltInSettings.js.map +1 -0
  17. package/lib/constants.d.ts +6 -0
  18. package/lib/constants.d.ts.map +1 -1
  19. package/lib/constants.js +7 -0
  20. package/lib/constants.js.map +1 -1
  21. package/lib/getConfigPath.d.ts.map +1 -1
  22. package/lib/getConfigPath.js.map +1 -1
  23. package/lib/index.d.ts +17 -16
  24. package/lib/index.d.ts.map +1 -1
  25. package/lib/index.js +17 -16
  26. package/lib/index.js.map +1 -1
  27. package/lib/packageDefinitions/createPackageDefinitions.d.ts.map +1 -0
  28. package/lib/{createPackageDefinitions.js → packageDefinitions/createPackageDefinitions.js} +2 -0
  29. package/lib/packageDefinitions/createPackageDefinitions.js.map +1 -0
  30. package/lib/packageDefinitions/createPackageSettingsTransform.d.ts.map +1 -0
  31. package/lib/{createPackageSettingsTransform.js → packageDefinitions/createPackageSettingsTransform.js} +9 -14
  32. package/lib/packageDefinitions/createPackageSettingsTransform.js.map +1 -0
  33. package/lib/packageSettings/checkMatch.d.ts.map +1 -0
  34. package/lib/packageSettings/checkMatch.js.map +1 -0
  35. package/lib/packageSettings/compareSettings.d.ts.map +1 -0
  36. package/lib/packageSettings/compareSettings.js.map +1 -0
  37. package/lib/{ensureGeneratedSettingsForPackage.d.ts → packageSettings/ensureGeneratedSettingsForPackage.d.ts} +2 -2
  38. package/lib/packageSettings/ensureGeneratedSettingsForPackage.d.ts.map +1 -0
  39. package/lib/packageSettings/ensureGeneratedSettingsForPackage.js.map +1 -0
  40. package/lib/packageSettings/getGeneratedPackageSettings.d.ts.map +1 -0
  41. package/lib/packageSettings/getGeneratedPackageSettings.js.map +1 -0
  42. package/lib/{getPackageSettings.d.ts → packageSettings/getPackageSettings.d.ts} +2 -0
  43. package/lib/packageSettings/getPackageSettings.d.ts.map +1 -0
  44. package/lib/{getPackageSettings.js → packageSettings/getPackageSettings.js} +12 -4
  45. package/lib/packageSettings/getPackageSettings.js.map +1 -0
  46. package/lib/packageSettings/mergePackageSettings.d.ts.map +1 -0
  47. package/lib/packageSettings/mergePackageSettings.js.map +1 -0
  48. package/lib/packageSettings/validateMatch.d.ts.map +1 -0
  49. package/lib/packageSettings/validateMatch.js.map +1 -0
  50. package/lib/readConfig/expandEnvironmentVariables.d.ts.map +1 -0
  51. package/lib/readConfig/expandEnvironmentVariables.js.map +1 -0
  52. package/lib/readConfig/mergeParentConfig.d.ts.map +1 -0
  53. package/lib/readConfig/mergeParentConfig.js.map +1 -0
  54. package/lib/readConfig/readAppConfig.d.ts.map +1 -0
  55. package/lib/{readAppConfig.js → readConfig/readAppConfig.js} +2 -2
  56. package/lib/readConfig/readAppConfig.js.map +1 -0
  57. package/lib/readConfig/readConfig.d.ts.map +1 -0
  58. package/lib/readConfig/readConfig.js.map +1 -0
  59. package/lib/readConfig/readGeneratedConfig.d.ts.map +1 -0
  60. package/lib/{readGeneratedConfig.js → readConfig/readGeneratedConfig.js} +1 -1
  61. package/lib/readConfig/readGeneratedConfig.js.map +1 -0
  62. package/lib/readConfig/resolveParentConfig.d.ts.map +1 -0
  63. package/lib/readConfig/resolveParentConfig.js.map +1 -0
  64. package/lib/userPreferences/getCachePath.d.ts.map +1 -0
  65. package/lib/userPreferences/getCachePath.js.map +1 -0
  66. package/lib/userPreferences/getUserPreferencesPath.d.ts.map +1 -0
  67. package/lib/{getUserPreferencesPath.js → userPreferences/getUserPreferencesPath.js} +1 -1
  68. package/lib/userPreferences/getUserPreferencesPath.js.map +1 -0
  69. package/lib/userPreferences/readUserPreferences.d.ts.map +1 -0
  70. package/lib/userPreferences/readUserPreferences.js.map +1 -0
  71. package/lib/userPreferences/updateUserPreference.d.ts.map +1 -0
  72. package/lib/{updateUserPreference.js → userPreferences/updateUserPreference.js} +1 -2
  73. package/lib/userPreferences/updateUserPreference.js.map +1 -0
  74. package/lib/writeConfig/ensureAppConfig.d.ts +6 -0
  75. package/lib/writeConfig/ensureAppConfig.d.ts.map +1 -0
  76. package/lib/writeConfig/ensureAppConfig.js +34 -0
  77. package/lib/writeConfig/ensureAppConfig.js.map +1 -0
  78. package/lib/writeConfig/sortGeneratedConfig.d.ts.map +1 -0
  79. package/lib/{sortGeneratedConfig.js → writeConfig/sortGeneratedConfig.js} +1 -1
  80. package/lib/writeConfig/sortGeneratedConfig.js.map +1 -0
  81. package/lib/writeConfig/sortObjectKeys.d.ts.map +1 -0
  82. package/lib/writeConfig/sortObjectKeys.js.map +1 -0
  83. package/lib/writeConfig/writeAppConfig.d.ts.map +1 -0
  84. package/lib/{writeAppConfig.js → writeConfig/writeAppConfig.js} +2 -2
  85. package/lib/writeConfig/writeAppConfig.js.map +1 -0
  86. package/lib/writeConfig/writeGeneratedConfig.d.ts.map +1 -0
  87. package/lib/{writeGeneratedConfig.js → writeConfig/writeGeneratedConfig.js} +2 -2
  88. package/lib/writeConfig/writeGeneratedConfig.js.map +1 -0
  89. package/package.json +4 -4
  90. package/lib/checkMatch.d.ts.map +0 -1
  91. package/lib/checkMatch.js.map +0 -1
  92. package/lib/compareSettings.d.ts.map +0 -1
  93. package/lib/compareSettings.js.map +0 -1
  94. package/lib/configTemplate.d.ts +0 -3
  95. package/lib/configTemplate.d.ts.map +0 -1
  96. package/lib/configTemplate.js +0 -21
  97. package/lib/configTemplate.js.map +0 -1
  98. package/lib/createPackageDefinitions.d.ts.map +0 -1
  99. package/lib/createPackageDefinitions.js.map +0 -1
  100. package/lib/createPackageSettingsTransform.d.ts.map +0 -1
  101. package/lib/createPackageSettingsTransform.js.map +0 -1
  102. package/lib/ensureGeneratedSettingsForPackage.d.ts.map +0 -1
  103. package/lib/ensureGeneratedSettingsForPackage.js.map +0 -1
  104. package/lib/expandEnvironmentVariables.d.ts.map +0 -1
  105. package/lib/expandEnvironmentVariables.js.map +0 -1
  106. package/lib/getCachePath.d.ts.map +0 -1
  107. package/lib/getCachePath.js.map +0 -1
  108. package/lib/getGeneratedPackageSettings.d.ts.map +0 -1
  109. package/lib/getGeneratedPackageSettings.js.map +0 -1
  110. package/lib/getPackageSettings.d.ts.map +0 -1
  111. package/lib/getPackageSettings.js.map +0 -1
  112. package/lib/getUserPreferencesPath.d.ts.map +0 -1
  113. package/lib/getUserPreferencesPath.js.map +0 -1
  114. package/lib/mergePackageSettings.d.ts.map +0 -1
  115. package/lib/mergePackageSettings.js.map +0 -1
  116. package/lib/mergeParentConfig.d.ts.map +0 -1
  117. package/lib/mergeParentConfig.js.map +0 -1
  118. package/lib/readAppConfig.d.ts.map +0 -1
  119. package/lib/readAppConfig.js.map +0 -1
  120. package/lib/readConfig.d.ts.map +0 -1
  121. package/lib/readConfig.js.map +0 -1
  122. package/lib/readGeneratedConfig.d.ts.map +0 -1
  123. package/lib/readGeneratedConfig.js.map +0 -1
  124. package/lib/readUserPreferences.d.ts.map +0 -1
  125. package/lib/readUserPreferences.js.map +0 -1
  126. package/lib/resolveParentConfig.d.ts.map +0 -1
  127. package/lib/resolveParentConfig.js.map +0 -1
  128. package/lib/schemaUrls.d.ts +0 -7
  129. package/lib/schemaUrls.d.ts.map +0 -1
  130. package/lib/schemaUrls.js +0 -8
  131. package/lib/schemaUrls.js.map +0 -1
  132. package/lib/sortGeneratedConfig.d.ts.map +0 -1
  133. package/lib/sortGeneratedConfig.js.map +0 -1
  134. package/lib/sortObjectKeys.d.ts.map +0 -1
  135. package/lib/sortObjectKeys.js.map +0 -1
  136. package/lib/updateUserPreference.d.ts.map +0 -1
  137. package/lib/updateUserPreference.js.map +0 -1
  138. package/lib/validateMatch.d.ts.map +0 -1
  139. package/lib/validateMatch.js.map +0 -1
  140. package/lib/writeAppConfig.d.ts.map +0 -1
  141. package/lib/writeAppConfig.js.map +0 -1
  142. package/lib/writeGeneratedConfig.d.ts.map +0 -1
  143. package/lib/writeGeneratedConfig.js.map +0 -1
  144. /package/lib/{createPackageDefinitions.d.ts → packageDefinitions/createPackageDefinitions.d.ts} +0 -0
  145. /package/lib/{createPackageSettingsTransform.d.ts → packageDefinitions/createPackageSettingsTransform.d.ts} +0 -0
  146. /package/lib/{checkMatch.d.ts → packageSettings/checkMatch.d.ts} +0 -0
  147. /package/lib/{checkMatch.js → packageSettings/checkMatch.js} +0 -0
  148. /package/lib/{compareSettings.d.ts → packageSettings/compareSettings.d.ts} +0 -0
  149. /package/lib/{compareSettings.js → packageSettings/compareSettings.js} +0 -0
  150. /package/lib/{ensureGeneratedSettingsForPackage.js → packageSettings/ensureGeneratedSettingsForPackage.js} +0 -0
  151. /package/lib/{getGeneratedPackageSettings.d.ts → packageSettings/getGeneratedPackageSettings.d.ts} +0 -0
  152. /package/lib/{getGeneratedPackageSettings.js → packageSettings/getGeneratedPackageSettings.js} +0 -0
  153. /package/lib/{mergePackageSettings.d.ts → packageSettings/mergePackageSettings.d.ts} +0 -0
  154. /package/lib/{mergePackageSettings.js → packageSettings/mergePackageSettings.js} +0 -0
  155. /package/lib/{validateMatch.d.ts → packageSettings/validateMatch.d.ts} +0 -0
  156. /package/lib/{validateMatch.js → packageSettings/validateMatch.js} +0 -0
  157. /package/lib/{expandEnvironmentVariables.d.ts → readConfig/expandEnvironmentVariables.d.ts} +0 -0
  158. /package/lib/{expandEnvironmentVariables.js → readConfig/expandEnvironmentVariables.js} +0 -0
  159. /package/lib/{mergeParentConfig.d.ts → readConfig/mergeParentConfig.d.ts} +0 -0
  160. /package/lib/{mergeParentConfig.js → readConfig/mergeParentConfig.js} +0 -0
  161. /package/lib/{readAppConfig.d.ts → readConfig/readAppConfig.d.ts} +0 -0
  162. /package/lib/{readConfig.d.ts → readConfig/readConfig.d.ts} +0 -0
  163. /package/lib/{readConfig.js → readConfig/readConfig.js} +0 -0
  164. /package/lib/{readGeneratedConfig.d.ts → readConfig/readGeneratedConfig.d.ts} +0 -0
  165. /package/lib/{resolveParentConfig.d.ts → readConfig/resolveParentConfig.d.ts} +0 -0
  166. /package/lib/{resolveParentConfig.js → readConfig/resolveParentConfig.js} +0 -0
  167. /package/lib/{getCachePath.d.ts → userPreferences/getCachePath.d.ts} +0 -0
  168. /package/lib/{getCachePath.js → userPreferences/getCachePath.js} +0 -0
  169. /package/lib/{getUserPreferencesPath.d.ts → userPreferences/getUserPreferencesPath.d.ts} +0 -0
  170. /package/lib/{readUserPreferences.d.ts → userPreferences/readUserPreferences.d.ts} +0 -0
  171. /package/lib/{readUserPreferences.js → userPreferences/readUserPreferences.js} +0 -0
  172. /package/lib/{updateUserPreference.d.ts → userPreferences/updateUserPreference.d.ts} +0 -0
  173. /package/lib/{sortGeneratedConfig.d.ts → writeConfig/sortGeneratedConfig.d.ts} +0 -0
  174. /package/lib/{sortObjectKeys.d.ts → writeConfig/sortObjectKeys.d.ts} +0 -0
  175. /package/lib/{sortObjectKeys.js → writeConfig/sortObjectKeys.js} +0 -0
  176. /package/lib/{writeAppConfig.d.ts → writeConfig/writeAppConfig.d.ts} +0 -0
  177. /package/lib/{writeGeneratedConfig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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgJ1B,CAAC"}
@@ -0,0 +1,143 @@
1
+ import { deepFreeze } from './deepFreeze.js';
2
+ /**
3
+ * Mapping from package name to version range to built-in settings.
4
+ *
5
+ * This object is frozen to prevent accidental modification.
6
+ *
7
+ * The reason we're handling package.json modifications (just `exports` as of writing) and
8
+ * `PackageSettings` separately is mainly to get around issues with merging exports maps.
9
+ * https://github.com/microsoft/cloudpack/pull/2452#discussion_r1835192676
10
+ * (If the exports merging issue is fixed in the future, and we don't find any cases where we want
11
+ * to override other package.json properties, they could potentially be combined and handled with
12
+ * only package settings.)
13
+ */
14
+ export const builtInSettings = deepFreeze({
15
+ '@microsoft/recognizers-text-date-time': {
16
+ '^1.0.0': {
17
+ // This has a "browser" entry which doesn't provide exports correctly in the browser when bundled??
18
+ // Switching to the regular entry point makes it work.
19
+ // https://unpkg.com/browse/@microsoft/recognizers-text-date-time@1.3.2/
20
+ packageJson: {
21
+ exports: './dist/recognizers-text-date-time.es5.js',
22
+ },
23
+ },
24
+ },
25
+ asap: {
26
+ '^2.0.0': {
27
+ // This package has different browser and non-browser versions in the "browser" field.
28
+ // Trying to bundle it with rollup (which creates an ESM stub) gives this error:
29
+ // [ESM stub generation] /<repo path>/node_modules/asap/browser-asap.js:10:33
30
+ // Error creating stub for entry "./browser-asap":
31
+ // TypeError: rawAsap.makeRequestCallFromTimer is not a function
32
+ // It's not clear why this happens, but bundling this CJS package with ori works okay
33
+ // since the package doesn't require() any dependencies.
34
+ // https://unpkg.com/browse/asap@2.0.6/
35
+ packageSettings: {
36
+ bundler: 'ori',
37
+ },
38
+ },
39
+ },
40
+ brotli: {
41
+ '^1.0.0': {
42
+ // index.js also imports a compress entry point with a reference to nonexistent Browser global
43
+ // https://unpkg.com/browse/brotli@1.3.3/
44
+ packageJson: {
45
+ exports: {
46
+ './decompress.js': './decompress.js',
47
+ },
48
+ },
49
+ },
50
+ },
51
+ bson: {
52
+ '^5.0.0 || ^6.0.0': {
53
+ // Package conditionally references "crypto", causing an error even though it's never used.
54
+ // Bundle with rollup instead, and ignore the warning about the empty crypto stub.
55
+ packageSettings: {
56
+ bundler: 'rollup',
57
+ ignoredBundlerWarnings: ['Generated an empty chunk: "_polyfill-node.crypto"'],
58
+ },
59
+ },
60
+ },
61
+ 'gql.tada': {
62
+ '^1.0.0': {
63
+ // This package has a combination of browser and CLI code.
64
+ // Remove the dependencies and entries which aren't needed in the browser.
65
+ // https://unpkg.com/browse/gql.tada@1.8.10/
66
+ packageSettings: {
67
+ excludedDependencies: ['@0no-co/graphqlsp', '@gql.tada/cli-utils', '@gql.tada/internal', 'typescript'],
68
+ },
69
+ packageJson: {
70
+ exports: './dist/gql-tada.mjs',
71
+ },
72
+ },
73
+ },
74
+ htmlparser2: {
75
+ // Issue below starts in 8.0.1 and continues in 9
76
+ '^8.0.1 || ^9.0.0': {
77
+ // This has an additional ./lib/WritableStream exports map entry which uses node stream
78
+ // https://unpkg.com/browse/htmlparser2@9.1.0/
79
+ packageJson: {
80
+ exports: './lib/esm/index.js',
81
+ },
82
+ },
83
+ },
84
+ react: {
85
+ '^16.14.0 || ^17.0.0': {
86
+ // Package is missing an exports map
87
+ // https://unpkg.com/browse/react@17/package.json
88
+ packageJson: {
89
+ exports: {
90
+ '.': './index.js',
91
+ './jsx-runtime': './jsx-runtime.js',
92
+ './jsx-dev-runtime': './jsx-dev-runtime.js',
93
+ },
94
+ },
95
+ },
96
+ },
97
+ scheduler: {
98
+ '>=0 <0.21.0': {
99
+ // Package is missing an exports map
100
+ // https://unpkg.com/browse/scheduler@0.20.x/package.json
101
+ packageJson: {
102
+ exports: {
103
+ '.': './index.js',
104
+ './tracing': './tracing.js',
105
+ },
106
+ },
107
+ },
108
+ '>=0.21.0 <1.0.0': {
109
+ // Package is missing an exports map
110
+ // https://unpkg.com/browse/scheduler@0.21.0/package.json
111
+ packageJson: {
112
+ exports: './index.js',
113
+ },
114
+ },
115
+ },
116
+ 'socket.io-client': {
117
+ '^4.4.1': {
118
+ // Remove unneeded exports
119
+ // https://unpkg.com/browse/socket.io-client@4/package.json
120
+ packageJson: {
121
+ exports: './build/esm/index.js',
122
+ },
123
+ },
124
+ },
125
+ tslib: {
126
+ '>=0 <2.5.3': {
127
+ // Remove unneeded exports
128
+ // https://unpkg.com/browse/tslib@2.5.2/package.json
129
+ packageJson: {
130
+ exports: './tslib.es6.js',
131
+ },
132
+ },
133
+ '^2.5.3': {
134
+ // Remove unneeded exports
135
+ // https://unpkg.com/browse/tslib@2.5.3/package.json
136
+ packageJson: {
137
+ exports: './tslib.es6.mjs',
138
+ },
139
+ },
140
+ },
141
+ // Please add new entries in alphabetical order by name!
142
+ });
143
+ //# sourceMappingURL=builtInSettings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builtInSettings.js","sourceRoot":"","sources":["../../src/builtInSettings/builtInSettings.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAgB7C;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAMvC;IACA,uCAAuC,EAAE;QACvC,QAAQ,EAAE;YACR,mGAAmG;YACnG,sDAAsD;YACtD,wEAAwE;YACxE,WAAW,EAAE;gBACX,OAAO,EAAE,0CAA0C;aACpD;SACF;KACF;IAED,IAAI,EAAE;QACJ,QAAQ,EAAE;YACR,sFAAsF;YACtF,gFAAgF;YAChF,+EAA+E;YAC/E,sDAAsD;YACtD,oEAAoE;YACpE,qFAAqF;YACrF,wDAAwD;YACxD,uCAAuC;YACvC,eAAe,EAAE;gBACf,OAAO,EAAE,KAAK;aACf;SACF;KACF;IAED,MAAM,EAAE;QACN,QAAQ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,WAAW,EAAE;gBACX,OAAO,EAAE,sBAAsB;aAChC;SACF;KACF;IAED,KAAK,EAAE;QACL,YAAY,EAAE;YACZ,0BAA0B;YAC1B,oDAAoD;YACpD,WAAW,EAAE;gBACX,OAAO,EAAE,gBAAgB;aAC1B;SACF;QACD,QAAQ,EAAE;YACR,0BAA0B;YAC1B,oDAAoD;YACpD,WAAW,EAAE;gBACX,OAAO,EAAE,iBAAiB;aAC3B;SACF;KACF;IAED,wDAAwD;CACzD,CAAC,CAAC","sourcesContent":["import type { PackageJson, PackageSettings } from '@ms-cloudpack/common-types';\nimport { deepFreeze } from './deepFreeze.js';\n\nexport interface BuiltInSettings {\n /**\n * Package settings to automatically apply for this package name/version.\n * (These are merged by `getPackageSettings`, mostly as called by `createPackageSettingsTransform`.)\n */\n packageSettings?: Omit<PackageSettings, 'match' | 'exports'>;\n /**\n * package.json settings to automatically apply for this package name/version.\n * These **overwrite** original properties of the `package.json` and are applied by\n * `PackageDefinitions` using `createBuiltInSettingsTransform`.\n */\n packageJson?: Omit<PackageJson, 'name' | 'version' | 'cloudpack'>;\n}\n\n/**\n * Mapping from package name to version range to built-in settings.\n *\n * This object is frozen to prevent accidental modification.\n *\n * The reason we're handling package.json modifications (just `exports` as of writing) and\n * `PackageSettings` separately is mainly to get around issues with merging exports maps.\n * https://github.com/microsoft/cloudpack/pull/2452#discussion_r1835192676\n * (If the exports merging issue is fixed in the future, and we don't find any cases where we want\n * to override other package.json properties, they could potentially be combined and handled with\n * only package settings.)\n */\nexport const builtInSettings = deepFreeze<\n Partial<{\n [packageName: string]: {\n [versionRange: string]: BuiltInSettings;\n };\n }>\n>({\n '@microsoft/recognizers-text-date-time': {\n '^1.0.0': {\n // This has a \"browser\" entry which doesn't provide exports correctly in the browser when bundled??\n // Switching to the regular entry point makes it work.\n // https://unpkg.com/browse/@microsoft/recognizers-text-date-time@1.3.2/\n packageJson: {\n exports: './dist/recognizers-text-date-time.es5.js',\n },\n },\n },\n\n asap: {\n '^2.0.0': {\n // This package has different browser and non-browser versions in the \"browser\" field.\n // Trying to bundle it with rollup (which creates an ESM stub) gives this error:\n // [ESM stub generation] /<repo path>/node_modules/asap/browser-asap.js:10:33\n // Error creating stub for entry \"./browser-asap\":\n // TypeError: rawAsap.makeRequestCallFromTimer is not a function\n // It's not clear why this happens, but bundling this CJS package with ori works okay\n // since the package doesn't require() any dependencies.\n // https://unpkg.com/browse/asap@2.0.6/\n packageSettings: {\n bundler: 'ori',\n },\n },\n },\n\n brotli: {\n '^1.0.0': {\n // index.js also imports a compress entry point with a reference to nonexistent Browser global\n // https://unpkg.com/browse/brotli@1.3.3/\n packageJson: {\n exports: {\n './decompress.js': './decompress.js',\n },\n },\n },\n },\n\n bson: {\n '^5.0.0 || ^6.0.0': {\n // Package conditionally references \"crypto\", causing an error even though it's never used.\n // Bundle with rollup instead, and ignore the warning about the empty crypto stub.\n packageSettings: {\n bundler: 'rollup',\n ignoredBundlerWarnings: ['Generated an empty chunk: \"_polyfill-node.crypto\"'],\n },\n },\n },\n\n 'gql.tada': {\n '^1.0.0': {\n // This package has a combination of browser and CLI code.\n // Remove the dependencies and entries which aren't needed in the browser.\n // https://unpkg.com/browse/gql.tada@1.8.10/\n packageSettings: {\n excludedDependencies: ['@0no-co/graphqlsp', '@gql.tada/cli-utils', '@gql.tada/internal', 'typescript'],\n },\n packageJson: {\n exports: './dist/gql-tada.mjs',\n },\n },\n },\n\n htmlparser2: {\n // Issue below starts in 8.0.1 and continues in 9\n '^8.0.1 || ^9.0.0': {\n // This has an additional ./lib/WritableStream exports map entry which uses node stream\n // https://unpkg.com/browse/htmlparser2@9.1.0/\n packageJson: {\n exports: './lib/esm/index.js',\n },\n },\n },\n\n react: {\n '^16.14.0 || ^17.0.0': {\n // Package is missing an exports map\n // https://unpkg.com/browse/react@17/package.json\n packageJson: {\n exports: {\n '.': './index.js',\n './jsx-runtime': './jsx-runtime.js',\n './jsx-dev-runtime': './jsx-dev-runtime.js',\n },\n },\n },\n },\n\n scheduler: {\n '>=0 <0.21.0': {\n // Package is missing an exports map\n // https://unpkg.com/browse/scheduler@0.20.x/package.json\n packageJson: {\n exports: {\n '.': './index.js',\n './tracing': './tracing.js',\n },\n },\n },\n '>=0.21.0 <1.0.0': {\n // Package is missing an exports map\n // https://unpkg.com/browse/scheduler@0.21.0/package.json\n packageJson: {\n exports: './index.js',\n },\n },\n },\n\n 'socket.io-client': {\n '^4.4.1': {\n // Remove unneeded exports\n // https://unpkg.com/browse/socket.io-client@4/package.json\n packageJson: {\n exports: './build/esm/index.js',\n },\n },\n },\n\n tslib: {\n '>=0 <2.5.3': {\n // Remove unneeded exports\n // https://unpkg.com/browse/tslib@2.5.2/package.json\n packageJson: {\n exports: './tslib.es6.js',\n },\n },\n '^2.5.3': {\n // Remove unneeded exports\n // https://unpkg.com/browse/tslib@2.5.3/package.json\n packageJson: {\n exports: './tslib.es6.mjs',\n },\n },\n },\n\n // Please add new entries in alphabetical order by name!\n});\n"]}
@@ -0,0 +1,8 @@
1
+ import type { PackageDefinitionTransform, PackageJson } from '@ms-cloudpack/common-types';
2
+ /**
3
+ * Applies package.json modifications from Cloudpack's `builtInSettings` for a package, if relevant.
4
+ * Does nothing if no matches are found.
5
+ */
6
+ export declare function createBuiltInSettingsTransform(): PackageDefinitionTransform;
7
+ export declare function _applyBuiltInSettings(definition: PackageJson): PackageJson | undefined;
8
+ //# sourceMappingURL=createBuiltInSettingsTransform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createBuiltInSettingsTransform.d.ts","sourceRoot":"","sources":["../../src/builtInSettings/createBuiltInSettingsTransform.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAG1F;;;GAGG;AACH,wBAAgB,8BAA8B,IAAI,0BAA0B,CAE3E;AAED,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,WAAW,GAAG,WAAW,GAAG,SAAS,CAWtF"}
@@ -0,0 +1,21 @@
1
+ import { getBuiltInSettings } from './getBuiltInSettings.js';
2
+ /**
3
+ * Applies package.json modifications from Cloudpack's `builtInSettings` for a package, if relevant.
4
+ * Does nothing if no matches are found.
5
+ */
6
+ export function createBuiltInSettingsTransform() {
7
+ return ({ definition }) => _applyBuiltInSettings(definition);
8
+ }
9
+ export function _applyBuiltInSettings(definition) {
10
+ const builtInSettings = getBuiltInSettings(definition);
11
+ if (builtInSettings?.packageJson) {
12
+ // For now, just overwrite any top-level keys. This could be modified later if needed
13
+ // (though we always want to overwrite exports).
14
+ return {
15
+ ...definition,
16
+ ...builtInSettings.packageJson,
17
+ };
18
+ }
19
+ return undefined;
20
+ }
21
+ //# sourceMappingURL=createBuiltInSettingsTransform.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createBuiltInSettingsTransform.js","sourceRoot":"","sources":["../../src/builtInSettings/createBuiltInSettingsTransform.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D;;;GAGG;AACH,MAAM,UAAU,8BAA8B;IAC5C,OAAO,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;AAC/D,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,UAAuB;IAC3D,MAAM,eAAe,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;IACvD,IAAI,eAAe,EAAE,WAAW,EAAE,CAAC;QACjC,qFAAqF;QACrF,gDAAgD;QAChD,OAAO;YACL,GAAG,UAAU;YACb,GAAG,eAAe,CAAC,WAAW;SAC/B,CAAC;IACJ,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import type { PackageDefinitionTransform, PackageJson } from '@ms-cloudpack/common-types';\nimport { getBuiltInSettings } from './getBuiltInSettings.js';\n\n/**\n * Applies package.json modifications from Cloudpack's `builtInSettings` for a package, if relevant.\n * Does nothing if no matches are found.\n */\nexport function createBuiltInSettingsTransform(): PackageDefinitionTransform {\n return ({ definition }) => _applyBuiltInSettings(definition);\n}\n\nexport function _applyBuiltInSettings(definition: PackageJson): PackageJson | undefined {\n const builtInSettings = getBuiltInSettings(definition);\n if (builtInSettings?.packageJson) {\n // For now, just overwrite any top-level keys. This could be modified later if needed\n // (though we always want to overwrite exports).\n return {\n ...definition,\n ...builtInSettings.packageJson,\n };\n }\n return undefined;\n}\n"]}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Deep readonly type. Currently only handles arrays, objects, and primitives (not sets or maps).
3
+ */
4
+ export type DeepReadonly<T> = T extends (infer U)[] ? ReadonlyArray<DeepReadonly<U>> : T extends object ? {
5
+ readonly [K in keyof T]: DeepReadonly<T[K]>;
6
+ } : T;
7
+ /**
8
+ * Deep `Object.freeze()` a JSON-like object in place.
9
+ * Returns the original object (now frozen) for convenience and typing.
10
+ *
11
+ * (This can be moved to a common location if anything else needs it in the future.)
12
+ */
13
+ export declare function deepFreeze<T>(obj: T): DeepReadonly<T>;
14
+ //# sourceMappingURL=deepFreeze.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepFreeze.d.ts","sourceRoot":"","sources":["../../src/builtInSettings/deepFreeze.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GAC/C,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,GAC9B,CAAC,SAAS,MAAM,GACd;IAAE,QAAQ,EAAE,CAAC,IAAI,MAAM,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GAC/C,CAAC,CAAC;AAER;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAUrD"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Deep `Object.freeze()` a JSON-like object in place.
3
+ * Returns the original object (now frozen) for convenience and typing.
4
+ *
5
+ * (This can be moved to a common location if anything else needs it in the future.)
6
+ */
7
+ export function deepFreeze(obj) {
8
+ if (obj && typeof obj === 'object') {
9
+ for (const value of Object.values(obj)) {
10
+ if (value && typeof value === 'object') {
11
+ deepFreeze(value);
12
+ }
13
+ }
14
+ }
15
+ return Object.freeze(obj);
16
+ }
17
+ //# sourceMappingURL=deepFreeze.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepFreeze.js","sourceRoot":"","sources":["../../src/builtInSettings/deepFreeze.ts"],"names":[],"mappings":"AASA;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAI,GAAM;IAClC,IAAI,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QACnC,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;YACvC,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;gBACvC,UAAU,CAAC,KAAK,CAAC,CAAC;YACpB,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,CAAC,GAAG,CAAoB,CAAC;AAC/C,CAAC","sourcesContent":["/**\n * Deep readonly type. Currently only handles arrays, objects, and primitives (not sets or maps).\n */\nexport type DeepReadonly<T> = T extends (infer U)[]\n ? ReadonlyArray<DeepReadonly<U>>\n : T extends object\n ? { readonly [K in keyof T]: DeepReadonly<T[K]> }\n : T;\n\n/**\n * Deep `Object.freeze()` a JSON-like object in place.\n * Returns the original object (now frozen) for convenience and typing.\n *\n * (This can be moved to a common location if anything else needs it in the future.)\n */\nexport function deepFreeze<T>(obj: T): DeepReadonly<T> {\n if (obj && typeof obj === 'object') {\n for (const value of Object.values(obj)) {\n if (value && typeof value === 'object') {\n deepFreeze(value);\n }\n }\n }\n\n return Object.freeze(obj) as DeepReadonly<T>;\n}\n"]}
@@ -0,0 +1,12 @@
1
+ import { type BuiltInSettings } from './builtInSettings.js';
2
+ /**
3
+ * Get any applicable built-in settings for the given package name and version.
4
+ *
5
+ * NOTE: This should usually not be called directly from outside the `@ms-cloudpack/config` package.
6
+ * It's just exported so tests can check their assumptions about what built-in settings exist.
7
+ */
8
+ export declare function getBuiltInSettings(params: {
9
+ name: string;
10
+ version: string | undefined;
11
+ }): BuiltInSettings | undefined;
12
+ //# sourceMappingURL=getBuiltInSettings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getBuiltInSettings.d.ts","sourceRoot":"","sources":["../../src/builtInSettings/getBuiltInSettings.ts"],"names":[],"mappings":"AAIA,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE7E;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAAG,eAAe,GAAG,SAAS,CAwCrH"}
@@ -0,0 +1,44 @@
1
+ import { mergeObjects } from '@ms-cloudpack/package-utilities';
2
+ import { satisfies } from 'semver';
3
+ import { mergePackageSettings } from '../packageSettings/mergePackageSettings.js';
4
+ import { builtInSettings } from './builtInSettings.js';
5
+ /**
6
+ * Get any applicable built-in settings for the given package name and version.
7
+ *
8
+ * NOTE: This should usually not be called directly from outside the `@ms-cloudpack/config` package.
9
+ * It's just exported so tests can check their assumptions about what built-in settings exist.
10
+ */
11
+ export function getBuiltInSettings(params) {
12
+ const { name, version } = params;
13
+ if (!version) {
14
+ return undefined;
15
+ }
16
+ // As of writing, there should be at most one matching setting, but find all of them
17
+ // and handle merging just to be safe.
18
+ const matchingSettings = Object.entries(builtInSettings[name] || {})
19
+ .filter(([range]) => satisfies(version, range))
20
+ .map(([, setting]) => setting);
21
+ if (!matchingSettings.length) {
22
+ return undefined;
23
+ }
24
+ const mergedSettings = {};
25
+ const packageJsons = matchingSettings
26
+ .map((s) => s.packageJson)
27
+ .filter((s) => !!s);
28
+ if (packageJsons.length) {
29
+ mergedSettings.packageJson = mergeObjects(packageJsons);
30
+ if (mergedSettings.packageJson.exports) {
31
+ // Currently, some of the cloudpack code can potentially mutate package.json `exports`.
32
+ // Copy the object to avoid accidentally mutating the constant.
33
+ mergedSettings.packageJson.exports = JSON.parse(JSON.stringify(mergedSettings.packageJson.exports));
34
+ }
35
+ }
36
+ const packageSettings = matchingSettings
37
+ .map((s) => s.packageSettings)
38
+ .filter((s) => !!s);
39
+ if (packageSettings.length) {
40
+ mergedSettings.packageSettings = mergePackageSettings(packageSettings);
41
+ }
42
+ return mergedSettings;
43
+ }
44
+ //# sourceMappingURL=getBuiltInSettings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getBuiltInSettings.js","sourceRoot":"","sources":["../../src/builtInSettings/getBuiltInSettings.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAClF,OAAO,EAAE,eAAe,EAAwB,MAAM,sBAAsB,CAAC;AAE7E;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAqD;IACtF,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;IACjC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,oFAAoF;IACpF,sCAAsC;IACtC,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;SACjE,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;SAC9C,GAAG,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC;IAEjC,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC;QAC7B,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,cAAc,GAAoB,EAAE,CAAC;IAE3C,MAAM,YAAY,GAAG,gBAAgB;SAClC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC;SACzB,MAAM,CAAC,CAAC,CAAC,EAAoD,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACxE,IAAI,YAAY,CAAC,MAAM,EAAE,CAAC;QACxB,cAAc,CAAC,WAAW,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC;QACxD,IAAI,cAAc,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;YACvC,uFAAuF;YACvF,+DAA+D;YAC/D,cAAc,CAAC,WAAW,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CAC7C,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,WAAW,CAAC,OAAO,CAAC,CAC7B,CAAC;QAC1B,CAAC;IACH,CAAC;IAED,MAAM,eAAe,GAAG,gBAAgB;SACrC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC;SAC7B,MAAM,CAAC,CAAC,CAAC,EAAwD,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5E,IAAI,eAAe,CAAC,MAAM,EAAE,CAAC;QAC3B,cAAc,CAAC,eAAe,GAAG,oBAAoB,CAAC,eAAe,CAAC,CAAC;IACzE,CAAC;IAED,OAAO,cAAc,CAAC;AACxB,CAAC","sourcesContent":["import type { PackageJsonExports } from '@ms-cloudpack/common-types';\nimport { mergeObjects } from '@ms-cloudpack/package-utilities';\nimport { satisfies } from 'semver';\nimport { mergePackageSettings } from '../packageSettings/mergePackageSettings.js';\nimport { builtInSettings, type BuiltInSettings } from './builtInSettings.js';\n\n/**\n * Get any applicable built-in settings for the given package name and version.\n *\n * NOTE: This should usually not be called directly from outside the `@ms-cloudpack/config` package.\n * It's just exported so tests can check their assumptions about what built-in settings exist.\n */\nexport function getBuiltInSettings(params: { name: string; version: string | undefined }): BuiltInSettings | undefined {\n const { name, version } = params;\n if (!version) {\n return undefined;\n }\n\n // As of writing, there should be at most one matching setting, but find all of them\n // and handle merging just to be safe.\n const matchingSettings = Object.entries(builtInSettings[name] || {})\n .filter(([range]) => satisfies(version, range))\n .map(([, setting]) => setting);\n\n if (!matchingSettings.length) {\n return undefined;\n }\n\n const mergedSettings: BuiltInSettings = {};\n\n const packageJsons = matchingSettings\n .map((s) => s.packageJson)\n .filter((s): s is NonNullable<BuiltInSettings['packageJson']> => !!s);\n if (packageJsons.length) {\n mergedSettings.packageJson = mergeObjects(packageJsons);\n if (mergedSettings.packageJson.exports) {\n // Currently, some of the cloudpack code can potentially mutate package.json `exports`.\n // Copy the object to avoid accidentally mutating the constant.\n mergedSettings.packageJson.exports = JSON.parse(\n JSON.stringify(mergedSettings.packageJson.exports),\n ) as PackageJsonExports;\n }\n }\n\n const packageSettings = matchingSettings\n .map((s) => s.packageSettings)\n .filter((s): s is NonNullable<BuiltInSettings['packageSettings']> => !!s);\n if (packageSettings.length) {\n mergedSettings.packageSettings = mergePackageSettings(packageSettings);\n }\n\n return mergedSettings;\n}\n"]}
@@ -6,4 +6,10 @@ export declare const userPreferencesFileName = ".cloudpack.preferences.json";
6
6
  * Object with descriptions of each user preference key.
7
7
  */
8
8
  export declare const allUserPreferences: Readonly<Record<keyof UserPreferences, string>>;
9
+ /** unpkg URL for the GeneratedConfig JSON schema */
10
+ export declare const generatedAppConfigSchemaUrl = "https://unpkg.com/@ms-cloudpack/common-types/schema/GeneratedConfig.json";
11
+ /** unpkg URL for the AppConfig JSON schema */
12
+ export declare const appConfigSchemaUrl = "https://unpkg.com/@ms-cloudpack/common-types/schema/AppConfig.json";
13
+ /** unpkg URL for the UserPreferences JSON schema */
14
+ export declare const userPreferencesSchemaUrl = "https://unpkg.com/@ms-cloudpack/common-types/schema/UserPreferences.json";
9
15
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,eAAO,MAAM,iBAAiB,0BAA0B,CAAC;AACzD,eAAO,MAAM,uBAAuB,6BAA6B,CAAC;AAClE,eAAO,MAAM,uBAAuB,gCAAgC,CAAC;AAErE;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,eAAe,EAAE,MAAM,CAAC,CAE9E,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,eAAO,MAAM,iBAAiB,0BAA0B,CAAC;AACzD,eAAO,MAAM,uBAAuB,6BAA6B,CAAC;AAClE,eAAO,MAAM,uBAAuB,gCAAgC,CAAC;AAErE;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,eAAe,EAAE,MAAM,CAAC,CAE9E,CAAC;AAIF,oDAAoD;AACpD,eAAO,MAAM,2BAA2B,6EAAyC,CAAC;AAElF,8CAA8C;AAC9C,eAAO,MAAM,kBAAkB,uEAAmC,CAAC;AAEnE,oDAAoD;AACpD,eAAO,MAAM,wBAAwB,6EAAyC,CAAC"}
package/lib/constants.js CHANGED
@@ -7,4 +7,11 @@ export const userPreferencesFileName = '.cloudpack.preferences.json';
7
7
  export const allUserPreferences = {
8
8
  cachePath: 'Absolute path to the cache folder, instead of the default <home>/.cloudpack',
9
9
  };
10
+ const schemaPrefix = 'https://unpkg.com/@ms-cloudpack/common-types/schema';
11
+ /** unpkg URL for the GeneratedConfig JSON schema */
12
+ export const generatedAppConfigSchemaUrl = `${schemaPrefix}/GeneratedConfig.json`;
13
+ /** unpkg URL for the AppConfig JSON schema */
14
+ export const appConfigSchemaUrl = `${schemaPrefix}/AppConfig.json`;
15
+ /** unpkg URL for the UserPreferences JSON schema */
16
+ export const userPreferencesSchemaUrl = `${schemaPrefix}/UserPreferences.json`;
10
17
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,iBAAiB,GAAG,uBAAuB,CAAC;AACzD,MAAM,CAAC,MAAM,uBAAuB,GAAG,0BAA0B,CAAC;AAClE,MAAM,CAAC,MAAM,uBAAuB,GAAG,6BAA6B,CAAC;AAErE;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAoD;IACjF,SAAS,EAAE,6EAA6E;CACzF,CAAC","sourcesContent":["import type { UserPreferences } from '@ms-cloudpack/common-types';\n\nexport const appConfigFileName = 'cloudpack.config.json';\nexport const generatedConfigFileName = 'cloudpack.generated.json';\nexport const userPreferencesFileName = '.cloudpack.preferences.json';\n\n/**\n * Object with descriptions of each user preference key.\n */\nexport const allUserPreferences: Readonly<Record<keyof UserPreferences, string>> = {\n cachePath: 'Absolute path to the cache folder, instead of the default <home>/.cloudpack',\n};\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,iBAAiB,GAAG,uBAAuB,CAAC;AACzD,MAAM,CAAC,MAAM,uBAAuB,GAAG,0BAA0B,CAAC;AAClE,MAAM,CAAC,MAAM,uBAAuB,GAAG,6BAA6B,CAAC;AAErE;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAoD;IACjF,SAAS,EAAE,6EAA6E;CACzF,CAAC;AAEF,MAAM,YAAY,GAAG,qDAAqD,CAAC;AAE3E,oDAAoD;AACpD,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,YAAY,uBAAuB,CAAC;AAElF,8CAA8C;AAC9C,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,YAAY,iBAAiB,CAAC;AAEnE,oDAAoD;AACpD,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,YAAY,uBAAuB,CAAC","sourcesContent":["import type { UserPreferences } from '@ms-cloudpack/common-types';\n\nexport const appConfigFileName = 'cloudpack.config.json';\nexport const generatedConfigFileName = 'cloudpack.generated.json';\nexport const userPreferencesFileName = '.cloudpack.preferences.json';\n\n/**\n * Object with descriptions of each user preference key.\n */\nexport const allUserPreferences: Readonly<Record<keyof UserPreferences, string>> = {\n cachePath: 'Absolute path to the cache folder, instead of the default <home>/.cloudpack',\n};\n\nconst schemaPrefix = 'https://unpkg.com/@ms-cloudpack/common-types/schema';\n\n/** unpkg URL for the GeneratedConfig JSON schema */\nexport const generatedAppConfigSchemaUrl = `${schemaPrefix}/GeneratedConfig.json`;\n\n/** unpkg URL for the AppConfig JSON schema */\nexport const appConfigSchemaUrl = `${schemaPrefix}/AppConfig.json`;\n\n/** unpkg URL for the UserPreferences JSON schema */\nexport const userPreferencesSchemaUrl = `${schemaPrefix}/UserPreferences.json`;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"getConfigPath.d.ts","sourceRoot":"","sources":["../src/getConfigPath.ts"],"names":[],"mappings":"AAGA;;;GAGG;AAEH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM;;;EAKxC"}
1
+ {"version":3,"file":"getConfigPath.d.ts","sourceRoot":"","sources":["../src/getConfigPath.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM;;;EAKxC"}
@@ -1 +1 @@
1
- {"version":3,"file":"getConfigPath.js","sourceRoot":"","sources":["../src/getConfigPath.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAE5E;;;GAGG;AAEH,MAAM,UAAU,aAAa,CAAC,GAAW;IACvC,OAAO;QACL,aAAa,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,iBAAiB,CAAC;QAChD,mBAAmB,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,uBAAuB,CAAC;KAC7D,CAAC;AACJ,CAAC","sourcesContent":["import path from 'path';\nimport { appConfigFileName, generatedConfigFileName } from './constants.js';\n\n/**\n * @param cwd - base path of the config file\n * @returns the path of the config file\n */\n\nexport function getConfigPath(cwd: string) {\n return {\n appConfigPath: path.join(cwd, appConfigFileName),\n generatedConfigPath: path.join(cwd, generatedConfigFileName),\n };\n}\n"]}
1
+ {"version":3,"file":"getConfigPath.js","sourceRoot":"","sources":["../src/getConfigPath.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAE5E;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,GAAW;IACvC,OAAO;QACL,aAAa,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,iBAAiB,CAAC;QAChD,mBAAmB,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,uBAAuB,CAAC;KAC7D,CAAC;AACJ,CAAC","sourcesContent":["import path from 'path';\nimport { appConfigFileName, generatedConfigFileName } from './constants.js';\n\n/**\n * @param cwd - base path of the config file\n * @returns the path of the config file\n */\nexport function getConfigPath(cwd: string) {\n return {\n appConfigPath: path.join(cwd, appConfigFileName),\n generatedConfigPath: path.join(cwd, generatedConfigFileName),\n };\n}\n"]}
package/lib/index.d.ts CHANGED
@@ -1,20 +1,21 @@
1
- export { checkMatch } from './checkMatch.js';
2
- export { configTemplate } from './configTemplate.js';
1
+ export { checkMatch } from './packageSettings/checkMatch.js';
2
+ export { ensureAppConfig } from './writeConfig/ensureAppConfig.js';
3
+ export { getBuiltInSettings } from './builtInSettings/getBuiltInSettings.js';
3
4
  export { generatedConfigFileName, appConfigFileName } from './constants.js';
4
5
  export { allUserPreferences } from './constants.js';
5
- export { createPackageDefinitions } from './createPackageDefinitions.js';
6
- export { getCachePath, getLocalCachePath } from './getCachePath.js';
6
+ export { createPackageDefinitions } from './packageDefinitions/createPackageDefinitions.js';
7
+ export { getCachePath, getLocalCachePath } from './userPreferences/getCachePath.js';
7
8
  export { getConfigPath } from './getConfigPath.js';
8
- export { getUserPreferencesPath, setMockUserPreferencesDir } from './getUserPreferencesPath.js';
9
- export { getPackageSettings } from './getPackageSettings.js';
10
- export { getGeneratedPackageSettings } from './getGeneratedPackageSettings.js';
11
- export { readConfig, type ReadConfigOptions } from './readConfig.js';
12
- export { readGeneratedConfig } from './readGeneratedConfig.js';
13
- export { readAppConfig } from './readAppConfig.js';
14
- export { readUserPreferences } from './readUserPreferences.js';
15
- export { writeGeneratedConfig } from './writeGeneratedConfig.js';
16
- export { writeAppConfig } from './writeAppConfig.js';
17
- export { ensureGeneratedSettingsForPackage } from './ensureGeneratedSettingsForPackage.js';
18
- export { updateUserPreference } from './updateUserPreference.js';
19
- export { validateMatch } from './validateMatch.js';
9
+ export { getUserPreferencesPath, setMockUserPreferencesDir } from './userPreferences/getUserPreferencesPath.js';
10
+ export { getPackageSettings } from './packageSettings/getPackageSettings.js';
11
+ export { getGeneratedPackageSettings } from './packageSettings/getGeneratedPackageSettings.js';
12
+ export { readConfig, type ReadConfigOptions } from './readConfig/readConfig.js';
13
+ export { readGeneratedConfig } from './readConfig/readGeneratedConfig.js';
14
+ export { readAppConfig } from './readConfig/readAppConfig.js';
15
+ export { readUserPreferences } from './userPreferences/readUserPreferences.js';
16
+ export { writeGeneratedConfig } from './writeConfig/writeGeneratedConfig.js';
17
+ export { writeAppConfig } from './writeConfig/writeAppConfig.js';
18
+ export { ensureGeneratedSettingsForPackage } from './packageSettings/ensureGeneratedSettingsForPackage.js';
19
+ export { updateUserPreference } from './userPreferences/updateUserPreference.js';
20
+ export { validateMatch } from './packageSettings/validateMatch.js';
20
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAChG,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,iCAAiC,EAAE,MAAM,wCAAwC,CAAC;AAC3F,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,kDAAkD,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AAChH,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,2BAA2B,EAAE,MAAM,kDAAkD,CAAC;AAC/F,OAAO,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,iCAAiC,EAAE,MAAM,wDAAwD,CAAC;AAC3G,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC"}
package/lib/index.js CHANGED
@@ -1,20 +1,21 @@
1
- export { checkMatch } from './checkMatch.js';
2
- export { configTemplate } from './configTemplate.js';
1
+ export { checkMatch } from './packageSettings/checkMatch.js';
2
+ export { ensureAppConfig } from './writeConfig/ensureAppConfig.js';
3
+ export { getBuiltInSettings } from './builtInSettings/getBuiltInSettings.js';
3
4
  export { generatedConfigFileName, appConfigFileName } from './constants.js';
4
5
  export { allUserPreferences } from './constants.js';
5
- export { createPackageDefinitions } from './createPackageDefinitions.js';
6
- export { getCachePath, getLocalCachePath } from './getCachePath.js';
6
+ export { createPackageDefinitions } from './packageDefinitions/createPackageDefinitions.js';
7
+ export { getCachePath, getLocalCachePath } from './userPreferences/getCachePath.js';
7
8
  export { getConfigPath } from './getConfigPath.js';
8
- export { getUserPreferencesPath, setMockUserPreferencesDir } from './getUserPreferencesPath.js';
9
- export { getPackageSettings } from './getPackageSettings.js';
10
- export { getGeneratedPackageSettings } from './getGeneratedPackageSettings.js';
11
- export { readConfig } from './readConfig.js';
12
- export { readGeneratedConfig } from './readGeneratedConfig.js';
13
- export { readAppConfig } from './readAppConfig.js';
14
- export { readUserPreferences } from './readUserPreferences.js';
15
- export { writeGeneratedConfig } from './writeGeneratedConfig.js';
16
- export { writeAppConfig } from './writeAppConfig.js';
17
- export { ensureGeneratedSettingsForPackage } from './ensureGeneratedSettingsForPackage.js';
18
- export { updateUserPreference } from './updateUserPreference.js';
19
- export { validateMatch } from './validateMatch.js';
9
+ export { getUserPreferencesPath, setMockUserPreferencesDir } from './userPreferences/getUserPreferencesPath.js';
10
+ export { getPackageSettings } from './packageSettings/getPackageSettings.js';
11
+ export { getGeneratedPackageSettings } from './packageSettings/getGeneratedPackageSettings.js';
12
+ export { readConfig } from './readConfig/readConfig.js';
13
+ export { readGeneratedConfig } from './readConfig/readGeneratedConfig.js';
14
+ export { readAppConfig } from './readConfig/readAppConfig.js';
15
+ export { readUserPreferences } from './userPreferences/readUserPreferences.js';
16
+ export { writeGeneratedConfig } from './writeConfig/writeGeneratedConfig.js';
17
+ export { writeAppConfig } from './writeConfig/writeAppConfig.js';
18
+ export { ensureGeneratedSettingsForPackage } from './packageSettings/ensureGeneratedSettingsForPackage.js';
19
+ export { updateUserPreference } from './userPreferences/updateUserPreference.js';
20
+ export { validateMatch } from './packageSettings/validateMatch.js';
20
21
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAChG,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,UAAU,EAA0B,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,iCAAiC,EAAE,MAAM,wCAAwC,CAAC;AAC3F,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["export { checkMatch } from './checkMatch.js';\nexport { configTemplate } from './configTemplate.js';\nexport { generatedConfigFileName, appConfigFileName } from './constants.js';\nexport { allUserPreferences } from './constants.js';\nexport { createPackageDefinitions } from './createPackageDefinitions.js';\nexport { getCachePath, getLocalCachePath } from './getCachePath.js';\nexport { getConfigPath } from './getConfigPath.js';\nexport { getUserPreferencesPath, setMockUserPreferencesDir } from './getUserPreferencesPath.js';\nexport { getPackageSettings } from './getPackageSettings.js';\nexport { getGeneratedPackageSettings } from './getGeneratedPackageSettings.js';\nexport { readConfig, type ReadConfigOptions } from './readConfig.js';\nexport { readGeneratedConfig } from './readGeneratedConfig.js';\nexport { readAppConfig } from './readAppConfig.js';\nexport { readUserPreferences } from './readUserPreferences.js';\nexport { writeGeneratedConfig } from './writeGeneratedConfig.js';\nexport { writeAppConfig } from './writeAppConfig.js';\nexport { ensureGeneratedSettingsForPackage } from './ensureGeneratedSettingsForPackage.js';\nexport { updateUserPreference } from './updateUserPreference.js';\nexport { validateMatch } from './validateMatch.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,kDAAkD,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AAChH,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,2BAA2B,EAAE,MAAM,kDAAkD,CAAC;AAC/F,OAAO,EAAE,UAAU,EAA0B,MAAM,4BAA4B,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,iCAAiC,EAAE,MAAM,wDAAwD,CAAC;AAC3G,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC","sourcesContent":["export { checkMatch } from './packageSettings/checkMatch.js';\nexport { ensureAppConfig } from './writeConfig/ensureAppConfig.js';\nexport { getBuiltInSettings } from './builtInSettings/getBuiltInSettings.js';\nexport { generatedConfigFileName, appConfigFileName } from './constants.js';\nexport { allUserPreferences } from './constants.js';\nexport { createPackageDefinitions } from './packageDefinitions/createPackageDefinitions.js';\nexport { getCachePath, getLocalCachePath } from './userPreferences/getCachePath.js';\nexport { getConfigPath } from './getConfigPath.js';\nexport { getUserPreferencesPath, setMockUserPreferencesDir } from './userPreferences/getUserPreferencesPath.js';\nexport { getPackageSettings } from './packageSettings/getPackageSettings.js';\nexport { getGeneratedPackageSettings } from './packageSettings/getGeneratedPackageSettings.js';\nexport { readConfig, type ReadConfigOptions } from './readConfig/readConfig.js';\nexport { readGeneratedConfig } from './readConfig/readGeneratedConfig.js';\nexport { readAppConfig } from './readConfig/readAppConfig.js';\nexport { readUserPreferences } from './userPreferences/readUserPreferences.js';\nexport { writeGeneratedConfig } from './writeConfig/writeGeneratedConfig.js';\nexport { writeAppConfig } from './writeConfig/writeAppConfig.js';\nexport { ensureGeneratedSettingsForPackage } from './packageSettings/ensureGeneratedSettingsForPackage.js';\nexport { updateUserPreference } from './userPreferences/updateUserPreference.js';\nexport { validateMatch } from './packageSettings/validateMatch.js';\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createPackageDefinitions.d.ts","sourceRoot":"","sources":["../../src/packageDefinitions/createPackageDefinitions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAK3F;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE;IAAE,MAAM,EAAE,eAAe,CAAA;CAAE,GAAG,uBAAuB,CAQrG"}
@@ -1,5 +1,6 @@
1
1
  import { PackageDefinitions } from '@ms-cloudpack/package-utilities';
2
2
  import { createPackageSettingsTransform } from './createPackageSettingsTransform.js';
3
+ import { createBuiltInSettingsTransform } from '../builtInSettings/createBuiltInSettingsTransform.js';
3
4
  /**
4
5
  * Given a Cloudpack config, create a package definitions cache with transforms resulting from settings defined
5
6
  * within the config.
@@ -7,6 +8,7 @@ import { createPackageSettingsTransform } from './createPackageSettingsTransform
7
8
  export function createPackageDefinitions(params) {
8
9
  const { config } = params;
9
10
  const packages = new PackageDefinitions(undefined, config);
11
+ packages.registerTransform(() => createBuiltInSettingsTransform());
10
12
  packages.registerTransform((newConfig) => (newConfig ? createPackageSettingsTransform(newConfig) : () => undefined));
11
13
  return packages;
12
14
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createPackageDefinitions.js","sourceRoot":"","sources":["../../src/packageDefinitions/createPackageDefinitions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AACrF,OAAO,EAAE,8BAA8B,EAAE,MAAM,sDAAsD,CAAC;AAEtG;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CAAC,MAAmC;IAC1E,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IAC1B,MAAM,QAAQ,GAAG,IAAI,kBAAkB,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAE3D,QAAQ,CAAC,iBAAiB,CAAC,GAAG,EAAE,CAAC,8BAA8B,EAAE,CAAC,CAAC;IACnE,QAAQ,CAAC,iBAAiB,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,8BAA8B,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAErH,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["import type { CloudpackConfig, PackageDefinitionsCache } from '@ms-cloudpack/common-types';\nimport { PackageDefinitions } from '@ms-cloudpack/package-utilities';\nimport { createPackageSettingsTransform } from './createPackageSettingsTransform.js';\nimport { createBuiltInSettingsTransform } from '../builtInSettings/createBuiltInSettingsTransform.js';\n\n/**\n * Given a Cloudpack config, create a package definitions cache with transforms resulting from settings defined\n * within the config.\n */\nexport function createPackageDefinitions(params: { config: CloudpackConfig }): PackageDefinitionsCache {\n const { config } = params;\n const packages = new PackageDefinitions(undefined, config);\n\n packages.registerTransform(() => createBuiltInSettingsTransform());\n packages.registerTransform((newConfig) => (newConfig ? createPackageSettingsTransform(newConfig) : () => undefined));\n\n return packages;\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createPackageSettingsTransform.d.ts","sourceRoot":"","sources":["../../src/packageDefinitions/createPackageSettingsTransform.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,0BAA0B,EAO3B,MAAM,4BAA4B,CAAC;AAMpC;;;GAGG;AACH,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,eAAe,GAAG,0BAA0B,CAgDlG"}
@@ -1,7 +1,7 @@
1
1
  import { addExportsMapEntry, getExportsMap } from '@ms-cloudpack/package-utilities';
2
2
  import { slash } from '@ms-cloudpack/path-string-parsing';
3
- import { getPackageSettings } from './getPackageSettings.js';
4
- import { mergePackageSettings } from './mergePackageSettings.js';
3
+ import { getPackageSettings } from '../packageSettings/getPackageSettings.js';
4
+ import { mergePackageSettings } from '../packageSettings/mergePackageSettings.js';
5
5
  /**
6
6
  * Creates a transform to be registered with a PackageDefinitions registry for updating package.json
7
7
  * based on package settings from the config.
@@ -13,6 +13,7 @@ export function createPackageSettingsTransform(config) {
13
13
  name,
14
14
  version,
15
15
  userPackageSettings: config.packageSettings,
16
+ includeBuiltIn: true,
16
17
  generatedPackageSettings: config.generated.packageSettings,
17
18
  });
18
19
  // Exclude all things not important in preserving within the package.json.
@@ -27,7 +28,7 @@ export function createPackageSettingsTransform(config) {
27
28
  name,
28
29
  version,
29
30
  exports: await computeExports({ packagePath, definition, userPackageSettings, generatedPackageSettings }, { packages, config }),
30
- dependencies: computeDependencies({ definition, userPackageSettings, generatedPackageSettings }),
31
+ dependencies: computeDependencies({ definition, includedDependencies, excludedDependencies }),
31
32
  };
32
33
  if (definition.peerDependencies && !userPackageSettings?.excludedDependencies?.includes('$peerDependencies')) {
33
34
  newDefinition.peerDependencies = !excludedDependencies?.length
@@ -44,14 +45,11 @@ export function createPackageSettingsTransform(config) {
44
45
  };
45
46
  }
46
47
  function computeDependencies(options) {
47
- const { definition, userPackageSettings, generatedPackageSettings } = options;
48
+ const { definition } = options;
48
49
  const { dependencies = {} } = definition;
49
50
  const newDependencies = { ...dependencies };
50
51
  // If we have included dependencies, add them.
51
- const includedDependencies = [
52
- ...(userPackageSettings?.includedDependencies || []),
53
- ...(generatedPackageSettings?.includedDependencies || []),
54
- ];
52
+ const includedDependencies = [...(options.includedDependencies || [])];
55
53
  // Expand the $devDependencies placeholder to the actual dev dependencies.
56
54
  const includeDevDependencies = includedDependencies.indexOf('$devDependencies');
57
55
  if (includeDevDependencies !== -1) {
@@ -66,10 +64,7 @@ function computeDependencies(options) {
66
64
  definition.optionalDependencies?.[dep] ||
67
65
  '*';
68
66
  }
69
- const excludedDependencies = [
70
- ...(userPackageSettings?.excludedDependencies || []),
71
- ...(generatedPackageSettings?.excludedDependencies || []),
72
- ];
67
+ const excludedDependencies = [...(options.excludedDependencies || [])];
73
68
  // Expand the $peerDependencies placeholder to the actual peer dependencies.
74
69
  const excludePeerDependencies = excludedDependencies.indexOf('$peerDependencies');
75
70
  if (excludePeerDependencies !== -1) {
@@ -84,8 +79,6 @@ function computeDependencies(options) {
84
79
  async function computeExports(options, context) {
85
80
  const { packagePath, definition, userPackageSettings, generatedPackageSettings } = options;
86
81
  const { appPath, routes } = context.config;
87
- // TODO: an array of export objects is not really valid per the spec and most implementations
88
- const exports = [];
89
82
  // If this is the app package and it has routes with entries, use those to create the exports map.
90
83
  if (slash(appPath) === slash(packagePath) && routes?.length) {
91
84
  const routeExports = {};
@@ -109,6 +102,8 @@ async function computeExports(options, context) {
109
102
  return routeExports;
110
103
  }
111
104
  }
105
+ // TODO: an array of export objects is not really valid per the spec and most implementations
106
+ const exports = [];
112
107
  // Push exports from the package.
113
108
  if (userPackageSettings?.exports !== undefined) {
114
109
  // Prefer user settings over the original definition, including respecting null (remove exports).