@ms-cloudpack/config 0.19.7 → 0.20.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 (40) hide show
  1. package/lib/configTemplate.d.ts +2 -2
  2. package/lib/configTemplate.d.ts.map +1 -1
  3. package/lib/configTemplate.js.map +1 -1
  4. package/lib/constants.d.ts +1 -1
  5. package/lib/constants.d.ts.map +1 -1
  6. package/lib/constants.js +1 -1
  7. package/lib/constants.js.map +1 -1
  8. package/lib/getConfigPath.d.ts +1 -1
  9. package/lib/getConfigPath.js +2 -2
  10. package/lib/getConfigPath.js.map +1 -1
  11. package/lib/index.d.ts +3 -3
  12. package/lib/index.d.ts.map +1 -1
  13. package/lib/index.js +3 -3
  14. package/lib/index.js.map +1 -1
  15. package/lib/mergeParentConfig.d.ts +4 -4
  16. package/lib/mergeParentConfig.d.ts.map +1 -1
  17. package/lib/mergeParentConfig.js +1 -1
  18. package/lib/mergeParentConfig.js.map +1 -1
  19. package/lib/{readUserConfig.d.ts → readAppConfig.d.ts} +3 -3
  20. package/lib/readAppConfig.d.ts.map +1 -0
  21. package/lib/{readUserConfig.js → readAppConfig.js} +13 -13
  22. package/lib/readAppConfig.js.map +1 -0
  23. package/lib/readConfig.js +3 -3
  24. package/lib/readConfig.js.map +1 -1
  25. package/lib/schemaUrls.d.ts +3 -3
  26. package/lib/schemaUrls.d.ts.map +1 -1
  27. package/lib/schemaUrls.js +3 -3
  28. package/lib/schemaUrls.js.map +1 -1
  29. package/lib/writeAppConfig.d.ts +7 -0
  30. package/lib/writeAppConfig.d.ts.map +1 -0
  31. package/lib/{writeUserConfig.js → writeAppConfig.js} +6 -6
  32. package/lib/writeAppConfig.js.map +1 -0
  33. package/lib/writeGeneratedConfig.js +2 -2
  34. package/lib/writeGeneratedConfig.js.map +1 -1
  35. package/package.json +3 -3
  36. package/lib/readUserConfig.d.ts.map +0 -1
  37. package/lib/readUserConfig.js.map +0 -1
  38. package/lib/writeUserConfig.d.ts +0 -7
  39. package/lib/writeUserConfig.d.ts.map +0 -1
  40. package/lib/writeUserConfig.js.map +0 -1
@@ -1,3 +1,3 @@
1
- import type { UserConfig } from '@ms-cloudpack/common-types';
2
- export declare const configTemplate: UserConfig;
1
+ import type { AppConfig } from '@ms-cloudpack/common-types';
2
+ export declare const configTemplate: AppConfig;
3
3
  //# sourceMappingURL=configTemplate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"configTemplate.d.ts","sourceRoot":"","sources":["../src/configTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAE7D,eAAO,MAAM,cAAc,EAAE,UAuB5B,CAAC"}
