Skip to content

Commit

Permalink
chore: migrate to npm (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith authored Aug 28, 2024
1 parent 2ac32fb commit ceb4951
Show file tree
Hide file tree
Showing 10 changed files with 11,456 additions and 6,309 deletions.
46 changes: 30 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,40 @@ on:
branches: [main]

jobs:
test-ci:
name: test-ci
build:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
- uses: actions/setup-node@v4
with:
version: 9.0.6
node-version: 20
- run: npm install
- run: npm run build
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install
- run: npm run lint
tsc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install
- run: npm run lint:ts
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: install deps
run: pnpm install
- name: build sdk
run: pnpm build
- name: lint
run: pnpm lint
- name: check ts
run: pnpm lint:ts
- name: test
run: pnpm test:all
- run: npm install
- run: npm test

11 changes: 3 additions & 8 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,14 @@ jobs:
if: ${{ steps.release.outputs.release_created }}
with:
ref: main
- uses: pnpm/action-setup@v2
if: ${{ steps.release.outputs.release_created }}
with:
version: latest
- uses: actions/setup-node@v4
if: ${{ steps.release.outputs.release_created }}
with:
node-version: 20
cache: pnpm
registry-url: 'https://registry.npmjs.org'
- run: pnpm install
- run: npm install
if: ${{ steps.release.outputs.release_created }}
- run: pnpm build
- run: npm run build
if: ${{ steps.release.outputs.release_created }}
- id: auth
if: ${{ steps.release.outputs.release_created }}
Expand All @@ -54,6 +49,6 @@ jobs:
NPM_TOKEN:discord-app-city-prd/embedded-app-sdk-deploy-token
- name: Publish 🚀
if: ${{ steps.release.outputs.release_created }}
run: pnpm publish --access public --no-git-checks
run: npm publish --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ steps.secrets.outputs.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pnpm lint-staged
npx lint-staged
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"version": "0.2.0",
"configurations": [
{
"name": "Launch via pnpm",
"name": "Launch via npm",
"request": "launch",
"runtimeArgs": ["test"],
"runtimeExecutable": "pnpm",
"runtimeExecutable": "npm",
"skipFiles": ["<node_internals>/**"],
"type": "pwa-node"
}
Expand Down
13 changes: 2 additions & 11 deletions docs/local-sdk-development.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
# Local SDK development

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

- [discord-activity-starter](https://github.com/discord/embedded-app-sdk/blob/main/examples/discord-activity-starter) is a minimal application example
- [sdk-playground](https://github.com/discord/embedded-app-sdk/blob/main/examples/sdk-playground) is a playground for testing any SDK functionality

These projects consume this repo's root `@discord/embedded-app-sdk` directly via [pnpm workspaces](https://pnpm.io/workspaces)

To test changes to the SDK, locally, with either of these projects, you must do the following:

1. From terminal, navigate to the root of either project's directory, (i.e. examples/discord-application-start or examples/sdk-playground)
2. Start up the example's web server with `pnpm dev`.
3. In another terminal, start up the SDK's development pipeline with `pnpm dev` from the root of the repository.
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).
Loading

0 comments on commit ceb4951

Please sign in to comment.