Skip to content

Commit

Permalink
v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Pinta365 committed Mar 21, 2024
1 parent 4a7346d commit ea9552a
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 21 deletions.
20 changes: 6 additions & 14 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
# .github/workflows/publish.yml
name: Publish to JSR

name: Publish to jsr.io
on:
workflow_run:
workflows: ["CI Tests"]
types:
- completed
release:
types: [released]
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write

steps:
- uses: actions/checkout@v4

- name: Publish package
run: npx jsr publish
id-token: write
uses: cross-org/workflows/.github/workflows/jsr-publish.yml@main
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ jobs:
uses: cross-org/workflows/.github/workflows/node-ci.yml@main
with:
jsr_dependencies: "@cross/deepmerge @cross/runtime @cross/test @std/assert"
test_target: "tests/*.test.ts"
test_target: "*.test.ts"
8 changes: 4 additions & 4 deletions deno.jsonc
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@cross/env",
"version": "0.2.7",
"version": "1.0.0",
"exports": {
".": "./mod.ts",
"./load": "./load.ts"
},

"tasks": {
"test": "cd tests && deno test --allow-env --allow-read",
"test": "deno test --allow-env --allow-read",
"publish-dry": "deno publish --dry-run"
},
"lock": false,
Expand All @@ -16,8 +16,8 @@
"indentWidth": 4
},
"imports": {
"@cross/deepmerge": "jsr:@cross/deepmerge@^0.2.0",
"@cross/runtime": "jsr:@cross/runtime@^0.0.17",
"@cross/deepmerge": "jsr:@cross/deepmerge@^01.0.0",
"@cross/runtime": "jsr:@cross/runtime@^1.0.0",
"@cross/test": "jsr:@cross/test@^0.0.8",
"@std/assert": "jsr:@std/assert@^0.219.1"
}
Expand Down
15 changes: 15 additions & 0 deletions load.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { assertEquals } from "@std/assert";
import { test } from "@cross/test";
import { getEnv } from "./mod.ts";

/**
* Part of the test.
* simulating using the auto .env-load as it would have been with
* import "@cross/env/load";
*/
import "./load.ts";

test("Using import @cross/env/load", () => {
const value = getEnv("TEST_VALUE");
assertEquals(value, "1");
});
4 changes: 2 additions & 2 deletions tests/mod.test.ts → mod.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, assertEquals, assertThrows } from "@std/assert";
import { ValidationError } from "../lib/helpers.ts";
import { ValidationError } from "./lib/helpers.ts";
import {
getAllEnv,
getEnv,
Expand All @@ -10,7 +10,7 @@ import {
validateAndGetEnv,
validateEnv,
ValidatorFunction,
} from "../mod.ts";
} from "./mod.ts";
import { test } from "@cross/test";

/** ==== getEnv() ==== */
Expand Down

0 comments on commit ea9552a

Please sign in to comment.