Skip to content

Commit

Permalink
feat: removes default-extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
joelgallant committed May 6, 2021
1 parent 769328e commit 7de7bf5
Show file tree
Hide file tree
Showing 17 changed files with 70 additions and 145 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/publishing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,6 @@ jobs:
access: public
package: ./app-config-cypress/package.json
tag: next
- name: app-config-default-extensions
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
access: public
package: ./app-config-default-extensions/package.json
tag: next
- name: app-config-encryption
uses: JS-DevTools/npm-publish@v1
with:
Expand Down
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ If you are adding anything new or changing behavior, please add applicable tests
- `@app-config/git`: `$git` parsing extension
- `@app-config/v1-compat`: v1 version compatibility extension
- `@app-config/extensions`: common parsing extensions
- `@app-config/default-extensions`: all default parsing extensions
- `@app-config/generate`: code generation
- `@app-config/config`: config loading
- `@app-config/meta`: meta file loading
Expand Down
1 change: 0 additions & 1 deletion app-config-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
},
"dependencies": {
"@app-config/core": "^3.0.0-alpha.3",
"@app-config/default-extensions": "^3.0.0-alpha.3",
"@app-config/extensions": "^3.0.0-alpha.3",
"@app-config/logging": "^3.0.0-alpha.3",
"@app-config/meta": "^3.0.0-alpha.3",
Expand Down
7 changes: 5 additions & 2 deletions app-config-config/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ import {
EnvironmentSource,
asEnvOptions,
} from '@app-config/node';
import { markAllValuesAsSecret } from '@app-config/extensions';
import { defaultExtensions, defaultEnvExtensions } from '@app-config/default-extensions';
import {
defaultExtensions,
defaultEnvExtensions,
markAllValuesAsSecret,
} from '@app-config/extensions';
import { loadSchema, JSONSchema, SchemaLoadingOptions } from '@app-config/schema';
import { loadMetaConfig, loadExtraParsingExtensions } from '@app-config/meta';

Expand Down
1 change: 0 additions & 1 deletion app-config-default-extensions/.eslintrc.js

This file was deleted.

8 changes: 0 additions & 8 deletions app-config-default-extensions/README.md

This file was deleted.

9 changes: 0 additions & 9 deletions app-config-default-extensions/index.d.ts

This file was deleted.

54 changes: 0 additions & 54 deletions app-config-default-extensions/index.js

This file was deleted.

33 changes: 0 additions & 33 deletions app-config-default-extensions/package.json

This file was deleted.

11 changes: 0 additions & 11 deletions app-config-default-extensions/tsconfig.json

This file was deleted.

72 changes: 60 additions & 12 deletions app-config-extensions/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
import { named } from '@app-config/extension-utils';
import { ParsingExtension } from '@app-config/core';

export { tryDirective } from './try-directive';
export { ifDirective } from './if-directive';
export { eqDirective } from './eq-directive';
export { hiddenDirective } from './hidden-directive';
export { envDirective } from './env-directive';
export { extendsDirective, extendsSelfDirective, overrideDirective } from './extends-directive';
export { timestampDirective } from './timestamp-directive';

export { envVarDirective } from './env-var-directive';
export { substituteDirective } from './substitute-directive';
export { substituteDirective as environmentVariableSubstitution } from './substitute-directive';
export { parseDirective } from './parse-directive';
import { tryDirective } from './try-directive';
import { ifDirective } from './if-directive';
import { eqDirective } from './eq-directive';
import { hiddenDirective } from './hidden-directive';
import { envDirective } from './env-directive';
import { extendsDirective, extendsSelfDirective, overrideDirective } from './extends-directive';
import { timestampDirective } from './timestamp-directive';
import { envVarDirective } from './env-var-directive';
import { substituteDirective } from './substitute-directive';
import { parseDirective } from './parse-directive';

export {
tryDirective,
ifDirective,
eqDirective,
hiddenDirective,
envDirective,
extendsDirective,
extendsSelfDirective,
overrideDirective,
timestampDirective,
envVarDirective,
substituteDirective,
parseDirective,
};

/** Marks all values recursively as fromSecrets, so they do not trigger schema errors */
export function markAllValuesAsSecret(): ParsingExtension {
Expand All @@ -31,3 +44,38 @@ export function unescape$Directives(): ParsingExtension {
return false;
});
}

export function defaultExtensions() {
return [
unescape$Directives(),
tryDirective(),
ifDirective(),
eqDirective(),
parseDirective(),
hiddenDirective(),
envDirective(),
envVarDirective(),
extendsDirective(),
extendsSelfDirective(),
overrideDirective(),
timestampDirective(),
substituteDirective(),
];
}

export function defaultEnvExtensions() {
return [unescape$Directives(), markAllValuesAsSecret()];
}

export function defaultMetaExtensions() {
return [
unescape$Directives(),
tryDirective(),
ifDirective(),
eqDirective(),
hiddenDirective(),
extendsDirective(),
extendsSelfDirective(),
overrideDirective(),
];
}
2 changes: 1 addition & 1 deletion app-config-main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@app-config/cli": "^3.0.0-alpha.3",
"@app-config/config": "^3.0.0-alpha.3",
"@app-config/core": "^3.0.0-alpha.3",
"@app-config/default-extensions": "^3.0.0-alpha.3",
"@app-config/extensions": "^3.0.0-alpha.3",
"@app-config/logging": "^3.0.0-alpha.3",
"@app-config/meta": "^3.0.0-alpha.3",
"@app-config/node": "^3.0.0-alpha.3",
Expand Down
2 changes: 1 addition & 1 deletion app-config-main/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export {
defaultExtensions,
defaultEnvExtensions,
defaultMetaExtensions,
} from '@app-config/default-extensions';
} from '@app-config/extensions';

/** @hidden Please don't rely on this. */
export function resetConfigInternal() {
Expand Down
2 changes: 1 addition & 1 deletion app-config-meta/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"dependencies": {
"@app-config/core": "^3.0.0-alpha.3",
"@app-config/default-extensions": "^3.0.0-alpha.3",
"@app-config/extensions": "^3.0.0-alpha.3",
"@app-config/logging": "^3.0.0-alpha.3",
"@app-config/node": "^3.0.0-alpha.3",
"@app-config/utils": "^3.0.0-alpha.3",
Expand Down
2 changes: 1 addition & 1 deletion app-config-meta/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
import { logger } from '@app-config/logging';

import { FlexibleFileSource, FileSource } from '@app-config/node';
import { defaultMetaExtensions } from '@app-config/default-extensions';
import { defaultMetaExtensions } from '@app-config/extensions';

export interface MetaLoadingOptions {
directory?: string;
Expand Down
2 changes: 1 addition & 1 deletion app-config-meta/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"references": [
{ "path": "../app-config-test-utils" },
{ "path": "../app-config-node" },
{ "path": "../app-config-default-extensions" }
{ "path": "../app-config-extensions" }
]
}
1 change: 0 additions & 1 deletion new-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ new_version app-config-cli
new_version app-config-config
new_version app-config-core
new_version app-config-cypress
new_version app-config-default-extensions
new_version app-config-encryption
new_version app-config-exec
new_version app-config-extension-utils
Expand Down

0 comments on commit 7de7bf5

Please sign in to comment.