Skip to content

Commit

Permalink
Merge next branch - Svelte 5 migration
Browse files Browse the repository at this point in the history
  • Loading branch information
vnphanquang committed Oct 25, 2024
2 parents de89b17 + 4d5db94 commit ec5e5ab
Show file tree
Hide file tree
Showing 661 changed files with 18,936 additions and 17,839 deletions.
1 change: 1 addition & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
"updateInternalDependencies": "patch",
"ignore": []
}

15 changes: 10 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,20 @@ charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = tab
indent_size = 2
trim_trailing_whitespace = true
max_line_length = 100

[*.inject.ejs.t]
end_of_line = unset
[**.inject.ejs.t]
insert_final_newline = false

[*.md.svelte]
[**.md.svelte]
indent_size = 2
indent_style = space

[**/examples/**/*]
end_of_line = unset
[**/examples/**]
insert_final_newline = false

[*.css]
insert_final_newline = false

14 changes: 0 additions & 14 deletions .eslintignore

This file was deleted.

38 changes: 0 additions & 38 deletions .eslintrc.cjs

This file was deleted.

10 changes: 7 additions & 3 deletions .github/workflows/changesets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ env:
HUSKY: 0
jobs:
Version:
if: github.repository == 'vnphanquang/svelte-put' # prevents this action from running on forks
permissions:
contents: write # to create release (changesets/action)
id-token: write # OpenID Connect token needed for provenance
pull-requests: write # to create pull request (changesets/action)
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
Expand All @@ -23,9 +28,7 @@ jobs:
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 9
uses: pnpm/action-setup@v4
- name: Setup node
uses: actions/setup-node@v4
with:
Expand All @@ -44,3 +47,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pnpm lint-staged

41 changes: 10 additions & 31 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,32 +1,11 @@
node_modules
.next
build
dist
*.tsbuildinfo
*.gitignore
*.svg
*.lock
*.npmignore
*.sql
*.png
*.jpg
*.jpeg
*.gif
*.ico
*.sh
Dockerfile
Dockerfile.*
.env
.env.*
LICENSE
*.log
.DS_Store
.dockerignore
*.patch
*.toml
*.prisma
.svelte-kit/
*.md.svelte
types/
CHANGELOG.md
dist/
*.md.svelte
*.svg

node_modules/

# Package Managers
package-lock.json
pnpm-lock.yaml
yarn.lock

114 changes: 114 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# CONTRIBUTING

Thank you for stopping by. `svelte-put` welcomes and appreciates your contribution.

## Issues

> [!IMPORTANT]
> Before opening a new issue, [first search for existing issues][github.issues.open] to avoid duplications. When you start working on an issue, make sure you are asked to be assigned to it.
### Bug Report

Please include as much details as possible:

- steps to reproduce,
- screenshots.

### Feature Request

If you have an idea and don't know where to start yet, consider [opening a discussion][github.discussions] first. If you have a PR ready as your proposed implementation, you can [create an issue][github.issues] and a PR that references it.

## Development

This section discusses necessary steps to get `svelte-put` running on local development environment.

### Prerequisites

| Dependency | Installation | Description |
| ---------- | --------------------------------------- | ------------------------------- |
| [node] | [volta] | |
| [pnpm] | [follow guide on website][pnpm.install] | alternative to `npm` and `yarn` |

See [package.json] for preferred versions of `node` and `pnpm`.

### Monorepo

This is a monorepo managed with [pnpm] workspace and [turborepo] with the following high-level structure:

- `packages/*`: core `svelte-put/*` packages
- `sites/docs`: documentation site live at [svelte-put.vnphanquang.com](https://svelte-put.vnphanquang.com)
- `internals/*`: private helper

See [package.json at root directory](../package.json) and in each package for available npm scripts. To run package-specific npm scripts, `cd` to package or use the `filter=...` flag at root. For example, to start the documentation site, run:

```bash
pnpm dev --filter=@sites/docs
# or
cd sites/docs && pnpm dev
```

### Recommended VSCode Extensions

Search for `@recommended` in the Extension panel for quick installation (look for "Workspace Recommendations").

To extend the `@recommended` list, add the extension ID to the `extensions` array in [.vscode/extensions.json].

## Code standard

> [!IMPORTANT]
> Rules are to be broken. There will always be exceptions. The following guidelines are not set in stone, but rather a set of recommendations to help us work together more effectively.
### What is a Good Commit / Pull Request?

A commit should:

1. have a descriptive message that hints at what the commit is about, exceptionally helpful for other contributors and reviewers.
2. encapsulate a complete change, i.e a single feature, bug fix, or refactor that can make sense on its own.
3. ideally capture a working state of the application / site. If not, it should be marked as `[WIP]` in its commit message.
4. span a limited scope and has minimal footprint. If a commit does too much or has changes to many files, it is an indicator that the changes may be broken down into smaller commits.

Similarly, each pull request (PR) should work towards one issue or self-contained goal. If your PR contains a single commit, `merge rebase` (fast-forward). If there are multiple commits and you want to keep the merge history, prefer `merge commit` over `squash`, unless there are dirty commits in the branch.

### Commit Message Guidelines

We follow the [Conventional Commits][conventionalcommits] guidelines for writing git commit message. Please familiarize yourself with the guidelines and be consistent.

```bash
[feat | fix | chore](scope): "[message beginning with a verb: add | change | remove]"
```

### Code Style Enforcement

The project uses [eslint] and [prettier] for code linting and formatting. Make sure to install necessary plugins or integrations in your code editor.

[husky] & [lint-staged] is setup to run format and lint checks as a `pre-commit` [git hook](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks).

To bypass hook (not recommended, for admin only), run `git commit` with the `--no-verify` flag.

<!-- GITHUB -->

[github]: https://github.com/vnphanquang/svelte-put
[github.issues]: https://github.com/vnphanquang/svelte-put/issues?q=
[github.issues.open]: https://github.com/vnphanquang/svelte-put/issues?q=is%3Aissue+is%3Aopen
[github.discussions]: https://github.com/vnphanquang/svelte-put/discussions

<!-- LOCAL -->

[.vscode/extensions.json]: ../.vscode/extensions.json
[package.json]: ./package.json

<!-- TECHNOLOGIES -->

[husky]: https://typicode.github.io/husky/
[lint-staged]: https://github.com/okonet/lint-staged
[eslint]: https://eslint.org
[prettier]: https://prettier.io
[node]: https://nodejs.org/en/
[volta]: https://volta.sh/
[pnpm]: https://pnpm.io/
[pnpm.install]: https://pnpm.io/installation
[turborepo]: https://turbo.build/

<!-- OTHERS -->

[conventionalcommits]: https://www.conventionalcommits.org/en/v1.0.0/
Loading

0 comments on commit ec5e5ab

Please sign in to comment.