diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5bcd95ae..51f1f43d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -61,7 +61,9 @@ jobs: deno-version: v1.x - run: | deno --version - deno test --allow-read test/deno/yargs-test.ts + deno test --allow-read --allow-env test/deno/yargs-test.ts + env: + MY_PREFIX_MY_KEY: "my value" browser: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index b068d68d..dccda7e8 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -7,7 +7,7 @@ jobs: release-please: runs-on: ubuntu-latest steps: - - uses: google-github-actions/release-please-action@v2 + - uses: google-github-actions/release-please-action@v3 id: release with: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 6b84c484..456110db 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1 +1 @@ -{".":"21.0.0"} \ No newline at end of file +{".":"21.0.1"} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index f34e4dfd..ca50b82e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [21.0.1](https://github.com/yargs/yargs-parser/compare/yargs-parser-v21.0.0...yargs-parser-v21.0.1) (2022-02-27) + + +### Bug Fixes + +* return deno env object ([#432](https://github.com/yargs/yargs-parser/issues/432)) ([b00eb87](https://github.com/yargs/yargs-parser/commit/b00eb87b4860a890dd2dab0d6058241bbfd2b3ec)) + ## [21.0.0](https://www.github.com/yargs/yargs-parser/compare/yargs-parser-v20.2.9...yargs-parser-v21.0.0) (2021-11-15) diff --git a/deno.ts b/deno.ts index 1074dc64..ea42bced 100644 --- a/deno.ts +++ b/deno.ts @@ -10,7 +10,7 @@ import type { Arguments, ArgsInput, Parser, Options, DetailedArguments } from '. const parser = new YargsParser({ cwd: Deno.cwd, env: () => { - Deno.env.toObject() + return Deno.env.toObject() }, format: (str: string, arg: string) => { return str.replace('%s', arg) }, normalize: path.posix.normalize, diff --git a/package.json b/package.json index c4b03225..89412fcf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "yargs-parser", - "version": "21.0.0", + "version": "21.0.1", "description": "the mighty option parser used by yargs", "main": "build/index.cjs", "exports": { @@ -53,7 +53,6 @@ "@types/node": "^16.11.4", "@typescript-eslint/eslint-plugin": "^3.10.1", "@typescript-eslint/parser": "^3.10.1", - "@wessberg/rollup-plugin-ts": "^1.2.28", "c8": "^7.3.0", "chai": "^4.2.0", "cross-env": "^7.0.2", @@ -62,10 +61,11 @@ "eslint-plugin-node": "^11.0.0", "gts": "^3.0.0", "mocha": "^9.0.0", - "puppeteer": "^11.0.0", + "puppeteer": "^13.4.0", "rimraf": "^3.0.2", "rollup": "^2.22.1", "rollup-plugin-cleanup": "^3.1.1", + "rollup-plugin-ts": "^2.0.5", "serve": "^13.0.0", "standardx": "^7.0.0", "start-server-and-test": "^1.11.2", diff --git a/rollup.config.js b/rollup.config.js index ff47101d..15fd65db 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,5 +1,5 @@ import cleanup from 'rollup-plugin-cleanup' -import ts from '@wessberg/rollup-plugin-ts' +import ts from 'rollup-plugin-ts' import transformDefaultExport from 'ts-transform-default-export' const output = { diff --git a/test/deno/yargs-test.ts b/test/deno/yargs-test.ts index f025ac62..8bb250ec 100644 --- a/test/deno/yargs-test.ts +++ b/test/deno/yargs-test.ts @@ -63,3 +63,8 @@ Deno.test('it detects strings that could be parsed as numbers', () => { assertEquals(parser.looksLikeNumber('0100'), false) assertEquals(parser.looksLikeNumber('apple'), false) }) + +Deno.test('should load values from environment variables', () => { + const argv = parser([], { envPrefix: 'MY_PREFIX_' }) + assertEquals(argv.myKey, 'my value') +})