monorepo-config 0.1.4 → 0.2.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 (2) hide show
  1. package/README.md +8 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -56,7 +56,7 @@ You can then load the chosen configuration based on a single environment variabl
56
56
  import { loadConfigProfile } from "monorepo-config";
57
57
  import { configDef } from "./config-def.ts";
58
58
 
59
- export const FOOBAR_CONFIG = await loadConfigProfile(configDef, 'FOOBAR_CONFIG');
59
+ export const FOOBAR_CONFIG = await loadConfigProfile(configDef, 'FOOBAR_CONFIG', (profile) => import(`config_package/${profile}.js`));
60
60
  ```
61
61
 
62
62
  Profiles are just typescript files like this:
@@ -80,6 +80,13 @@ You can choose, like the example, to use the same name the configuration object
80
80
  You can mix both in your monorepo! Packages representing reusable libraries probably want to stick with the basic usage and let other packages define their config. Packages that represent apps probably want to define their own config using profiles.
81
81
 
82
82
 
83
+ ## Common errors
84
+
85
+ ### Package name '...' is used for two different config definitions
86
+
87
+ Your package manager may have included two different copies of the same code. Run `pnpm dedupe`, or manually inspect your lockfile to verify this. If not, add `console.trace()` calls to the `defineConfig` function to figure out exactly where the configs are defined.
88
+
89
+
83
90
  ## TODO
84
91
 
85
92
  - [ ] Vite plugin
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "monorepo-config",
3
- "version": "0.1.4",
3
+ "version": "0.2.0",
4
4
  "description": "Managed and validated configs across packages (no deps, but bring your own zod)",
5
5
  "main": "./dist/index.js",
6
6
  "type": "module",