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
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works with
multi-package repos, or single-package repos to help you version and publish your code. You can find the full
documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
14 changes: 14 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.4/schema.json",
"access": "public",
"baseBranch": "main",
"changelog": [
"@changesets/changelog-github",
{
"repo": "solana-developers/create-solana-dapp"
}
],
"commit": false,
"linked": [],
"updateInternalDependencies": "patch"
}
46 changes: 46 additions & 0 deletions .github/publish-canary-releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Publish Canary Releases

on:
workflow_dispatch:
branches:
- main
push:
branches:
- main

env:
# See https://consoledonottrack.com/
DO_NOT_TRACK: '1'

jobs:
build-and-publish-snapshots-to-npm:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Dependencies
uses: ./.github/workflows/actions/install-dependencies

- name: Run Test & Lint
run: pnpm test

- name: Run Build Step
run: pnpm build

- name: Configure NPM token
run: |
pnpm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish Canary Release
run: |
pnpm pkg delete devDependencies
pnpm changeset version --snapshot canary
pnpm publish-packages
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
PUBLISH_TAG: canary
25 changes: 25 additions & 0 deletions .github/workflows/actions/install-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: 10.5.2

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

- name: Install dependencies
shell: bash
run: pnpm install
29 changes: 0 additions & 29 deletions .github/workflows/ci.yml

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/publish-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Version & Publish Packages

on:
workflow_dispatch:
branches:
- main
push:
branches:
- main

env:
# See https://consoledonottrack.com/
DO_NOT_TRACK: '1'

jobs:
build-and-publish-to-npm:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Dependencies
uses: ./.github/workflows/actions/install-dependencies

- name: Configure NPM token
run: |
pnpm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Create Changesets Pull Request or Trigger an NPM Publish
id: changesets
uses: changesets/action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Choose Build Step
id: build-step-decider
run:
echo "step-name=${{ steps.changesets.outputs.hasChangesets == 'false' && 'publish-packages
--concurrency=${TURBO_CONCURRENCY:-1}' || 'build' }}" >> $GITHUB_OUTPUT

- name: Run Build Step
run: pnpm ${{ steps.build-step-decider.outputs.step-name }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
44 changes: 44 additions & 0 deletions .github/workflows/pull-requests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Pull requests

on:
pull_request:

env:
# Among other things, opts out of Turborepo telemetry
# See https://consoledonottrack.com/
DO_NOT_TRACK: '1'
# Some tasks slow down considerably on GitHub Actions runners when concurrency is high
TURBO_CONCURRENCY: 1

jobs:
# Needed for grouping check-web3 strategies into one check for mergify
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 Dependencies
uses: ./.github/workflows/actions/install-dependencies
with:
version: ${{ matrix.node }}

- name: Build
run: pnpm build

- name: Test & Lint
run: pnpm test
43 changes: 16 additions & 27 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,29 @@

The document has information for the maintainers of this package.

## Publishing new versions

> Note: Your NPM cli must be logged into the NPM registry and have the correct permissions to publish a new version.

### `next` tag
## Changesets

The `next` tag is considered the beta/testing version of the `create-solana-dapp` tool, and the specific version will
normally include such a `beta` flag in it:

```shell
pnpm version <x.y.z>
pnpm release:next
```
This repository uses [changesets](https://github.com/changesets/changesets) to control version bumps and generate a
changelog (which will include each merged PR).

This will allow anyone to use the current beta/next version of the CLI using the following command:
To create a new changeset entry, run the following command and follow the prompts to select a semver tag and changelog
entry:

```shell
pnpx create-solana-dapp@next
# Or use: npx create-solana-dapp@next / Yarn sadly can't do this with arbitrary tags.
changeset
```

### `latest` tag
After PRs are merged with a changeset entry, a bot will automatically create a "Version Packages" PR with a list of
changes since the last published `latest` version. This version PR can be merged to auto update the package version
number accordingly, publish the new version to npm with the `latest` tag, and update the changelog entry for the new
version.

The `latest` tag is considered the production/stable version of the `create-solana-dapp` tool. To publish to the
`latest` tag:
## Publishing new versions

```shell
pnpm version <x.y.z>
pnpm release
```
New versions of `create-solana-dapp` are published via the GitHub Actions CI/CD.

This will allow anyone to use the current production/stable version of the CLI using the following command:
When a PR is merged to the `main` branch, a canary release will be published and tagged with `canary` with all the
merged changes.

```shell
pnpx create-solana-dapp@latest
# Or use: npx create-solana-dapp@latest / yarn create solana-dapp
```
When the changeset bot generated "Version Packages" PR is merged, the `latest` version will be published via Github
Actions.
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,15 @@
"dev": "vitest dev",
"lint": "eslint . && prettier -c .",
"lint:fix": "automd && eslint . --fix && prettier -w .",
"prepack": "pnpm build",
"release": "pnpm build && pnpm test && npm publish --tag latest && git push --follow-tags",
"release:next": "pnpm build && pnpm test && npm publish --tag next && git push --follow-tags",
"prepublishOnly": "pnpm pkg delete devDependencies",
"publish-impl": "npm view $npm_package_name@$npm_package_version > /dev/null 2>&1 || pnpm publish --tag ${PUBLISH_TAG:-canary} --access public --no-git-checks",
"publish-packages": "pnpm prepublishOnly && pnpm publish-impl",
"test": "pnpm lint && pnpm test:types && vitest run --coverage",
"test:types": "tsc --noEmit --skipLibCheck"
},
"devDependencies": {
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.10",
"@types/mock-fs": "^4.13.4",
"@types/node": "^22.13.1",
"@types/semver": "^7.5.8",
Expand Down
Loading