Skip to content

Commit

Permalink
add interface. fix npm package workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaddy Mansour committed May 17, 2024
1 parent 0a0e6fd commit 26b9a07
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ jobs:
- name: Build
run: npm run build
- name: Publish to GitHub Packages
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ${{ github.workspace }}/.npmrc
npm publish
npm:
runs-on: ubuntu-latest
steps:
Expand All @@ -47,5 +47,5 @@ jobs:
run: npm run build
- name: Publish to NPM
run: |
echo '//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}' > ${{ github.workspace }}/.npmrc
echo '//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}' > ${{ github.workspace }}/.npmrc
npm publish --access public
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shaddyhm/configs",
"version": "0.1.0",
"version": "0.1.1",
"description": "A simple application configuration library",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -55,8 +55,5 @@
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "all"
},
"publishConfig": {
"@shaddyhm:registry": "https://npm.pkg.github.com"
}
}
6 changes: 5 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ export type ConfigsOptions = {
configsResolver: (env: string) => string[];
};

export class Configs {
export interface IConfigs {
get: <T>(key?: string) => Promise<T>;
}

export class Configs implements IConfigs {
private static defaultOptions: ConfigsOptions = {
fetchData: () => Promise.resolve({}),
pathDelimiter: '.',
Expand Down

0 comments on commit 26b9a07

Please sign in to comment.