Skip to content

Commit

Permalink
chore: add new cli
Browse files Browse the repository at this point in the history
  • Loading branch information
beeman committed Sep 18, 2024
1 parent 6bba157 commit 0c47abb
Show file tree
Hide file tree
Showing 41 changed files with 7,143 additions and 18 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: autofix.ci # needed to securely identify the workflow

on:
pull_request:
push:
branches: ['main', 'next']

permissions:
contents: read

jobs:
autofix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- run: pnpm install
- run: pnpm lint:fix
- uses: autofix-ci/action@ff86a557419858bb967097bfc916833f5647fa8c
with:
commit-message: 'chore: apply automated updates'
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: ci

on:
push:
branches:
- main
- next
pull_request:
branches:
- main
- next

jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- run: pnpm install
- run: pnpm lint
- run: pnpm test:types
- run: pnpm build
- run: pnpm vitest --coverage
135 changes: 134 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1 +1,134 @@
# CONTRIBUTING TBD
# Contributing to create-solana-dapp

We love your input! We want to make contributing to this project as easy and transparent as possible, whether it's:

- Reporting a bug
- Discussing the current state of the code
- Submitting a fix
- Proposing new features
- Becoming a maintainer

## We Develop with GitHub

We use GitHub to host code, to track issues and feature requests, as well as accept pull requests.

## We use [GitHub Flow](https://guides.github.com/introduction/flow/index.html), so all code changes happen through pull requests

Pull requests are the best way to propose changes to the codebase. We actively welcome your pull requests:

1. Fork the repo and create your branch from `main`.
2. If you've added code that should be tested, add tests.
3. If you've changed APIs, update the documentation.
4. Ensure the test suite passes.
5. Make sure your code lints.
6. Issue that pull request!

## Any contributions you make will be under the MIT Software License

In short, when you submit code changes, your submissions are understood to be under the same
[MIT License](https://choosealicense.com/licenses/mit/) that covers the project.

## Report bugs using GitHub's [issues](https://github.com/solana-developers/create-solana-dapp/issues)

We use GitHub issues to track public bugs. Report a bug by
[opening a new issue](https://github.com/solana-developers/create-solana-dapp/issues/new); it's that easy!

**Great Bug Reports** tend to have:

- A quick summary and/or background
- Steps to reproduce
- Be specific!
- Give sample code if you can.
- What you expected would happen
- What actually happens
- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)

People _love_ thorough bug reports.

## Use a Consistent Coding Style

- 2 spaces for indentation rather than tabs
- You can try running `pnpm lint` for style unification

## Development Workflow

In this section, you'll find the basic commands you need to run for building, testing, and maintaining the quality of
the codebase.

### Building the Project

To compile the project and generate the necessary artifacts, use the build command:

```shell
pnpm build
```

You can build the project in watch mode by using the following command for faster feedback:

```shell
pnpm build:watch
```

### Running Tests

To ensure your contributions do not break any existing functionality, run the test suite with the following command:

```shell
pnpm test
```

You can run the tests in watch mode by running the following command for faster feedback:

```shell
pnpm dev
```

### Linting Your Code

It's important to maintain the coding standards of the project. Lint your code by executing:

```shell
pnpm lint
```

### Working on the CLI

If you want to quickly test your changes to the CLI, you can do the following:

#### create-solana-dapp

Run the build in watch mode in one terminal:

```shell
pnpm build:watch
```

In another terminal, move to the directory where you want to test the `create-solana-dapp` CLI and run by invoking the
`node` command with the path to the compiled CLI:

```shell
cd /tmp
node ~/path/to/create-solana-dapp/dist/bin/index.cjs --help
```

### Committing Your Changes

We follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification for commit:

- `fix`: a commit of the type fix patches a bug in your codebase (this correlates with PATCH in semantic versioning).
- `feat`: a commit of the type feat introduces a new feature to the codebase (this correlates with MINOR in semantic
versioning).
- `BREAKING CHANGE`: a commit that has the text BREAKING CHANGE: at the beginning of its optional body or footer section
introduces a breaking API change (correlating with MAJOR in semantic versioning). A BREAKING CHANGE can be part of
commits of any type.
- Others: commit types other than fix: and feat: are allowed, for example @commitlint/config-conventional (based on the
Angular convention) recommends build:, chore:, ci:, docs:, style:, refactor:, perf:, test:, and others.

## License

By contributing, you agree that your contributions will be licensed under its MIT License.

## References

This document was adapted from the open-source contribution guidelines for
[Facebook's Draft](https://github.com/facebook/draft-js/blob/master/CONTRIBUTING.md)
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Solana Foundation
Copyright (c) 2022-2024 Solana Foundation

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
42 changes: 41 additions & 1 deletion MAINTAINERS.md
Original file line number Diff line number Diff line change
@@ -1 +1,41 @@
# MAINTAINERS TBD
# Maintaining create-solana-dapp

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

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 will allow anyone to use the current beta/next version of the CLI using the following command:

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

### `latest` tag

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

```shell
pnpm version <x.y.z>
pnpm release
```

This will allow anyone to use the current production/stable version of the CLI using the following command:

```shell
pnpx create-solana-dapp@latest
# Or use: npx create-solana-dapp@latest / yarn create solana-dapp
```
24 changes: 10 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@ npx create-solana-dapp@latest

The following UI frameworks are supported within `create-solana-dapp`:

- ReactJS
- NextJS
- Next.js
- [Next.js + Tailwind CSS (no Anchor)](https://github.com/solana-developers/template-next-tailwind)
- [Next.js + Tailwind CSS + Anchor Basic Example](https://github.com/solana-developers/template-next-tailwind-basic)
- [Next.js + Tailwind CSS + Anchor Counter Example](https://github.com/solana-developers/template-next-tailwind-counter)
- React with Vite
- [React with Vite + Tailwind CSS (no Anchor)](https://github.com/solana-developers/template-react-vite-tailwind)
- [React with Vite + Tailwind CSS + Anchor Basic Example](https://github.com/solana-developers/template-react-vite-tailwind-basic)
- [React with Vite + Tailwind CSS + Anchor Counter Example](https://github.com/solana-developers/template-react-vite-tailwind-counter)

### Planned frameworks to support

Expand All @@ -23,18 +29,12 @@ The following UI frameworks are planned and expected to be supported in the futu
- Svelte
- React Native

## Supported onchain program frameworks
## Supported on-chain program frameworks

The following on-chain programs (aka smart contracts) frameworks are supported within `create-solana-dapp`:

- Anchor

## Packages

This projects operates as an NX monorepo that requires each of the child packages deployed to the NPM package registry:

- [create-solana-dapp](./packages/create-solana-dapp): The CLI tool that generates a new project.

## Contributing

Contributions are welcome! Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for more info.
Expand All @@ -55,13 +55,9 @@ To install the project locally, run the following commands:
git clone https://github.com/solana-developers/create-solana-dapp.git
cd create-solana-dapp
pnpm install
pnpm run build
pnpm build
```
### Local registry

The `create-solana-dapp` CLI uses a local registry to publish packages to.

```
Detailed instructions on the local development workflow are outlined in the
Expand Down
22 changes: 22 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import unjs from 'eslint-config-unjs'

export default unjs({
ignores: [
// ignore paths
'coverage',
'dist',
'node_modules',
'tmp',
],
rules: {
// rule overrides
'unicorn/no-array-reduce': 'off',
'unicorn/no-process-exit': 'off',
'unicorn/prefer-top-level-await': 'off',
},
markdown: {
rules: {
// markdown rule overrides
},
},
})
Loading

0 comments on commit 0c47abb

Please sign in to comment.