Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update to core v4 #15

Merged
merged 4 commits into from
Jun 11, 2024
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: 0 additions & 8 deletions .eslintignore

This file was deleted.

7 changes: 0 additions & 7 deletions .eslintrc.json

This file was deleted.

2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: [tresjs, jaimetorrealba, alvarosabu]
open_collective: tresjs
64 changes: 64 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: "Bug report \U0001F41B"
description: Report an issue with Tres Rapier
labels: [pending triage]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: textarea
id: bug-description
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is. If you intend to submit a PR for this issue, tell us in the description. Thanks!
placeholder: I am doing ... What I expect is ... What actually happening is ...
validations:
required: true
- type: input
id: reproduction
attributes:
label: Reproduction
description: Please provide a link via [stackblitz](https://stackblitz.com/edit/tresjs-basic?file=package.json,src%2Fcomponents%2FTheExperience.vue) or a link to a repo that can reproduce the problem you ran into. A [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) is required ([Why?](https://antfu.me/posts/why-reproductions-are-required)). If a report is vague (e.g. just a generic error message) and has no reproduction, it will receive a "need reproduction" label. If no reproduction is provided after 3 days, it will be auto-closed.
placeholder: Reproduction URL
validations:
required: true
- type: textarea
id: reproduction-steps
attributes:
label: Steps to reproduce
description: Please provide any reproduction steps that may need to be described. E.g. if it happens only when running the dev or build script make sure it's clear which one to use.
placeholder: Run `npm install` followed by `npm run dev`
- type: textarea
id: system-info
attributes:
label: System Info
description: Output of `npx envinfo --system --npmPackages '{vite,@tresjs/*, three, vue}' --binaries --browsers`
render: shell
placeholder: System, Binaries, Browsers
- type: dropdown
id: package-manager
attributes:
label: Used Package Manager
description: Select the used package manager
options:
- npm
- yarn
- pnpm
validations:
required: true
- type: checkboxes
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, please make sure you do the following
options:
- label: I agree to follow this project's [Code of Conduct](https://github.com/Tresjs/rapier/blob/main/CODE_OF_CONDUCT.md)
required: true
- label: Read the [Contributing Guidelines](https://github.com/Tresjs/rapier/blob/main/CONTRIBUTING.md).
required: true
- label: Read the [docs](https://rapier.tresjs.org/guide).
required: true
- label: Check that there isn't [already an issue](https://github.com/Tresjs/rapier/issues) that reports the same bug to avoid creating a duplicate.
required: true
- label: The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.
required: true
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
47 changes: 47 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: "New feature proposal \U0001FA90"
description: Propose a new feature to be added to Tres Rapier
labels: ["enhancement"]
body:
- type: markdown
attributes:
value: |
Thanks for your interest in the project and taking the time to fill out this feature report!
- type: textarea
id: feature-description
attributes:
label: Description
description: "Clear and concise description of the problem. Please make the reason and usecases as detailed as possible. If you intend to submit a PR for this issue, tell us in the description. Thanks!"
placeholder: As a developer using TresJS I want [goal / wish] so that [benefit].
validations:
required: true
- type: textarea
id: suggested-solution
attributes:
label: Suggested solution
description: "In module [xy] we could provide following implementation..."
validations:
required: true
- type: textarea
id: alternative
attributes:
label: Alternative
description: Clear and concise description of any alternative solutions or features you've considered.
- type: textarea
id: additional-context
attributes:
label: Additional context
description: Any other context or screenshots about the feature request here.
- type: checkboxes
id: checkboxes
attributes:
label: Validations
description: Before submitting the issue, please make sure you do the following
options:
- label: I agree to follow this project's [Code of Conduct](https://github.com/Tresjs/rapier/blob/main/CODE_OF_CONDUCT.md)
required: true
- label: Read the [Contributing Guidelines](https://github.com/Tresjs/rapier/blob/main/CONTRIBUTING.md).
required: true
- label: Read the [docs](https://rapier.tresjs.org/guide).
required: true
- label: Check that there isn't [already an issue](https://github.com/tresjs/rapier/issues) that reports the same bug to avoid creating a duplicate.
required: true
32 changes: 32 additions & 0 deletions .github/workflows/actions/pnpm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# From https://github.com/remirror/template/blob/4f8c5f5629a081217672a8cce1df085510f43913/.github/actions/pnpm/action.yml
name: 'pnpm installation'
description: 'Install and audit dependencies for pnpm'
inputs:
cache: # id of input
description: 'The location of the pnpm cache'
required: true
default: '.pnpm-store'
version: # id of input
description: 'The version to use'
required: false
default: 6.10.0

runs:
using: 'composite'
steps:
- name: install pnpm
run: npm install pnpm@${{ inputs.version }} -g
shell: bash

- name: setup pnpm config
run: pnpm config set store-dir ${{ inputs.cache }}
shell: bash

- name: install dependencies
run: pnpm install --shamefully-hoist
shell: bash

# Avoid running husky hooks on Github
# http://typicode.github.io/husky/how-to.html
env:
HUSKY: 0
17 changes: 17 additions & 0 deletions .github/workflows/lint-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: 'Lint PR'

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30 changes: 30 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Run linters
on: [push]

env:
PNPM_CACHE_FOLDER: .pnpm-store
HUSKY: 0 # Bypass husky commit hook for CI

jobs:
lint:
name: Lint
runs-on: ubuntu-20.04
strategy:
matrix:
node-version: [18]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Run Lint
run: pnpm run lint
8 changes: 8 additions & 0 deletions .husky/install.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Skip Husky install in production and CI
// http://typicode.github.io/husky/how-to.html
if (process.env.NODE_ENV === 'production' || process.env.CI === 'true') {
process.exit(0)
}
const husky = (await import('husky')).default
// eslint-disable-next-line no-console
console.log(husky())
25 changes: 25 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# NOTE: Don't fail immediately after error
# This allows us to echo messages even if the linter exits with an error.
set +e

# NOTE: --silent to keep pnpm from echoing, e.g., "> @tresjs/core[...] lint"
# --max-warnings=0 to fail on errors *and* warnings
pnpm --silent lint --max-warnings=0

# NOTE: Capture linter exit status.
LINT_STATUS=$?

# NOTE: If linting failed, inform user how to proceed.
if [[ $LINT_STATUS != 0 ]]; then
echo "
To fix linter problems:
pnpm lint --fix – fix automatically fixable problems
pnpm lint – print a list of problems to fix by hand

To skip this verification and push anyway (not recommended):
git push --no-verify <...>
"
fi

# NOTE: +e was set, so we have to return an exit status.
exit $LINT_STATUS
38 changes: 19 additions & 19 deletions .release-it.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"git": {
"commitMessage": "chore: release v${version}"
},
"github": {
"release": true,
"releaseName": "v${version}"
},
"plugins": {
"@release-it/conventional-changelog": {
"preset": "conventionalcommits",
"infile": "CHANGELOG.md"
}
},
"hooks": {
"before:init": ["pnpm run lint"],
"after:bump": "pnpm run build",
"after:git:release": "echo After git push, before github release",
"after:release": "echo Successfully released ${name} v${version} to ${repo.repository}."
"git": {
"commitMessage": "chore: release v${version}"
},
"github": {
"release": true,
"releaseName": "v${version}"
},
"plugins": {
"@release-it/conventional-changelog": {
"preset": "conventionalcommits",
"infile": "CHANGELOG.md"
}
}
},
"hooks": {
"before:init": ["pnpm run lint"],
"after:bump": "pnpm run build",
"after:git:release": "echo After git push, before github release",
"after:release": "echo Successfully released ${name} v${version} to ${repo.repository}."
}
}
6 changes: 3 additions & 3 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ Project maintainers are responsible for clarifying the standards of acceptable b

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope
## Scope

This Code of Conduct applies within all project spaces, and it also applies when an individual is representing the project or its community in public spaces. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team by DM at [TresJS Discord](https://discord.gg/UCr96AQmWn). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project’s leadership.

## Attribution
## Attribution

This Code of Conduct is adapted from the Contributor Covenant, version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
8 changes: 1 addition & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ All the packages in the ecosystem use [pnpm workspaces](https://pnpm.io/workspac

The `workspace` has the following structure:


```
.
├── docs // The documentation
Expand All @@ -44,25 +43,20 @@ If you have the package manager installed, you can install pnpm using the follow
brew install pnpm
```


## Development

To start developing, you can run `pnpm playground` in the root folder.

This will start the dev server for the playground at `http://localhost:5173/` where you can test the changes you are making in the `src` folder.

This will start the dev server for the playground at `http://localhost:5173/` where you can test the changes you are making in the `src` folder.

> **Important**
> There is no need to run anything in the `src` folder or in the root, the `playground` will take care of it


Whenever you are working on a new feature or fixing a bug, make sure to add a demo under `playground/src/pages` and create a route in the `playground/src/router.ts` to test the changes you are making.

> **Warning**
> Make sure to check if there is already a demo for the feature you are working on. If so, feel free to add your changes to the existing demo.



### Docs

The docs are built using [vitepress](https://vitepress.vuejs.org/).
Expand Down
10 changes: 10 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { tresLintConfig } from '@tresjs/eslint-config'

export default tresLintConfig({
ignores: ['dist', 'node_modules', 'public', '.github', 'docs/blog'],
}, {
rules: {
'style/max-statements-per-line': 'off',
'jsdoc/check-alignment': 'off',
},
})
9 changes: 5 additions & 4 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[build.environment]
NODE_VERSION = "18"
[build]
publish = "docs/.vitepress/dist"
command = "pnpm run build && pnpm docs:build"
publish = "docs/.vitepress/dist"
command = "pnpm run build && pnpm docs:build"

[build.environment]
NODE_VERSION = "18"
Loading
Loading