Skip to content

Commit 7cfc432

Browse files
committed
ci: remove Bun
1 parent c1b6c7f commit 7cfc432

File tree

6 files changed

+59
-63
lines changed

6 files changed

+59
-63
lines changed

.github/workflows/release.yml

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Release
22

33
on:
4+
pull_request:
45
push:
56
tags:
67
- v*
@@ -14,16 +15,26 @@ jobs:
1415
id-token: write
1516

1617
steps:
17-
- uses: actions/checkout@v4
18-
- uses: oven-sh/setup-bun@v2
19-
- run : bun install
20-
- run : bun run prepare
21-
- name: Publish to npm
22-
run : |
23-
bun run version.ts
24-
bun publish --ignore-scripts --access=public
25-
env :
26-
NPM_CONFIG_TOKEN: ${{ secrets.NPM_CONFIG_TOKEN }}
27-
NPM_CONFIG_PROVENANCE: true
28-
- name: Publish to JSR
29-
run: bunx jsr publish --allow-dirty
18+
- uses: actions/checkout@v4
19+
- uses: denoland/setup-deno@v2
20+
21+
- run: deno lint
22+
- run: deno test --no-check
23+
24+
- run: npm install --ignore-scripts
25+
- run: npm run prepare
26+
27+
- name: Publish to JSR
28+
if: github.event_name == 'push'
29+
run: deno publish --set-version="${GITHUB_REF_NAME/v/}"
30+
31+
- name: Publish to npm
32+
if: github.event_name == 'push'
33+
run: |
34+
npm config set //registry.npmjs.org/:_authToken '${NPM_TOKEN}'
35+
npm pkg set version="${GITHUB_REF_NAME/v/}"
36+
npm publish --ignore-scripts
37+
env:
38+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
39+
NPM_CONFIG_PROVENANCE: true
40+
NPM_CONFIG_ACCESS: public

bun.lock

Lines changed: 0 additions & 25 deletions
This file was deleted.

deno.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "@grammyjs/debug",
3+
"exports": "./src/mod.ts",
4+
"publish": {
5+
"exclude": [
6+
".*",
7+
"docs/",
8+
"**/*.js*"
9+
]
10+
},
11+
12+
"exclude": ["lib/"],
13+
"lock": false,
14+
"fmt": {
15+
"useTabs": true,
16+
"proseWrap": "preserve"
17+
}
18+
}

src/namespacing.test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import assert from "node:assert/strict";
2+
import test from "node:test";
3+
import { Namespaces } from "./namespacing.ts";
4+
5+
test("negation", () => {
6+
const namespaces = new Namespaces(`app:*,-app:auth,app:auth:warning`);
7+
assert(namespaces.check("app"));
8+
assert(!namespaces.check("app:auth"));
9+
assert(namespaces.check("app:auth:warning"));
10+
});

src/namespacing.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
export type Namespace = { allowed: boolean; children: { [key: string]: Namespace } };
1+
export type Namespace = {
2+
allowed: boolean;
3+
children: { [key: string]: Namespace };
4+
};
25

36
export class Namespaces {
47
parsed: Namespace = { allowed: false, children: {} };
@@ -9,7 +12,7 @@ export class Namespaces {
912

1013
update(debugspec: string): void {
1114
const parsed = this.parsed;
12-
const debugs = debugspec.split(/[\s,]+/).map(each => each.trim());
15+
const debugs = debugspec.split(/[\s,]+/);
1316
for (const item of debugs) {
1417
const negative = item.startsWith("-");
1518
const chain = item.slice(negative ? 1 : 0).split(":");
@@ -30,11 +33,11 @@ export class Namespaces {
3033

3134
check(namespace: string): boolean {
3235
if (namespace === "") return this.parsed.allowed;
33-
const chain = namespace.split(":").map(part => part.trim());
36+
const chain = namespace.split(":");
3437
let current = this.parsed;
3538
let tentative = current.allowed;
3639
for (const part of chain) {
37-
let picked = current.children[part];
40+
const picked = current.children[part];
3841
if (!picked) return tentative ?? false;
3942
// tentatively allow unless explicitly disabled by a descendant
4043
tentative = picked.allowed;

version.ts

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)