Skip to content

Commit ceb4951

Browse files
chore: migrate to npm (#247)
1 parent 2ac32fb commit ceb4951

File tree

10 files changed

+11456
-6309
lines changed

10 files changed

+11456
-6309
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,40 @@ on:
77
branches: [main]
88

99
jobs:
10-
test-ci:
11-
name: test-ci
10+
build:
1211
runs-on: ubuntu-latest
13-
timeout-minutes: 5
1412
steps:
1513
- uses: actions/checkout@v4
16-
- uses: pnpm/action-setup@v3
14+
- uses: actions/setup-node@v4
1715
with:
18-
version: 9.0.6
16+
node-version: 20
17+
- run: npm install
18+
- run: npm run build
19+
lint:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: actions/setup-node@v4
24+
with:
25+
node-version: 20
26+
- run: npm install
27+
- run: npm run lint
28+
tsc:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v4
32+
- uses: actions/setup-node@v4
33+
with:
34+
node-version: 20
35+
- run: npm install
36+
- run: npm run lint:ts
37+
test:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v4
1941
- uses: actions/setup-node@v4
2042
with:
2143
node-version: 20
22-
cache: pnpm
23-
- name: install deps
24-
run: pnpm install
25-
- name: build sdk
26-
run: pnpm build
27-
- name: lint
28-
run: pnpm lint
29-
- name: check ts
30-
run: pnpm lint:ts
31-
- name: test
32-
run: pnpm test:all
44+
- run: npm install
45+
- run: npm test
46+

.github/workflows/release-please.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,14 @@ jobs:
2626
if: ${{ steps.release.outputs.release_created }}
2727
with:
2828
ref: main
29-
- uses: pnpm/action-setup@v2
30-
if: ${{ steps.release.outputs.release_created }}
31-
with:
32-
version: latest
3329
- uses: actions/setup-node@v4
3430
if: ${{ steps.release.outputs.release_created }}
3531
with:
3632
node-version: 20
37-
cache: pnpm
3833
registry-url: 'https://registry.npmjs.org'
39-
- run: pnpm install
34+
- run: npm install
4035
if: ${{ steps.release.outputs.release_created }}
41-
- run: pnpm build
36+
- run: npm run build
4237
if: ${{ steps.release.outputs.release_created }}
4338
- id: auth
4439
if: ${{ steps.release.outputs.release_created }}
@@ -54,6 +49,6 @@ jobs:
5449
NPM_TOKEN:discord-app-city-prd/embedded-app-sdk-deploy-token
5550
- name: Publish 🚀
5651
if: ${{ steps.release.outputs.release_created }}
57-
run: pnpm publish --access public --no-git-checks
52+
run: npm publish --access public --no-git-checks
5853
env:
5954
NODE_AUTH_TOKEN: ${{ steps.secrets.outputs.NPM_TOKEN }}

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pnpm lint-staged
1+
npx lint-staged

.vscode/launch.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
"version": "0.2.0",
66
"configurations": [
77
{
8-
"name": "Launch via pnpm",
8+
"name": "Launch via npm",
99
"request": "launch",
1010
"runtimeArgs": ["test"],
11-
"runtimeExecutable": "pnpm",
11+
"runtimeExecutable": "npm",
1212
"skipFiles": ["<node_internals>/**"],
1313
"type": "pwa-node"
1414
}

docs/local-sdk-development.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
# Local SDK development
22

3-
We have two example projects, which can be used to test the latest SDK release, as well as new changes to the SDK.
3+
When developing the SDK locally, you can enable the SDK to rebuild "on save" by running `npm run dev`.
44

5-
- [discord-activity-starter](https://github.com/discord/embedded-app-sdk/blob/main/examples/discord-activity-starter) is a minimal application example
6-
- [sdk-playground](https://github.com/discord/embedded-app-sdk/blob/main/examples/sdk-playground) is a playground for testing any SDK functionality
7-
8-
These projects consume this repo's root `@discord/embedded-app-sdk` directly via [pnpm workspaces](https://pnpm.io/workspaces)
9-
10-
To test changes to the SDK, locally, with either of these projects, you must do the following:
11-
12-
1. From terminal, navigate to the root of either project's directory, (i.e. examples/discord-application-start or examples/sdk-playground)
13-
2. Start up the example's web server with `pnpm dev`.
14-
3. In another terminal, start up the SDK's development pipeline with `pnpm dev` from the root of the repository.
5+
We recommend testing changes to the SDK against the SDK-Playground example, which can be found [here](https://github.com/discord/embedded-app-sdk-examples/tree/main/sdk-playground#testing-sdk-changes-locally).

0 commit comments

Comments
 (0)