Skip to content

Commit 65ba795

Browse files
committed
big updates for dep versions
- updated all npm deps - switched to pnpm - updated GitHub workflow to support pnpm and update some other versions and such - switch from ts-node to tsx as the former wasn't working anymore - simple vscode extensions.json file
1 parent 43a2ac8 commit 65ba795

File tree

6 files changed

+591
-1499
lines changed

6 files changed

+591
-1499
lines changed

.github/workflows/validate_publish.yml

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,42 +12,53 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15+
# Checkout the base branch of this repository with full depth
16+
- name: Checkout this repository
17+
uses: actions/checkout@v4
18+
with:
19+
token: ${{ secrets['GITHUB_TOKEN'] }}
20+
ref: ${{ inputs.base_branch || 'master' }}
21+
fetch-depth: 0
22+
23+
# Set the local git user config to use the GitHub Actions bot account
24+
- name: Set local git config user details
25+
run: |
26+
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
27+
git config --local user.name "github-actions[bot]"
28+
1529
# Setup some Node stuff
1630
- name: Node.js setup
17-
uses: actions/setup-node@v2
31+
uses: actions/setup-node@v4
1832
with:
19-
node-version: '16'
33+
node-version: '22'
2034
registry-url: https://registry.npmjs.org/
2135

22-
# Set NPM cache options
23-
- name: Set NPM cache
24-
uses: actions/cache@v2
36+
# Install pnpm
37+
- uses: pnpm/action-setup@v4
38+
name: Install pnpm
2539
with:
26-
path: ~/.npm
27-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
28-
restore-keys: |
29-
${{ runner.os }}-node-
40+
version: 10
3041

31-
# Update NPM to the latest version
32-
- name: Update NPM installation
33-
run: npm install -g npm@latest
42+
# Gets pnpm's store directory (for next step)
43+
- name: Get pnpm store directory
44+
id: pnpm-cache
45+
shell: bash
46+
run: |
47+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
3448
35-
# Checkout
36-
- name: Checkout this repository
37-
uses: actions/checkout@v2
49+
# Set pnpm cache options
50+
- uses: actions/cache@v4
51+
name: Setup pnpm cache
3852
with:
39-
ref: master
40-
fetch-depth: 0
53+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
54+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
55+
restore-keys: |
56+
${{ runner.os }}-pnpm-store-
4157
42-
# Set the local git user config to use the GitHub Actions bot account
43-
- name: Set local git config user details
58+
# Install pnpm dependencies
59+
- name: Install pnpm dependencies
4460
run: |
45-
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
46-
git config --local user.name "github-actions[bot]"
47-
48-
# Install NPM dependencies
49-
- name: Install NPM dependencies
50-
run: npm ci
61+
pnpm i --frozen-lockfile
5162
5263
# Run the definition validation script
5364
- name: Validate definitions

.vscode/extensions.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"recommendations": [
3+
"github.vscode-github-actions",
4+
]
5+
}

generate_types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import { compileFromFile } from 'json-schema-to-typescript';
44
async function generate(): Promise<void> {
55
try {
66
const dirs = readdirSync('./definitions', { withFileTypes: true }).filter((d) => d.isDirectory());
7-
const index = [];
7+
const index: string[] = [];
88
for (const dir of dirs) {
99
mkdirSync(`./types/${dir.name}`, { recursive: true });
10-
const dirTypes = [];
10+
const dirTypes: string[] = [];
1111
const files = readdirSync(`./definitions/${dir.name}`);
1212
for (const file of files) {
1313
const name = file.replace(/.json$/, '');
@@ -23,7 +23,7 @@ async function generate(): Promise<void> {
2323
}
2424

2525
// Creating the index.d.ts file for each group.
26-
const subIndex = [];
26+
const subIndex: string[] = [];
2727
subIndex.push(...dirTypes.map((t) => `import { ${t} as ${t}_ } from './${t}'\n`));
2828
subIndex.push(`\nexport namespace ${dir.name} {\n`);
2929
subIndex.push(...dirTypes.map((t) => ` interface ${t} extends ${t}_ {}\n`));

0 commit comments

Comments
 (0)