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: replace rushjs with moon #205

Draft
wants to merge 28 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
c7b2573
feat: use proto to fix binary version od Node.js and pnpm
bgatellier Jun 1, 2024
fb7354e
feat: add moon plugin
bgatellier Jun 1, 2024
71a1ba4
feat: add workspace and projects metadata
bgatellier Jun 1, 2024
68355a1
fix: do not take into account abandoned packages
bgatellier Jun 1, 2024
22da8ab
feat: setup the toolchain
bgatellier Jun 1, 2024
f738429
feat: define pnpm workspace
bgatellier Jun 1, 2024
8253959
feat: set default package manager and sync reference in tsconfig
bgatellier Jun 1, 2024
e2708e6
feat: set tasks
bgatellier Jun 1, 2024
290c535
feat: put contributors tools to the root of the workspace
bgatellier Jun 1, 2024
6bb68d9
refactor: remove explicit dependencies, as the node plugin can guess …
bgatellier Jun 1, 2024
645c15a
feat: fix build
bgatellier Jun 1, 2024
5e93776
feat: replace eslint and prettier by biome
bgatellier Jun 1, 2024
cbd79db
feat: add format and lint pre-commit hook
bgatellier Jun 1, 2024
8393470
refactor: autofix lint & format
bgatellier Jun 2, 2024
18289f3
fgeat: move the lint operation to the pre-push event
bgatellier Jun 2, 2024
075e78f
chore: files cleanup
bgatellier Jun 2, 2024
938ead4
refactor: remove duplicates declarations
bgatellier Jun 2, 2024
e2055cc
feat: add VSCode extensions suggestions
bgatellier Jun 2, 2024
2cca2dd
refactor: move rimraf to developer tools dependencies
bgatellier Jun 2, 2024
a10af3c
chore: remove unused file and npm scripts
bgatellier Jun 2, 2024
f03792a
feat: add new module creation CLI
bgatellier Jun 2, 2024
c58d11b
fix: moon plugin download URL
bgatellier Jun 10, 2024
5fc6c9d
chore: fix lock file
bgatellier Jun 14, 2024
5c7a09e
chore: cleanup files
bgatellier Jun 17, 2024
d1afccf
refactor: standardized tsconfig files
bgatellier Jun 17, 2024
001fcf7
chore: upgrade dependencies, especially biome to >1.8.0
bgatellier Jun 17, 2024
c258536
feat: make the lint and format tasks fix the code
bgatellier Jun 17, 2024
9fdd274
refactor: replace jest by vitest, and rework some existing tests
bgatellier Jun 18, 2024
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
11 changes: 0 additions & 11 deletions .gitattributes

This file was deleted.

23 changes: 9 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
# Dependency directories
node_modules/

# Optional eslint cache
.eslintcache

# Coverage report
coverage

Expand All @@ -17,20 +14,18 @@ coverage
.env

# Common toolchain intermediate files
lib
lib/

# OS X temporary files
.DS_Store

# Rush temporary files
common/deploy/
common/temp/
common/autoinstallers/*/.npmrc
**/.rush/temp/

# Visual Studio Code
.vscode

# MikroORM temporary directory
modules/*/temp
test/temp
test/temp

# moon
.moon/cache
.moon/docker

# Build cache manifests
*.tsbuildinfo
8 changes: 8 additions & 0 deletions .moon/hooks/pre-commit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -eo pipefail

# Automatically generated by moon. DO NOT MODIFY!
# https://moonrepo.dev/docs/guides/vcs-hooks

moon run :format --affected --status=staged -- --staged --files-ignore-unknown=true --no-errors-on-unmatched

8 changes: 8 additions & 0 deletions .moon/hooks/pre-push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -eo pipefail

# Automatically generated by moon. DO NOT MODIFY!
# https://moonrepo.dev/docs/guides/vcs-hooks

moon run :lint --affected --status=staged -- --staged --files-ignore-unknown=true --no-errors-on-unmatched

19 changes: 19 additions & 0 deletions .moon/tasks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
tasks:
build:
command: tsc --project tsconfig.build.json
deps:
- ~:cleanup
cleanup:
command: rimraf lib
format:
command: pnpm biome format --write
options:
affectedFiles: true
affectedPassInputs: true
lint:
command: pnpm biome lint --write
options:
affectedFiles: true
affectedPassInputs: true
test:
command: vitest run
7 changes: 7 additions & 0 deletions .moon/toolchain.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
$schema: 'https://moonrepo.dev/schemas/toolchain.json'

node:
packageManager: pnpm

typescript:
syncProjectReferences: true
43 changes: 43 additions & 0 deletions .moon/workspace.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# https://moonrepo.dev/docs/config/workspace
$schema: 'https://moonrepo.dev/schemas/workspace.json'

# Require a specific version of moon while running commands, otherwise fail.
# versionConstraint: '>=1.0.0'

# Extend and inherit an external configuration file. Must be a valid HTTPS URL or file system path.
# extends: './shared/workspace.yml'

# REQUIRED: A map of all projects found within the workspace, or a list or file system globs.
# When using a map, each entry requires a unique project ID as the map key, and a file system
# path to the project folder as the map value. File paths are relative from the workspace root,
# and cannot reference projects located outside the workspace boundary.
projects:
- 'modules/*/moon.yml'

# Configures the version control system to utilize within the workspace. A VCS
# is required for determining touched (added, modified, etc) files, calculating file hashes,
# computing affected files, and much more.
vcs:
# The client to use when managing the repository.
# Accepts "git". Defaults to "git".
manager: 'git'

# The default branch (master/main/trunk) in the repository for comparing the
# local branch against. For git, this is is typically "master" or "main",
# and must include the remote prefix (before /).
defaultBranch: 'main'

provider: github

syncHooks: true

hooks:
pre-commit:
# --affected with the tasks options affectedFiles: true and affectedPassInputs: true allows to reduce the set of files needed to allow a project to match.
# https://moonrepo.dev/docs/guides/vcs-hooks#pre-commit
#
# --staged will run the operation only on the staged files that match the biome.jssonc::files.includes patterns
# https://biomejs.dev/reference/cli/#biome-lint
- 'moon run :format --affected --status=staged -- --staged --files-ignore-unknown=true --no-errors-on-unmatched'
pre-push:
- 'moon run :lint --affected --status=staged -- --staged --files-ignore-unknown=true --no-errors-on-unmatched'
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

53 changes: 0 additions & 53 deletions .prettierignore

This file was deleted.

5 changes: 0 additions & 5 deletions .prettierrc.yaml

This file was deleted.

7 changes: 7 additions & 0 deletions .prototools
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
moon = "~1"
node = "~18"
pnpm = "~8"

[plugins]
# do not use master at the moment, as there is an error that disallow the install moon
moon = "source:https://raw.githubusercontent.com/moonrepo/moon/ef641b0e91e3096846c80a1ba058d44f534afe9d/proto-plugin.toml"
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"moonrepo.moon-console",
"biomejs.biome"
]
}
24 changes: 24 additions & 0 deletions biome.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"$schema": "https://biomejs.dev/schemas/1.7.3/schema.json",
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"files": {
"include": [
"src/**/*.ts",
"tests/**/*.ts"
]
},
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true,
"defaultBranch": "main"
}
}
10 changes: 0 additions & 10 deletions common/autoinstallers/rush-prettier/package.json

This file was deleted.

Loading
Loading