Skip to content

Commit 10de242

Browse files
authored
Merge pull request #8 from TouK/dev
chore: release
2 parents e31b3d9 + 8139c84 commit 10de242

File tree

5 files changed

+341
-174
lines changed

5 files changed

+341
-174
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# [1.1.0-beta.1](https://github.com/touk/federated-types/compare/v1.0.0...v1.1.0-beta.1) (2021-08-02)
2+
3+
4+
### Features
5+
6+
* use custom config path with --config arg ([e85dea5](https://github.com/touk/federated-types/commit/e85dea5994b8f8a0ff050fe0c62c8751fdd20bcd))
7+
18
# 1.0.0 (2021-07-21)
29

310

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,13 @@ scripts: {
7373
"make-types": "make-federated-types --outputDir ../../my_types/"
7474
}
7575
```
76+
77+
#### `package.json`
78+
79+
If you would like to specify custom path to the config, you can pass `--config` parameter like so:
80+
81+
```json
82+
scripts: {
83+
"make-types": "make-federated-types --config ./path/to/my/config.json --outputDir ../../my_types/"
84+
}
85+
```

cli.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ const outputDir = outDirArg
2727
? path.resolve('./', outDirArg)
2828
: path.resolve(nodeModules, '@types/__federated_types/');
2929

30+
const configPathArg = getArg('--config');
31+
const configPath = configPathArg
32+
? path.resolve(configPathArg)
33+
: null;
34+
3035
const findFederationConfig = (base) => {
3136
let files = fs.readdirSync(base);
3237
let queue = [];
@@ -46,7 +51,13 @@ const findFederationConfig = (base) => {
4651
}
4752
};
4853

49-
const federationConfigPath = findFederationConfig('./');
54+
if (configPath && !fs.existsSync(configPath)) {
55+
console.error(`ERROR: Unable to find a provided config: ${configPath}`);
56+
process.exit(1);
57+
}
58+
59+
const federationConfigPath = configPath || findFederationConfig('./');
60+
5061

5162
if (federationConfigPath === undefined) {
5263
console.error(`ERROR: Unable to find a federation.config.json file in this package`);

0 commit comments

Comments
 (0)