Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#### Problem



#### Summary of Changes



Fixes #
25 changes: 25 additions & 0 deletions .github/workflows/actions/install-npm-dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Install Dependencies
description: Sets up Node and its package manager, then installs all dependencies

inputs:
version:
default: 'lts/*'
type: string

runs:
using: composite
steps:
- name: Install package manager
uses: pnpm/action-setup@v3
with:
version: 9.1.0

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.version }}
cache: 'pnpm'

- name: Install dependencies
shell: bash
run: pnpm install
35 changes: 35 additions & 0 deletions .github/workflows/pull-requests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Pull requests

on:
pull_request:

jobs:
all-pr-checks:
runs-on: ubuntu-latest
needs: build-and-test
steps:
- run: echo "Done"

build-and-test:
runs-on: ubuntu-latest

strategy:
matrix:
node:
- "current"
- "lts/*"

name: Build & Test on Node ${{ matrix.node }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install NPM Dependencies
uses: ./.github/workflows/actions/install-npm-dependencies
with:
version: ${{ matrix.node }}

- name: Build
run: pnpm build
- name: Unit Tests
run: pnpm test:unit
8 changes: 8 additions & 0 deletions __tests__/example.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// import assert from "node:assert";

describe("scaffold", () => {
test("example test", () => {
// do a thing
// assert.equal(think1, "thing2");
});
});
23 changes: 23 additions & 0 deletions jest-unit.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { Config } from "@jest/types";

const config: Partial<Config.InitialProjectOptions> = {
resetMocks: true,
restoreMocks: true,
roots: ["<rootDir>/"],
displayName: {
color: "grey",
name: "Unit Test",
},
transform: {
"^.+\\.(ts|js)x?$": [
"@swc/jest",
{
jsc: {
target: "es2020",
},
},
],
},
};

export default config;
14 changes: 13 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@
"dev": "yarn build && yarn nsolana",
"build": "rollup -c",
"watch": "rollup -c --watch",
"test": "pnpm test:unit",
"test:unit": "jest -c ./jest-unit.config.ts --rootDir . --silent",
"test:unit:watch": "jest -c ./jest-unit.config.ts --rootDir . --watch",
"solana": "node ./bin/index.mjs",
"changeset:version": "changeset version && git add -A && git commit -m \"chore: version\"",
"changeset:publish": "pnpm build && changeset publish",
"postpublish": "git push --follow-tags"
"postpublish": "git push --follow-tags",
"style:fix": "prettier --write '{*,**/*}.{ts,tsx,js,jsx,css,json,md}'"
},
"bin": {
"nsolana": "bin/index.mjs",
Expand Down Expand Up @@ -43,19 +47,27 @@
},
"devDependencies": {
"@changesets/cli": "^2.27.9",
"@jest/types": "^29.6.3",
"@rollup/plugin-commonjs": "^28.0.1",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.3.0",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^12.1.1",
"@swc/core": "^1.9.3",
"@swc/jest": "^0.2.37",
"@types/bn.js": "^5.1.6",
"@types/inquirer": "^9.0.7",
"@types/jest": "^29.5.14",
"@types/node": "^22.7.6",
"@types/prompts": "^2.4.9",
"jest": "^29.7.0",
"rollup": "^4.24.0",
"ts-jest": "^29.2.5",
"ts-node": "^10.9.2",
"tslib": "^2.8.0",
"typescript": "^5.6.3"
},
"packageManager": "[email protected]",
"keywords": [],
"homepage": "https://github.com/solana-developers/solana-node-cli#readme",
"bugs": {
Expand Down
Loading