Skip to content

Commit ba6ce49

Browse files
Dargon789beemanap211unitechgithub-actions[bot]0xObsidian
authored
chore: add eslint-plugin-sort and eslint-plugin-prettier (#20)
* wip * feat: add list-template-ids option * chore: use list-template-ids to dynamically populate template list * chore: run e2e test nightly and with dispatch * chore: update dependencies * chore: add eslint-plugin-sort and eslint-plugin-prettier * chore: add lefthook to automate linting/formatting * fix: file/folder renaming and content replacement in init script (solana-foundation#196) * fix: fully support file/folder renaming and content replacement in init script * chore: remove extra underscrore * fix: logging and avoid inline if-statements * Revert "fix: file/folder renaming and content replacement in init script (solana-foundation#196)" (solana-foundation#203) This reverts commit 096f365. * chore: publish PRs to pkg.pr.new (solana-foundation#204) * feat: add --minimal flag to that selects 'gill-next-tailwind-minimal' * fix: update solana docs url * Version Packages (solana-foundation#206) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix(test): error handling in search-and-replace test Description ----------- The "should handle errors gracefully" test was intentionally triggering errors to verify error handling, but `console.error` was not mocked to suppress output, causing noisy `stderr` logs during test despite all tests passing. Testing the introduced fix -------------------------- ``` npm run test ``` All tests will now pass cleanly without `stderr` error output. * refactor: remove repokit dependency and replace with local utilities * fix: update imports and Zod types for compatibility * Version Packages * fix: run ci script as part of e2e test * test: skip community in regular tests * skip again test workflow on PR since we tested it now skips community * feat: make Kit Framework templates the default * fix: remove buggy deduplication in init-script-rename * chore: remove test templates job (solana-foundation#221) * fix: apply path rename only to entry name, not full path * Version Packages * fix: enable automated npm publish to latest tag * Version Packages * feat: show setup progress for anchor templates Add a dedicated task that runs the `setup` script (if present) with a descriptive message "Running setup (building program, generating client)" to improve UX during anchor template installation. * Version Packages * feat: support local template install for testing * feat: add warning for installing local templates * Potential fix for code scanning alert no. 1: Regular expression injection (#8) Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * fix: upgrade zod from 4.1.5 to 4.1.8 (#3) Snyk has created this PR to upgrade zod from 4.1.5 to 4.1.8. See this package in npm: zod See this project in Snyk: https://app.snyk.io/org/apichanmittare/project/0c3e0cce-7a92-4f94-90ba-e7eaa0eac00f?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot <snyk-bot@snyk.io> * fix: upgrade commander from 14.0.0 to 14.0.1 (#4) Snyk has created this PR to upgrade commander from 14.0.0 to 14.0.1. See this package in npm: commander See this project in Snyk: https://app.snyk.io/org/apichanmittare/project/0c3e0cce-7a92-4f94-90ba-e7eaa0eac00f?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot <snyk-bot@snyk.io> * fix: upgrade semver from 7.7.2 to 7.7.3 (#5) Snyk has created this PR to upgrade semver from 7.7.2 to 7.7.3. See this package in npm: semver See this project in Snyk: https://app.snyk.io/org/apichanmittare/project/0c3e0cce-7a92-4f94-90ba-e7eaa0eac00f?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot <snyk-bot@snyk.io> * Version Packages (solana-foundation#206) (#7) * fix: update solana docs url * Version Packages (solana-foundation#206) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix(test): error handling in search-and-replace test Description ----------- The "should handle errors gracefully" test was intentionally triggering errors to verify error handling, but `console.error` was not mocked to suppress output, causing noisy `stderr` logs during test despite all tests passing. Testing the introduced fix -------------------------- ``` npm run test ``` All tests will now pass cleanly without `stderr` error output. * refactor: remove repokit dependency and replace with local utilities * fix: update imports and Zod types for compatibility * Version Packages * fix: run ci script as part of e2e test * test: skip community in regular tests * skip again test workflow on PR since we tested it now skips community * feat: make Kit Framework templates the default * fix: remove buggy deduplication in init-script-rename * chore: remove test templates job (solana-foundation#221) * fix: apply path rename only to entry name, not full path * Version Packages * fix: enable automated npm publish to latest tag * Version Packages * feat: show setup progress for anchor templates Add a dedicated task that runs the `setup` script (if present) with a descriptive message "Running setup (building program, generating client)" to improve UX during anchor template installation. * Version Packages * feat: support local template install for testing * feat: add warning for installing local templates --------- Co-authored-by: Bram Borggreve <beeman@beeman.nl> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: 0xObsidian <131651958+0xObsidian@users.noreply.github.com> Co-authored-by: guibibeau <g.bibeaulaviolette@gmail.com> Co-authored-by: Gui Bibeau <GuiBibeau@gmail.com> Co-authored-by: Sourav Mishra <sourav.m.bt@gmail.com> * Create config.yml (#13) * Create config.yml 148313f 484b187 49c4050 4539b38 Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com> * Update .circleci/config.yml Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com> --------- Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com> Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> * Add .circleci/config.yml (#14) * feat: support `in` alias for rename entries (#15) in commit `813773d4`, @beeman mentioned that `paths` should be renamed to `in`. This PR basically adds support for it + maintain backward compatibility. Feat added ---------- - Accepts `in` alias alongside `paths` in rename entries - Normalizes `in` to `paths` in `InitScriptSchemaRename` - Added tests for alias and existing `paths` behavior Implementation test ------------------- pnpm vitest run test/init-script-schema.test.ts pnpm test Co-authored-by: 0xObsidian <131651958+0xObsidian@users.noreply.github.com> * Update publish-pkg-pr-new.yml (#18) Replace the GitHub Actions-based npm snapshot publishing workflow with a CircleCI-style workflow that runs tests using Bun via the CircleCI Node orb. CI: Introduce a new CircleCI-style test job using the node orb and Bun to run the test suite. Remove the previous GitHub Actions steps that built the project and published npm snapshots to pkg.pr.new. Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com> --------- Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com> Co-authored-by: Bram Borggreve <beeman@beeman.nl> Co-authored-by: Arjun Porwal <65214523+ap211unitech@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: 0xObsidian <131651958+0xObsidian@users.noreply.github.com> Co-authored-by: guibibeau <g.bibeaulaviolette@gmail.com> Co-authored-by: Gui Bibeau <GuiBibeau@gmail.com> Co-authored-by: Sourav Mishra <sourav.m.bt@gmail.com> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Co-authored-by: snyk-bot <snyk-bot@snyk.io> Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
1 parent 891a380 commit ba6ce49

54 files changed

Lines changed: 3017 additions & 1539 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/config.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Use the latest 2.1 version of CircleCI pipeline process engine.
2+
# See: https://circleci.com/docs/reference/configuration-reference
3+
version: 2.1
4+
5+
# Define a job to be invoked later in a workflow.
6+
# See: https://circleci.com/docs/guides/orchestrate/jobs-steps/#jobs-overview & https://circleci.com/docs/reference/configuration-reference/#jobs
7+
jobs:
8+
say-hello:
9+
# Specify the execution environment. You can specify an image from Docker Hub or use one of our convenience images from CircleCI's Developer Hub.
10+
# See: https://circleci.com/docs/guides/execution-managed/executor-intro/ & https://circleci.com/docs/reference/configuration-reference/#executor-job
11+
docker:
12+
# Specify the version you desire here. Pin to a specific tag for reproducible builds.
13+
# See: https://circleci.com/developer/images/image/cimg/base
14+
- image: cimg/base:2024.01
15+
16+
# Add steps to the job
17+
# See: https://circleci.com/docs/guides/orchestrate/jobs-steps/#steps-overview & https://circleci.com/docs/reference/configuration-reference/#steps
18+
steps:
19+
# Checkout the code as the first step.
20+
- checkout
21+
- run:
22+
name: "Say hello"
23+
command: "echo Hello, World!"
24+
25+
# Orchestrate jobs using workflows
26+
# See: https://circleci.com/docs/guides/orchestrate/workflows/ & https://circleci.com/docs/reference/configuration-reference/#workflows
27+
workflows:
28+
say-hello-workflow: # This is the name of the workflow, feel free to change it to better match your workflow.
29+
# Inside the workflow, you define the jobs you want to run.
30+
jobs:
31+
- say-hello

.github/workflows/actions/install-dependencies/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ runs:
1212
- name: Install package manager
1313
uses: pnpm/action-setup@v3
1414
with:
15-
version: 10.5.2
15+
version: 10.15.1
1616

1717
- name: Setup Node
1818
uses: actions/setup-node@v4

.github/workflows/e2e-test.yml

Lines changed: 0 additions & 92 deletions
This file was deleted.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Publish pkg.pr.new
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
7+
env:
8+
# See https://consoledonottrack.com/
9+
DO_NOT_TRACK: '1'
10+
11+
version: '2.1'
12+
orbs:
13+
node: circleci/node@x.y
14+
jobs:
15+
test:
16+
executor: node/default
17+
steps:
18+
- checkout
19+
- node/install-bun:
20+
version: 1.2.22
21+
- node/install-packages:
22+
pkg-manager: bun
23+
- run: bun run test
24+
workflows:
25+
test_my_app:
26+
jobs:
27+
- test
28+
29+

.husky/pre-commit

Lines changed: 0 additions & 7 deletions
This file was deleted.

.husky/pre-push

Lines changed: 0 additions & 4 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,83 @@
11
# create-solana-dapp
22

3+
## 4.8.2
4+
5+
### Patch Changes
6+
7+
- [#225](https://github.com/solana-foundation/create-solana-dapp/pull/225)
8+
[`25155c5`](https://github.com/solana-foundation/create-solana-dapp/commit/25155c503ddac9ce9092880db31dce67ca217bfd)
9+
Thanks [@GuiBibeau](https://github.com/GuiBibeau)! - feat: show setup progress for anchor templates
10+
11+
## 4.8.1
12+
13+
### Patch Changes
14+
15+
- [#223](https://github.com/solana-foundation/create-solana-dapp/pull/223)
16+
[`c5bde70`](https://github.com/solana-foundation/create-solana-dapp/commit/c5bde70d60ed2d0457550dfaf440e084c284b5d1)
17+
Thanks [@GuiBibeau](https://github.com/GuiBibeau)! - fix: enable automated npm publish to `latest` tag
18+
19+
## 4.8.0
20+
21+
### Minor Changes
22+
23+
- [#218](https://github.com/solana-foundation/create-solana-dapp/pull/218)
24+
[`d72efe7`](https://github.com/solana-foundation/create-solana-dapp/commit/d72efe79b0c92c7a1d638ea674cd8b16db466d0e)
25+
Thanks [@GuiBibeau](https://github.com/GuiBibeau)! - Make Kit Framework templates the default choice instead of Gill.
26+
- Kit Framework is now the first and recommended option
27+
- Removed Node.js template option
28+
- Web3.js templates moved to bottom and marked as deprecated
29+
- Updated `--minimal` flag to use Kit's `nextjs` template
30+
31+
### Patch Changes
32+
33+
- [#220](https://github.com/solana-foundation/create-solana-dapp/pull/220)
34+
[`1f73c77`](https://github.com/solana-foundation/create-solana-dapp/commit/1f73c7738388233d85fb350cc73a8df387b62136)
35+
Thanks [@GuiBibeau](https://github.com/GuiBibeau)! - Fix init script rename failing with mismatched array lengths. The
36+
deduplication logic was breaking the 1:1 correspondence between from and to arrays.
37+
38+
- [#222](https://github.com/solana-foundation/create-solana-dapp/pull/222)
39+
[`476ba8f`](https://github.com/solana-foundation/create-solana-dapp/commit/476ba8fa3a3b2f6ea1f672031c615e1765c73930)
40+
Thanks [@GuiBibeau](https://github.com/GuiBibeau)! - Fix renamePaths applying string replacement to full absolute path
41+
instead of entry name only. This caused path duplication when the project name contained the template name (e.g.,
42+
creating "test-kit-nextjs" from template "nextjs" would try to rename to "test-kit-test-kit-nextjs").
43+
44+
## 4.7.1
45+
46+
### Patch Changes
47+
48+
- [#212](https://github.com/solana-foundation/create-solana-dapp/pull/212)
49+
[`8e1a20f`](https://github.com/solana-foundation/create-solana-dapp/commit/8e1a20ff0e49a5a7c1abdfe83e41187953d0dc44)
50+
Thanks [@GuiBibeau](https://github.com/GuiBibeau)! - Remove repokit dependency and replace with local utilities. This
51+
change eliminates the external `@beeman/repokit` canary dependency and replaces it with three local utility modules
52+
that provide the same functionality:
53+
- `src/utils/template-schema.ts` - Zod schemas and TypeScript types for template validation
54+
- `src/utils/fetch-templates.ts` - Fetches and parses templates.json from remote URLs
55+
- `src/utils/menu-utils.ts` - Menu transformation logic for template selection
56+
57+
This change maintains full backward compatibility with existing templates.json format while adding support for new
58+
optional metadata fields (displayName, usecase, image) introduced in solana-foundation/templates#170.
59+
60+
Benefits:
61+
- No dependency on external canary releases
62+
- Full control over template parsing logic
63+
- Smaller bundle size (only code actually used)
64+
- Type-safe with Zod validation
65+
- Easier to maintain and debug
66+
67+
## 4.7.0
68+
69+
### Minor Changes
70+
71+
- [#205](https://github.com/solana-foundation/create-solana-dapp/pull/205)
72+
[`49c4050`](https://github.com/solana-foundation/create-solana-dapp/commit/49c40509000d2e5987aa30b513ae1343157cab8e)
73+
Thanks [@beeman](https://github.com/beeman)! - add `--minimal` flag to that selects 'gill-next-tailwind-minimal'
74+
75+
### Patch Changes
76+
77+
- [#207](https://github.com/solana-foundation/create-solana-dapp/pull/207)
78+
[`cea96d8`](https://github.com/solana-foundation/create-solana-dapp/commit/cea96d88dec5c79bb204b39b940147c3fb7a69d9)
79+
Thanks [@beeman](https://github.com/beeman)! - update solana docs url
80+
381
## 4.6.0
482

583
### Minor Changes

eslint.config.mjs

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,36 @@
11
import unjs from 'eslint-config-unjs'
2+
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
3+
import sort from 'eslint-plugin-sort'
24

3-
export default unjs({
4-
ignores: [
5-
// ignore paths
6-
'coverage',
7-
'dist',
8-
'node_modules',
9-
'tmp',
10-
],
11-
rules: {
12-
// rule overrides
13-
'@typescript-eslint/no-require-imports': 'off',
14-
'unicorn/no-array-reduce': 'off',
15-
'unicorn/no-process-exit': 'off',
16-
'unicorn/prefer-top-level-await': 'off',
5+
export default unjs(
6+
{
7+
ignores: [
8+
// ignore paths
9+
'coverage',
10+
'dist',
11+
'node_modules',
12+
'tmp',
13+
],
14+
markdown: {
15+
rules: {
16+
// markdown rule overrides
17+
},
18+
},
19+
rules: {
20+
// rule overrides
21+
'@typescript-eslint/no-require-imports': 'off',
22+
'unicorn/no-array-reduce': 'off',
23+
'unicorn/no-process-exit': 'off',
24+
'unicorn/prefer-top-level-await': 'off',
25+
},
1726
},
18-
markdown: {
27+
sort.configs['flat/recommended'],
28+
{
1929
rules: {
20-
// markdown rule overrides
30+
'sort/string-enums': 'error',
31+
'sort/string-unions': 'error',
32+
'sort/type-properties': 'error',
2133
},
2234
},
23-
})
35+
eslintPluginPrettierRecommended,
36+
)

lefthook.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
pre-commit:
2+
parallel: true
3+
jobs:
4+
- name: Lint files
5+
exclude:
6+
- '*.json'
7+
- '*.yaml'
8+
- '*.yml'
9+
run: pnpm lint --fix {staged_files}
10+
stage_fixed: true
11+
- name: Format files
12+
glob:
13+
- '*.json'
14+
- '**/*.json'
15+
run: pnpm prettier --write {staged_files}

0 commit comments

Comments
 (0)