1
+ {"version":3,"file":"configTemplate.d.ts","sourceRoot":"","sources":["../src/configTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAE5D,eAAO,MAAM,cAAc,EAAE,SAuB5B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"configTemplate.js","sourceRoot":"","sources":["../src/configTemplate.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAe;IACxC,eAAe,EAAE;QACf;YACE,KAAK,EAAE;gBACL,IAAI,EAAE,cAAc;gBACpB,OAAO,EAAE,GAAG;aACb;YAED,OAAO,EAAE;gBACP,GAAG,EAAE,YAAY;gBACjB,QAAQ,EAAE,WAAW;gBACrB,cAAc,EAAE,iBAAiB;aAClC;YAED,mBAAmB,EAAE,EAAE;YAEvB,oBAAoB,EAAE,EAAE;YACxB,oBAAoB,EAAE,EAAE;YAExB,WAAW,EAAE,SAAS;YACtB,cAAc,EAAE,SAAS;SAC1B;KACF;CACF,CAAC","sourcesContent":["import type { UserConfig } from '@ms-cloudpack/common-types';\n\nexport const configTemplate: UserConfig = {\n packageSettings: [\n {\n match: {\n name: 'package-name',\n version: '*',\n },\n\n exports: {\n '.': './index.js',\n './path': './path.js',\n './other-path': './other-path.js',\n },\n\n inlinedDependencies: [],\n\n includedDependencies: [],\n excludedDependencies: [],\n\n bundlerType: undefined,\n bundlerOptions: undefined,\n },\n ],\n};\n"]}
1
+ {"version":3,"file":"configTemplate.js","sourceRoot":"","sources":["../src/configTemplate.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAc;IACvC,eAAe,EAAE;QACf;YACE,KAAK,EAAE;gBACL,IAAI,EAAE,cAAc;gBACpB,OAAO,EAAE,GAAG;aACb;YAED,OAAO,EAAE;gBACP,GAAG,EAAE,YAAY;gBACjB,QAAQ,EAAE,WAAW;gBACrB,cAAc,EAAE,iBAAiB;aAClC;YAED,mBAAmB,EAAE,EAAE;YAEvB,oBAAoB,EAAE,EAAE;YACxB,oBAAoB,EAAE,EAAE;YAExB,WAAW,EAAE,SAAS;YACtB,cAAc,EAAE,SAAS;SAC1B;KACF;CACF,CAAC","sourcesContent":["import type { AppConfig } from '@ms-cloudpack/common-types';\n\nexport const configTemplate: AppConfig = {\n packageSettings: [\n {\n match: {\n name: 'package-name',\n version: '*',\n },\n\n exports: {\n '.': './index.js',\n './path': './path.js',\n './other-path': './other-path.js',\n },\n\n inlinedDependencies: [],\n\n includedDependencies: [],\n excludedDependencies: [],\n\n bundlerType: undefined,\n bundlerOptions: undefined,\n },\n ],\n};\n"]}
@@ -1,3 +1,3 @@
1
- export declare const userConfigFileName = "cloudpack.config.json";
1
+ export declare const appConfigFileName = "cloudpack.config.json";
2
2
  export declare const generatedConfigFileName = "cloudpack.generated.json";
3
3
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,0BAA0B,CAAC;AAC1D,eAAO,MAAM,uBAAuB,6BAA6B,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,0BAA0B,CAAC;AACzD,eAAO,MAAM,uBAAuB,6BAA6B,CAAC"}
package/lib/constants.js CHANGED
@@ -1,3 +1,3 @@
1
- export const userConfigFileName = 'cloudpack.config.json';
1
+ export const appConfigFileName = 'cloudpack.config.json';
2
2
  export const generatedConfigFileName = 'cloudpack.generated.json';
3
3
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG,uBAAuB,CAAC;AAC1D,MAAM,CAAC,MAAM,uBAAuB,GAAG,0BAA0B,CAAC","sourcesContent":["export const userConfigFileName = 'cloudpack.config.json';\nexport const generatedConfigFileName = 'cloudpack.generated.json';\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG,uBAAuB,CAAC;AACzD,MAAM,CAAC,MAAM,uBAAuB,GAAG,0BAA0B,CAAC","sourcesContent":["export const appConfigFileName = 'cloudpack.config.json';\nexport const generatedConfigFileName = 'cloudpack.generated.json';\n"]}
@@ -3,7 +3,7 @@
3
3
  * @returns the path of the config file
4
4
  */
5
5
  export declare function getConfigPath(cwd: string): {
6
- userConfigPath: string;
6
+ appConfigPath: string;
7
7
  generatedConfigPath: string;
8
8
  };
9
9
  //# sourceMappingURL=getConfigPath.d.ts.map
@@ -1,12 +1,12 @@
1
1
  import path from 'path';
2
- import { userConfigFileName, generatedConfigFileName } from './constants.js';
2
+ import { appConfigFileName, generatedConfigFileName } from './constants.js';
3
3
  /**
4
4
  * @param cwd - base path of the config file
5
5
  * @returns the path of the config file
6
6
  */
7
7
  export function getConfigPath(cwd) {
8
8
  return {
9
- userConfigPath: path.join(cwd, userConfigFileName),
9
+ appConfigPath: path.join(cwd, appConfigFileName),
10
10
  generatedConfigPath: path.join(cwd, generatedConfigFileName),
11
11
  };
12
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"getConfigPath.js","sourceRoot":"","sources":["../src/getConfigPath.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAE7E;;;GAGG;AAEH,MAAM,UAAU,aAAa,CAAC,GAAW;IACvC,OAAO;QACL,cAAc,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,kBAAkB,CAAC;QAClD,mBAAmB,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,uBAAuB,CAAC;KAC7D,CAAC;AACJ,CAAC","sourcesContent":["import path from 'path';\nimport { userConfigFileName, 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 userConfigPath: path.join(cwd, userConfigFileName),\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;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"]}
package/lib/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  export { configTemplate } from './configTemplate.js';
2
- export { generatedConfigFileName, userConfigFileName } from './constants.js';
2
+ export { generatedConfigFileName, appConfigFileName } from './constants.js';
3
3
  export { createPackageDefinitions } from './createPackageDefinitions.js';
4
4
  export { getConfigPath } from './getConfigPath.js';
5
5
  export { getPackageSettings, checkMatch } from './getPackageSettings.js';
6
6
  export { readConfig } from './readConfig.js';
7
7
  export { readGeneratedConfig } from './readGeneratedConfig.js';
8
- export { readUserConfig } from './readUserConfig.js';
8
+ export { readAppConfig } from './readAppConfig.js';
9
9
  export { writeGeneratedConfig } from './writeGeneratedConfig.js';
10
- export { writeUserConfig } from './writeUserConfig.js';
10
+ export { writeAppConfig } from './writeAppConfig.js';
11
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
package/lib/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  export { configTemplate } from './configTemplate.js';
2
- export { generatedConfigFileName, userConfigFileName } from './constants.js';
2
+ export { generatedConfigFileName, appConfigFileName } from './constants.js';
3
3
  export { createPackageDefinitions } from './createPackageDefinitions.js';
4
4
  export { getConfigPath } from './getConfigPath.js';
5
5
  export { getPackageSettings, checkMatch } from './getPackageSettings.js';
6
6
  export { readConfig } from './readConfig.js';
7
7
  export { readGeneratedConfig } from './readGeneratedConfig.js';
8
- export { readUserConfig } from './readUserConfig.js';
8
+ export { readAppConfig } from './readAppConfig.js';
9
9
  export { writeGeneratedConfig } from './writeGeneratedConfig.js';
10
- export { writeUserConfig } from './writeUserConfig.js';
10
+ export { writeAppConfig } from './writeAppConfig.js';
11
11
  //# 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,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["export { configTemplate } from './configTemplate.js';\nexport { generatedConfigFileName, userConfigFileName } from './constants.js';\nexport { createPackageDefinitions } from './createPackageDefinitions.js';\nexport { getConfigPath } from './getConfigPath.js';\nexport { getPackageSettings, checkMatch } from './getPackageSettings.js';\nexport { readConfig } from './readConfig.js';\nexport { readGeneratedConfig } from './readGeneratedConfig.js';\nexport { readUserConfig } from './readUserConfig.js';\nexport { writeGeneratedConfig } from './writeGeneratedConfig.js';\nexport { writeUserConfig } from './writeUserConfig.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC","sourcesContent":["export { configTemplate } from './configTemplate.js';\nexport { generatedConfigFileName, appConfigFileName } from './constants.js';\nexport { createPackageDefinitions } from './createPackageDefinitions.js';\nexport { getConfigPath } from './getConfigPath.js';\nexport { getPackageSettings, checkMatch } from './getPackageSettings.js';\nexport { readConfig } from './readConfig.js';\nexport { readGeneratedConfig } from './readGeneratedConfig.js';\nexport { readAppConfig } from './readAppConfig.js';\nexport { writeGeneratedConfig } from './writeGeneratedConfig.js';\nexport { writeAppConfig } from './writeAppConfig.js';\n"]}
@@ -1,9 +1,9 @@
1
- import type { UserConfig } from '@ms-cloudpack/common-types';
1
+ import type { AppConfig } from '@ms-cloudpack/common-types';
2
2
  /**
3
3
  * Merge the configs. Later parent configs override earlier ones.
4
4
  */
5
5
  export declare function mergeParentConfig(params: {
6
- userConfig: UserConfig;
7
- parentConfigs: UserConfig[];
8
- }): UserConfig;
6
+ AppConfig: AppConfig;
7
+ parentConfigs: AppConfig[];
8
+ }): AppConfig;
9
9
  //# sourceMappingURL=mergeParentConfig.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mergeParentConfig.d.ts","sourceRoot":"","sources":["../src/mergeParentConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAG7D;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE;IAAE,UAAU,EAAE,UAAU,CAAC;IAAC,aAAa,EAAE,UAAU,EAAE,CAAA;CAAE,GAAG,UAAU,CAiB7G"}
1
+ {"version":3,"file":"mergeParentConfig.d.ts","sourceRoot":"","sources":["../src/mergeParentConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAG5D;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE;IAAE,SAAS,EAAE,SAAS,CAAC;IAAC,aAAa,EAAE,SAAS,EAAE,CAAA;CAAE,GAAG,SAAS,CAiBzG"}
@@ -3,7 +3,7 @@ import { recursive as recursiveMerge } from 'merge';
3
3
  * Merge the configs. Later parent configs override earlier ones.
4
4
  */
5
5
  export function mergeParentConfig(params) {
6
- const configs = [...params.parentConfigs, params.userConfig];
6
+ const configs = [...params.parentConfigs, params.AppConfig];
7
7
  // NOTE: This must merge into an empty object to avoid modifying the originals
8
8
  const result = recursiveMerge({}, ...configs);
9
9
  // Remove the extends property from the result
@@ -1 +1 @@
1
- {"version":3,"file":"mergeParentConfig.js","sourceRoot":"","sources":["../src/mergeParentConfig.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,IAAI,cAAc,EAAE,MAAM,OAAO,CAAC;AAEpD;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAA+D;IAC/F,MAAM,OAAO,GAAG,CAAC,GAAG,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;IAE7D,8EAA8E;IAC9E,MAAM,MAAM,GAAG,cAAc,CAAC,EAAE,EAAE,GAAG,OAAO,CAAe,CAAC;IAE5D,8CAA8C;IAC9C,OAAO,MAAM,CAAC,OAAO,CAAC;IAEtB,wFAAwF;IACxF,kEAAkE;IAClE,MAAM,eAAe,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,eAAe,IAAI,EAAE,CAAC,CAAC;IACjG,IAAI,eAAe,CAAC,MAAM,EAAE,CAAC;QAC3B,MAAM,CAAC,eAAe,GAAG,eAAe,CAAC;IAC3C,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import type { UserConfig } from '@ms-cloudpack/common-types';\nimport { recursive as recursiveMerge } from 'merge';\n\n/**\n * Merge the configs. Later parent configs override earlier ones.\n */\nexport function mergeParentConfig(params: { userConfig: UserConfig; parentConfigs: UserConfig[] }): UserConfig {\n const configs = [...params.parentConfigs, params.userConfig];\n\n // NOTE: This must merge into an empty object to avoid modifying the originals\n const result = recursiveMerge({}, ...configs) as UserConfig;\n\n // Remove the extends property from the result\n delete result.extends;\n\n // Concatenate the package settings. User config comes first here since order can matter\n // in some cases (and the user config should override the parent).\n const packageSettings = [...configs].reverse().flatMap((config) => config.packageSettings ?? []);\n if (packageSettings.length) {\n result.packageSettings = packageSettings;\n }\n\n return result;\n}\n"]}
1
+ {"version":3,"file":"mergeParentConfig.js","sourceRoot":"","sources":["../src/mergeParentConfig.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,IAAI,cAAc,EAAE,MAAM,OAAO,CAAC;AAEpD;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAA4D;IAC5F,MAAM,OAAO,GAAG,CAAC,GAAG,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;IAE5D,8EAA8E;IAC9E,MAAM,MAAM,GAAG,cAAc,CAAC,EAAE,EAAE,GAAG,OAAO,CAAc,CAAC;IAE3D,8CAA8C;IAC9C,OAAO,MAAM,CAAC,OAAO,CAAC;IAEtB,wFAAwF;IACxF,kEAAkE;IAClE,MAAM,eAAe,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,eAAe,IAAI,EAAE,CAAC,CAAC;IACjG,IAAI,eAAe,CAAC,MAAM,EAAE,CAAC;QAC3B,MAAM,CAAC,eAAe,GAAG,eAAe,CAAC;IAC3C,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import type { AppConfig } from '@ms-cloudpack/common-types';\nimport { recursive as recursiveMerge } from 'merge';\n\n/**\n * Merge the configs. Later parent configs override earlier ones.\n */\nexport function mergeParentConfig(params: { AppConfig: AppConfig; parentConfigs: AppConfig[] }): AppConfig {\n const configs = [...params.parentConfigs, params.AppConfig];\n\n // NOTE: This must merge into an empty object to avoid modifying the originals\n const result = recursiveMerge({}, ...configs) as AppConfig;\n\n // Remove the extends property from the result\n delete result.extends;\n\n // Concatenate the package settings. User config comes first here since order can matter\n // in some cases (and the user config should override the parent).\n const packageSettings = [...configs].reverse().flatMap((config) => config.packageSettings ?? []);\n if (packageSettings.length) {\n result.packageSettings = packageSettings;\n }\n\n return result;\n}\n"]}
@@ -1,7 +1,7 @@
1
- import type { UserConfig } from '@ms-cloudpack/common-types';
1
+ import type { AppConfig } from '@ms-cloudpack/common-types';
2
2
  /**
3
3
  * Reads the user config file and merges with any parent configs asynchronously. Note this is only useful for making modifications to the user config.
4
4
  * For a full merged representation of config, use `readConfig` instead.
5
5
  */
6
- export declare function readUserConfig(appPath: string): Promise<UserConfig>;
7
- //# sourceMappingURL=readUserConfig.d.ts.map
6
+ export declare function readAppConfig(appPath: string): Promise<AppConfig>;
7
+ //# sourceMappingURL=readAppConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readAppConfig.d.ts","sourceRoot":"","sources":["../src/readAppConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAoC5D;;;GAGG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAIvE"}
@@ -5,35 +5,35 @@ import { resolveParentConfig } from './resolveParentConfig.js';
5
5
  /**
6
6
  * Reads the user config, with any `extends` parent configs merged in.
7
7
  */
8
- async function readUserConfigInternal(configPath) {
9
- const userConfig = await readJson(configPath, { verbose: true, mode: 'permissive' });
10
- if (!userConfig) {
8
+ async function readAppConfigInternal(configPath) {
9
+ const AppConfig = await readJson(configPath, { verbose: true, mode: 'permissive' });
10
+ if (!AppConfig) {
11
11
  return undefined;
12
12
  }
13
- const extendsArray = userConfig.extends
14
- ? Array.isArray(userConfig.extends)
15
- ? userConfig.extends
16
- : [userConfig.extends]
13
+ const extendsArray = AppConfig.extends
14
+ ? Array.isArray(AppConfig.extends)
15
+ ? AppConfig.extends
16
+ : [AppConfig.extends]
17
17
  : [];
18
18
  // Recursively read any parent config files
19
19
  const parentConfigs = [];
20
20
  for (const importSpecifier of extendsArray) {
21
21
  const resolvedPath = resolveParentConfig({ configPath, importSpecifier });
22
22
  if (resolvedPath) {
23
- const parentConfig = await readUserConfigInternal(resolvedPath);
23
+ const parentConfig = await readAppConfigInternal(resolvedPath);
24
24
  if (parentConfig) {
25
25
  parentConfigs.push(parentConfig);
26
26
  }
27
27
  }
28
28
  }
29
- return mergeParentConfig({ userConfig, parentConfigs });
29
+ return mergeParentConfig({ AppConfig, parentConfigs });
30
30
  }
31
31
  /**
32
32
  * Reads the user config file and merges with any parent configs asynchronously. Note this is only useful for making modifications to the user config.
33
33
  * For a full merged representation of config, use `readConfig` instead.
34
34
  */
35
- export async function readUserConfig(appPath) {
36
- const { userConfigPath } = getConfigPath(appPath);
37
- return (await readUserConfigInternal(userConfigPath)) || {};
35
+ export async function readAppConfig(appPath) {
36
+ const { appConfigPath } = getConfigPath(appPath);
37
+ return (await readAppConfigInternal(appConfigPath)) || {};
38
38
  }
39
- //# sourceMappingURL=readUserConfig.js.map
39
+ //# sourceMappingURL=readAppConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readAppConfig.js","sourceRoot":"","sources":["../src/readAppConfig.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D;;GAEG;AACH,KAAK,UAAU,qBAAqB,CAAC,UAAkB;IACrD,MAAM,SAAS,GAAG,MAAM,QAAQ,CAAY,UAAU,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;IAC/F,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,YAAY,GAAG,SAAS,CAAC,OAAO;QACpC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC;YAChC,CAAC,CAAC,SAAS,CAAC,OAAO;YACnB,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC;QACvB,CAAC,CAAC,EAAE,CAAC;IAEP,2CAA2C;IAC3C,MAAM,aAAa,GAAgB,EAAE,CAAC;IACtC,KAAK,MAAM,eAAe,IAAI,YAAY,EAAE,CAAC;QAC3C,MAAM,YAAY,GAAG,mBAAmB,CAAC,EAAE,UAAU,EAAE,eAAe,EAAE,CAAC,CAAC;QAC1E,IAAI,YAAY,EAAE,CAAC;YACjB,MAAM,YAAY,GAAG,MAAM,qBAAqB,CAAC,YAAY,CAAC,CAAC;YAC/D,IAAI,YAAY,EAAE,CAAC;gBACjB,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YACnC,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,iBAAiB,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC,CAAC;AACzD,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,OAAe;IACjD,MAAM,EAAE,aAAa,EAAE,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;IAEjD,OAAO,CAAC,MAAM,qBAAqB,CAAC,aAAa,CAAC,CAAC,IAAI,EAAE,CAAC;AAC5D,CAAC","sourcesContent":["import type { AppConfig } from '@ms-cloudpack/common-types';\nimport { readJson } from '@ms-cloudpack/json-utilities';\nimport { getConfigPath } from './getConfigPath.js';\nimport { mergeParentConfig } from './mergeParentConfig.js';\nimport { resolveParentConfig } from './resolveParentConfig.js';\n\n/**\n * Reads the user config, with any `extends` parent configs merged in.\n */\nasync function readAppConfigInternal(configPath: string): Promise<AppConfig | undefined> {\n const AppConfig = await readJson<AppConfig>(configPath, { verbose: true, mode: 'permissive' });\n if (!AppConfig) {\n return undefined;\n }\n\n const extendsArray = AppConfig.extends\n ? Array.isArray(AppConfig.extends)\n ? AppConfig.extends\n : [AppConfig.extends]\n : [];\n\n // Recursively read any parent config files\n const parentConfigs: AppConfig[] = [];\n for (const importSpecifier of extendsArray) {\n const resolvedPath = resolveParentConfig({ configPath, importSpecifier });\n if (resolvedPath) {\n const parentConfig = await readAppConfigInternal(resolvedPath);\n if (parentConfig) {\n parentConfigs.push(parentConfig);\n }\n }\n }\n\n return mergeParentConfig({ AppConfig, parentConfigs });\n}\n\n/**\n * Reads the user config file and merges with any parent configs asynchronously. Note this is only useful for making modifications to the user config.\n * For a full merged representation of config, use `readConfig` instead.\n */\nexport async function readAppConfig(appPath: string): Promise<AppConfig> {\n const { appConfigPath } = getConfigPath(appPath);\n\n return (await readAppConfigInternal(appConfigPath)) || {};\n}\n"]}
package/lib/readConfig.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import { processConfig } from './processConfig.js';
2
- import { readUserConfig } from './readUserConfig.js';
2
+ import { readAppConfig } from './readAppConfig.js';
3
3
  import { readGeneratedConfig } from './readGeneratedConfig.js';
4
4
  /**
5
5
  * Reads the config file asynchronously (and merges generated config into the result.)
6
6
  */
7
7
  export async function readConfig(appPath) {
8
- const [userConfig, generatedConfig] = await Promise.all([readUserConfig(appPath), readGeneratedConfig(appPath)]);
8
+ const [AppConfig, generatedConfig] = await Promise.all([readAppConfig(appPath), readGeneratedConfig(appPath)]);
9
9
  const config = {
10
10
  generated: generatedConfig,
11
- ...userConfig,
11
+ ...AppConfig,
12
12
  };
13
13
  processConfig(config.generated);
14
14
  return config;
@@ -1 +1 @@
1
- {"version":3,"file":"readConfig.js","sourceRoot":"","sources":["../src/readConfig.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,OAAe;IAC9C,MAAM,CAAC,UAAU,EAAE,eAAe,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACjH,MAAM,MAAM,GAAoB;QAC9B,SAAS,EAAE,eAAe;QAC1B,GAAG,UAAU;KACd,CAAC;IAEF,aAAa,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAEhC,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import type { CloudpackConfig } from '@ms-cloudpack/common-types';\nimport { processConfig } from './processConfig.js';\nimport { readUserConfig } from './readUserConfig.js';\nimport { readGeneratedConfig } from './readGeneratedConfig.js';\n\n/**\n * Reads the config file asynchronously (and merges generated config into the result.)\n */\nexport async function readConfig(appPath: string): Promise<CloudpackConfig> {\n const [userConfig, generatedConfig] = await Promise.all([readUserConfig(appPath), readGeneratedConfig(appPath)]);\n const config: CloudpackConfig = {\n generated: generatedConfig,\n ...userConfig,\n };\n\n processConfig(config.generated);\n\n return config;\n}\n"]}
1
+ {"version":3,"file":"readConfig.js","sourceRoot":"","sources":["../src/readConfig.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,OAAe;IAC9C,MAAM,CAAC,SAAS,EAAE,eAAe,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC/G,MAAM,MAAM,GAAoB;QAC9B,SAAS,EAAE,eAAe;QAC1B,GAAG,SAAS;KACb,CAAC;IAEF,aAAa,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAEhC,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import type { CloudpackConfig } from '@ms-cloudpack/common-types';\nimport { processConfig } from './processConfig.js';\nimport { readAppConfig } from './readAppConfig.js';\nimport { readGeneratedConfig } from './readGeneratedConfig.js';\n\n/**\n * Reads the config file asynchronously (and merges generated config into the result.)\n */\nexport async function readConfig(appPath: string): Promise<CloudpackConfig> {\n const [AppConfig, generatedConfig] = await Promise.all([readAppConfig(appPath), readGeneratedConfig(appPath)]);\n const config: CloudpackConfig = {\n generated: generatedConfig,\n ...AppConfig,\n };\n\n processConfig(config.generated);\n\n return config;\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  /** unpkg URL for the GeneratedConfig JSON schema */
2
- export declare const generatedUserConfigSchemaUrl = "https://unpkg.com/@ms-cloudpack/common-types/schema/GeneratedConfig.json";
3
- /** unpkg URL for the UserConfig JSON schema */
4
- export declare const userConfigSchemaUrl = "https://unpkg.com/@ms-cloudpack/common-types/schema/UserConfig.json";
2
+ export declare const generatedAppConfigSchemaUrl = "https://unpkg.com/@ms-cloudpack/common-types/schema/GeneratedConfig.json";
3
+ /** unpkg URL for the AppConfig JSON schema */
4
+ export declare const appConfigSchemaUrl = "https://unpkg.com/@ms-cloudpack/common-types/schema/AppConfig.json";
5
5
  //# sourceMappingURL=schemaUrls.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schemaUrls.d.ts","sourceRoot":"","sources":["../src/schemaUrls.ts"],"names":[],"mappings":"AAEA,oDAAoD;AACpD,eAAO,MAAM,4BAA4B,6EAAyC,CAAC;AAEnF,+CAA+C;AAC/C,eAAO,MAAM,mBAAmB,wEAAoC,CAAC"}
1
+ {"version":3,"file":"schemaUrls.d.ts","sourceRoot":"","sources":["../src/schemaUrls.ts"],"names":[],"mappings":"AAEA,oDAAoD;AACpD,eAAO,MAAM,2BAA2B,6EAAyC,CAAC;AAElF,8CAA8C;AAC9C,eAAO,MAAM,kBAAkB,uEAAmC,CAAC"}
package/lib/schemaUrls.js CHANGED
@@ -1,6 +1,6 @@
1
1
  const schemaPrefix = 'https://unpkg.com/@ms-cloudpack/common-types/schema';
2
2
  /** unpkg URL for the GeneratedConfig JSON schema */
3
- export const generatedUserConfigSchemaUrl = `${schemaPrefix}/GeneratedConfig.json`;
4
- /** unpkg URL for the UserConfig JSON schema */
5
- export const userConfigSchemaUrl = `${schemaPrefix}/UserConfig.json`;
3
+ export const generatedAppConfigSchemaUrl = `${schemaPrefix}/GeneratedConfig.json`;
4
+ /** unpkg URL for the AppConfig JSON schema */
5
+ export const appConfigSchemaUrl = `${schemaPrefix}/AppConfig.json`;
6
6
  //# sourceMappingURL=schemaUrls.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"schemaUrls.js","sourceRoot":"","sources":["../src/schemaUrls.ts"],"names":[],"mappings":"AAAA,MAAM,YAAY,GAAG,qDAAqD,CAAC;AAE3E,oDAAoD;AACpD,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,YAAY,uBAAuB,CAAC;AAEnF,+CAA+C;AAC/C,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,YAAY,kBAAkB,CAAC","sourcesContent":["const schemaPrefix = 'https://unpkg.com/@ms-cloudpack/common-types/schema';\n\n/** unpkg URL for the GeneratedConfig JSON schema */\nexport const generatedUserConfigSchemaUrl = `${schemaPrefix}/GeneratedConfig.json`;\n\n/** unpkg URL for the UserConfig JSON schema */\nexport const userConfigSchemaUrl = `${schemaPrefix}/UserConfig.json`;\n"]}
1
+ {"version":3,"file":"schemaUrls.js","sourceRoot":"","sources":["../src/schemaUrls.ts"],"names":[],"mappings":"AAAA,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","sourcesContent":["const 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"]}
@@ -0,0 +1,7 @@
1
+ import type { AppConfig } from '@ms-cloudpack/common-types';
2
+ /**
3
+ * Writes updates to the user config. Unlike writing generated config, this does not sort existing package settings,
4
+ * with the intent of minimizing churn.
5
+ */
6
+ export declare function writeAppConfig(config: AppConfig, appPath: string): Promise<void>;
7
+ //# sourceMappingURL=writeAppConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"writeAppConfig.d.ts","sourceRoot":"","sources":["../src/writeAppConfig.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAI5D;;;GAGG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,iBAWtE"}
@@ -1,15 +1,15 @@
1
1
  import { writeJson } from '@ms-cloudpack/json-utilities';
2
2
  import { getConfigPath } from './getConfigPath.js';
3
- import { userConfigSchemaUrl } from './schemaUrls.js';
3
+ import { appConfigSchemaUrl } from './schemaUrls.js';
4
4
  /**
5
5
  * Writes updates to the user config. Unlike writing generated config, this does not sort existing package settings,
6
6
  * with the intent of minimizing churn.
7
7
  */
8
- export async function writeUserConfig(config, appPath) {
9
- const { userConfigPath } = getConfigPath(appPath);
10
- return writeJson(userConfigPath, {
11
- $schema: userConfigSchemaUrl,
8
+ export async function writeAppConfig(config, appPath) {
9
+ const { appConfigPath } = getConfigPath(appPath);
10
+ return writeJson(appConfigPath, {
11
+ $schema: appConfigSchemaUrl,
12
12
  ...config,
13
13
  }, { update: true, mode: 'permissive' });
14
14
  }
15
- //# sourceMappingURL=writeUserConfig.js.map
15
+ //# sourceMappingURL=writeAppConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"writeAppConfig.js","sourceRoot":"","sources":["../src/writeAppConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,MAAiB,EAAE,OAAe;IACrE,MAAM,EAAE,aAAa,EAAE,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;IAEjD,OAAO,SAAS,CACd,aAAa,EACb;QACE,OAAO,EAAE,kBAAkB;QAC3B,GAAG,MAAM;KACV,EACD,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,CACrC,CAAC;AACJ,CAAC","sourcesContent":["import { writeJson } from '@ms-cloudpack/json-utilities';\nimport type { AppConfig } from '@ms-cloudpack/common-types';\nimport { getConfigPath } from './getConfigPath.js';\nimport { appConfigSchemaUrl } from './schemaUrls.js';\n\n/**\n * Writes updates to the user config. Unlike writing generated config, this does not sort existing package settings,\n * with the intent of minimizing churn.\n */\nexport async function writeAppConfig(config: AppConfig, appPath: string) {\n const { appConfigPath } = getConfigPath(appPath);\n\n return writeJson(\n appConfigPath,\n {\n $schema: appConfigSchemaUrl,\n ...config,\n },\n { update: true, mode: 'permissive' },\n );\n}\n"]}
@@ -2,7 +2,7 @@ import { writeJson } from '@ms-cloudpack/json-utilities';
2
2
  import { compareSettings } from './compareSettings.js';
3
3
  import { getConfigPath } from './getConfigPath.js';
4
4
  import { compareOverrides } from './compareOverrides.js';
5
- import { generatedUserConfigSchemaUrl } from './schemaUrls.js';
5
+ import { generatedAppConfigSchemaUrl } from './schemaUrls.js';
6
6
  /**
7
7
  * Writes generated config. This is used for `init` to provide package overrides needed.
8
8
  */
@@ -14,7 +14,7 @@ export async function writeGeneratedConfig(config, appPath) {
14
14
  const sortedSettings = packageSettings?.sort(compareSettings);
15
15
  const sortedOverrides = packageOverrides?.sort(compareOverrides);
16
16
  return writeJson(generatedConfigPath, {
17
- $schema: generatedUserConfigSchemaUrl,
17
+ $schema: generatedAppConfigSchemaUrl,
18
18
  ...rest,
19
19
  packageSettings: sortedSettings,
20
20
  packageOverrides: sortedOverrides,
@@ -1 +1 @@
1
- {"version":3,"file":"writeGeneratedConfig.js","sourceRoot":"","sources":["../src/writeGeneratedConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AAE/D;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,MAAuB,EAAE,OAAe;IACjF,MAAM,EAAE,mBAAmB,EAAE,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;IAEvD,qFAAqF;IACrF,6CAA6C;IAC7C,MAAM,EAAE,gBAAgB,EAAE,eAAe,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;IAE9D,MAAM,cAAc,GAAG,eAAe,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;IAC9D,MAAM,eAAe,GAAG,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAEjE,OAAO,SAAS,CAAC,mBAAmB,EAAE;QACpC,OAAO,EAAE,4BAA4B;QACrC,GAAG,IAAI;QACP,eAAe,EAAE,cAAc;QAC/B,gBAAgB,EAAE,eAAe;KAClC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { writeJson } from '@ms-cloudpack/json-utilities';\nimport type { GeneratedConfig } from '@ms-cloudpack/common-types';\nimport { compareSettings } from './compareSettings.js';\nimport { getConfigPath } from './getConfigPath.js';\nimport { compareOverrides } from './compareOverrides.js';\nimport { generatedUserConfigSchemaUrl } from './schemaUrls.js';\n\n/**\n * Writes generated config. This is used for `init` to provide package overrides needed.\n */\nexport async function writeGeneratedConfig(config: GeneratedConfig, appPath: string) {\n const { generatedConfigPath } = getConfigPath(appPath);\n\n // Ensure package overrides are sorted based on package name and version requirement.\n // eslint-disable-next-line etc/no-deprecated\n const { packageOverrides, packageSettings, ...rest } = config;\n\n const sortedSettings = packageSettings?.sort(compareSettings);\n const sortedOverrides = packageOverrides?.sort(compareOverrides);\n\n return writeJson(generatedConfigPath, {\n $schema: generatedUserConfigSchemaUrl,\n ...rest,\n packageSettings: sortedSettings,\n packageOverrides: sortedOverrides,\n });\n}\n"]}
1
+ {"version":3,"file":"writeGeneratedConfig.js","sourceRoot":"","sources":["../src/writeGeneratedConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAE9D;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,MAAuB,EAAE,OAAe;IACjF,MAAM,EAAE,mBAAmB,EAAE,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;IAEvD,qFAAqF;IACrF,6CAA6C;IAC7C,MAAM,EAAE,gBAAgB,EAAE,eAAe,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;IAE9D,MAAM,cAAc,GAAG,eAAe,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;IAC9D,MAAM,eAAe,GAAG,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAEjE,OAAO,SAAS,CAAC,mBAAmB,EAAE;QACpC,OAAO,EAAE,2BAA2B;QACpC,GAAG,IAAI;QACP,eAAe,EAAE,cAAc;QAC/B,gBAAgB,EAAE,eAAe;KAClC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { writeJson } from '@ms-cloudpack/json-utilities';\nimport type { GeneratedConfig } from '@ms-cloudpack/common-types';\nimport { compareSettings } from './compareSettings.js';\nimport { getConfigPath } from './getConfigPath.js';\nimport { compareOverrides } from './compareOverrides.js';\nimport { generatedAppConfigSchemaUrl } from './schemaUrls.js';\n\n/**\n * Writes generated config. This is used for `init` to provide package overrides needed.\n */\nexport async function writeGeneratedConfig(config: GeneratedConfig, appPath: string) {\n const { generatedConfigPath } = getConfigPath(appPath);\n\n // Ensure package overrides are sorted based on package name and version requirement.\n // eslint-disable-next-line etc/no-deprecated\n const { packageOverrides, packageSettings, ...rest } = config;\n\n const sortedSettings = packageSettings?.sort(compareSettings);\n const sortedOverrides = packageOverrides?.sort(compareOverrides);\n\n return writeJson(generatedConfigPath, {\n $schema: generatedAppConfigSchemaUrl,\n ...rest,\n packageSettings: sortedSettings,\n packageOverrides: sortedOverrides,\n });\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/config",
3
- "version": "0.19.7",
3
+ "version": "0.20.0",
4
4
  "description": "Configuration handling for cloudpack.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -14,9 +14,9 @@
14
14
  }
15
15
  },
16
16
  "dependencies": {
17
- "@ms-cloudpack/common-types": "^0.3.0",
17
+ "@ms-cloudpack/common-types": "^0.4.0",
18
18
  "@ms-cloudpack/json-utilities": "^0.1.4",
19
- "@ms-cloudpack/package-utilities": "^7.2.1",
19
+ "@ms-cloudpack/package-utilities": "^7.3.1",
20
20
  "import-meta-resolve": "^4.0.0",
21
21
  "merge": "^2.1.1",
22
22
  "semver": "^7.6.0"
@@ -1 +0,0 @@
1
- {"version":3,"file":"readUserConfig.d.ts","sourceRoot":"","sources":["../src/readUserConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAoC7D;;;GAGG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAIzE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"readUserConfig.js","sourceRoot":"","sources":["../src/readUserConfig.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D;;GAEG;AACH,KAAK,UAAU,sBAAsB,CAAC,UAAkB;IACtD,MAAM,UAAU,GAAG,MAAM,QAAQ,CAAa,UAAU,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;IACjG,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO;QACrC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC;YACjC,CAAC,CAAC,UAAU,CAAC,OAAO;YACpB,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC;QACxB,CAAC,CAAC,EAAE,CAAC;IAEP,2CAA2C;IAC3C,MAAM,aAAa,GAAiB,EAAE,CAAC;IACvC,KAAK,MAAM,eAAe,IAAI,YAAY,EAAE,CAAC;QAC3C,MAAM,YAAY,GAAG,mBAAmB,CAAC,EAAE,UAAU,EAAE,eAAe,EAAE,CAAC,CAAC;QAC1E,IAAI,YAAY,EAAE,CAAC;YACjB,MAAM,YAAY,GAAG,MAAM,sBAAsB,CAAC,YAAY,CAAC,CAAC;YAChE,IAAI,YAAY,EAAE,CAAC;gBACjB,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YACnC,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,iBAAiB,CAAC,EAAE,UAAU,EAAE,aAAa,EAAE,CAAC,CAAC;AAC1D,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,OAAe;IAClD,MAAM,EAAE,cAAc,EAAE,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;IAElD,OAAO,CAAC,MAAM,sBAAsB,CAAC,cAAc,CAAC,CAAC,IAAI,EAAE,CAAC;AAC9D,CAAC","sourcesContent":["import type { UserConfig } from '@ms-cloudpack/common-types';\nimport { readJson } from '@ms-cloudpack/json-utilities';\nimport { getConfigPath } from './getConfigPath.js';\nimport { mergeParentConfig } from './mergeParentConfig.js';\nimport { resolveParentConfig } from './resolveParentConfig.js';\n\n/**\n * Reads the user config, with any `extends` parent configs merged in.\n */\nasync function readUserConfigInternal(configPath: string): Promise<UserConfig | undefined> {\n const userConfig = await readJson<UserConfig>(configPath, { verbose: true, mode: 'permissive' });\n if (!userConfig) {\n return undefined;\n }\n\n const extendsArray = userConfig.extends\n ? Array.isArray(userConfig.extends)\n ? userConfig.extends\n : [userConfig.extends]\n : [];\n\n // Recursively read any parent config files\n const parentConfigs: UserConfig[] = [];\n for (const importSpecifier of extendsArray) {\n const resolvedPath = resolveParentConfig({ configPath, importSpecifier });\n if (resolvedPath) {\n const parentConfig = await readUserConfigInternal(resolvedPath);\n if (parentConfig) {\n parentConfigs.push(parentConfig);\n }\n }\n }\n\n return mergeParentConfig({ userConfig, parentConfigs });\n}\n\n/**\n * Reads the user config file and merges with any parent configs asynchronously. Note this is only useful for making modifications to the user config.\n * For a full merged representation of config, use `readConfig` instead.\n */\nexport async function readUserConfig(appPath: string): Promise<UserConfig> {\n const { userConfigPath } = getConfigPath(appPath);\n\n return (await readUserConfigInternal(userConfigPath)) || {};\n}\n"]}
@@ -1,7 +0,0 @@
1
- import type { UserConfig } from '@ms-cloudpack/common-types';
2
- /**
3
- * Writes updates to the user config. Unlike writing generated config, this does not sort existing package settings,
4
- * with the intent of minimizing churn.
5
- */
6
- export declare function writeUserConfig(config: UserConfig, appPath: string): Promise<void>;
7
- //# sourceMappingURL=writeUserConfig.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"writeUserConfig.d.ts","sourceRoot":"","sources":["../src/writeUserConfig.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAI7D;;;GAGG;AACH,wBAAsB,eAAe,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,iBAWxE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"writeUserConfig.js","sourceRoot":"","sources":["../src/writeUserConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,MAAkB,EAAE,OAAe;IACvE,MAAM,EAAE,cAAc,EAAE,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;IAElD,OAAO,SAAS,CACd,cAAc,EACd;QACE,OAAO,EAAE,mBAAmB;QAC5B,GAAG,MAAM;KACV,EACD,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,CACrC,CAAC;AACJ,CAAC","sourcesContent":["import { writeJson } from '@ms-cloudpack/json-utilities';\nimport type { UserConfig } from '@ms-cloudpack/common-types';\nimport { getConfigPath } from './getConfigPath.js';\nimport { userConfigSchemaUrl } from './schemaUrls.js';\n\n/**\n * Writes updates to the user config. Unlike writing generated config, this does not sort existing package settings,\n * with the intent of minimizing churn.\n */\nexport async function writeUserConfig(config: UserConfig, appPath: string) {\n const { userConfigPath } = getConfigPath(appPath);\n\n return writeJson(\n userConfigPath,\n {\n $schema: userConfigSchemaUrl,\n ...config,\n },\n { update: true, mode: 'permissive' },\n );\n}\n"]}