Skip to content

Commit

Permalink
feat: switch over to moonrepo
Browse files Browse the repository at this point in the history
  • Loading branch information
Suyashtnt committed May 21, 2024
1 parent 6db3a4d commit 5285b6a
Show file tree
Hide file tree
Showing 45 changed files with 3,232 additions and 7,411 deletions.
2 changes: 1 addition & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[build]
target-dir = 'dist/target'
target-dir = 'target'
20 changes: 0 additions & 20 deletions .deepsource.toml

This file was deleted.

6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@ yarn-error.log
testem.log
/typings
/.direnv
/.nx
/target

# System Files
.DS_Store
Thumbs.db

# moon
.moon/cache
.moon/docker
8 changes: 8 additions & 0 deletions .moon/hooks/commit-msg.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

pnpm commitlint --edit $1

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

pnpm moon run :lint :format --affected --status=staged

21 changes: 21 additions & 0 deletions .moon/tasks/rust-application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
$schema: 'https://moonrepo.dev/schemas/tasks.json'

tasks:
build:
command: "cargo build --release"
inputs:
- '@globs(sources)'
deps:
- '^:build'
preview:
command: "cargo run --release"
deps:
- build
- '^:build'
- '^:preview'
local: true
test:
command: 'cargo test'
inputs:
- '@globs(sources)'
- '@globs(tests)'
8 changes: 8 additions & 0 deletions .moon/tasks/rust-library.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
$schema: 'https://moonrepo.dev/schemas/tasks.json'

tasks:
test:
command: 'cargo test'
inputs:
- '@globs(sources)'
- '@globs(tests)'
35 changes: 35 additions & 0 deletions .moon/tasks/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
$schema: 'https://moonrepo.dev/schemas/tasks.json'

fileGroups:
sources:
- 'src/**/*'
- 'Cargo.toml'
tests:
- 'benches/**/*'
- 'tests/**/*'

tasks:
check:
command: 'cargo check'
inputs:
- '@globs(sources)'
format:
command: 'cargo fmt'
inputs:
- '@globs(sources)'
- '@globs(tests)'
lint:
command: noop
deps:
- lint-clippy
- lint-format
lint-clippy:
command: 'cargo clippy'
inputs:
- '@globs(sources)'
- '@globs(tests)'
lint-format:
command: 'cargo fmt --check'
inputs:
- '@globs(sources)'
- '@globs(tests)'
54 changes: 54 additions & 0 deletions .moon/tasks/tag-sveltekit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
$schema: 'https://moonrepo.dev/schemas/tasks.json'

fileGroups:
sources:
- 'src/**/*'
- 'static/**/*'
tests:
- 'tests/**/*'

tasks:
dev:
command: "vite dev"
deps:
- '^:dev'
local: true
preview:
command: "vite preview"
deps:
- build
- '^:build'
- '^:preview'
local: true
build:
command: "vite build"
inputs:
- '@globs(sources)'
outputs:
- "dist"
check:
command: "svelte-check --tsconfig ./tsconfig.json"
inputs:
- '@globs(sources)'
deps:
- sync
sync:
command: "svelte-kit sync"
inputs:
- '@globs(sources)'
test:
command: noop
deps:
- test-intergration
- test-unit
test-intergration:
command: "playwright test"
inputs:
- '@globs(sources)'
- '@globs(tests)'
test-unit:
command: "vitest run"
inputs:
- '@globs(sources)'
- '@globs(tests)'

16 changes: 16 additions & 0 deletions .moon/tasks/tasks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
$schema: 'https://moonrepo.dev/schemas/tasks.json'

tasks:
build:
deps:
- '^:build'
preview:
deps:
- build
- '^:build'
- '^:preview'
local: true
dev:
deps:
- '^:dev'
local: true
11 changes: 11 additions & 0 deletions .moon/tasks/typescript.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
$schema: 'https://moonrepo.dev/schemas/tasks.json'

fileGroups:
sources:
- 'src/**/*'

tasks:
lint:
command: 'eslint .'
format:
command: 'eslint --fix .'
45 changes: 45 additions & 0 deletions .moon/toolchain.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# https://moonrepo.dev/docs/config/toolchain
$schema: "https://moonrepo.dev/schemas/toolchain.json"

node:
# We suggest using the latest active LTS version: https://nodejs.org/en/about/releases
version: "20"

packageManager: "pnpm"

# Update whenever new major version is out
pnpm:
version: "9.0.6"

# Add `node.version` as a constraint in the root `package.json` `engines`.
addEnginesConstraint: true

# Currently buggy and dedupes even with up to date lockfiles
dedupeOnLockfileChange: false

dependencyVersionFormat: "workspace"

inferTasksFromScripts: false

# Support the "one version policy" by only declaring dependencies in the root `package.json`.
# rootPackageOnly: true

# Sync a project's relationships as `dependencies` within the project's `package.json`.
syncProjectWorkspaceDependencies: true

# Configures Rust within the toolchain.
rust:
version: "stable"
bins: ["cargo-watch"]
components: ["rustfmt", "rust-src", "rust-analyzer"]
targets: []

syncToolchainConfig: true

typescript:
createMissingConfig: true
includeProjectReferenceSources: true
includeSharedTypes: true
routeOutDirToCache: false
syncProjectReferences: true
syncProjectReferencesToPaths: true
24 changes: 24 additions & 0 deletions .moon/workspace.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
$schema: https://moonrepo.dev/schemas/workspace.json
projects:
- apps/*
- libs/*

vcs:
manager: "git"
defaultBranch: "main"
syncHooks: true
hooks:
pre-commit:
- "pnpm moon run :lint :format --affected --status=staged"
commit-msg:
- "pnpm commitlint --edit $1"

runner:
archivableTargets:
- ":check"
- ":lint"
- ":test"
- ":lint-clippy"
- ":lint-format"
- ":test-unit"
- ":test-intergration"
11 changes: 9 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{
"recommendations": ["nrwl.angular-console", "dbaeumer.vscode-eslint"]
}
"recommendations": [
"vivaxy.vscode-conventional-commits",
"rust-lang.rust-analyzer",
"svelte.svelte-vscode",
"tamasfe.even-better-toml",
"moonrepo.moon-console",
"vitest.explorer"
]
}
37 changes: 35 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,36 @@
{
"conventionalCommits.scopes": ["i18n"]
}
"eslint.workingDirectories": [
{
"mode": "auto"
}
],
"eslint.experimental.useFlatConfig": true,
"eslint.format.enable": true,
"eslint.enable": true,
"rust-analyzer.testExplorer": true,
"rust-analyzer.interpret.tests": true,
"rust-analyzer.check.command": "clippy",
"eslint.validate": [
"svelte",
"typescript",
"javascript",
"json",
"yaml"
],
"eslint.probe": [
"svelte",
"typescript",
"javascript",
"json",
"yaml"
],
"conventionalCommits.scopes": [
"copper"
],
"yaml.schemas": {
"https://moonrepo.dev/schemas/workspace.json": ".moon/workspace.yml",
"https://moonrepo.dev/schemas/project.json": "**/moon.yml",
"https://moonrepo.dev/schemas/tasks.json": ".moon/tasks/*.yml"
},
"rust-analyzer.showUnlinkedFileNotification": false
}
Loading

0 comments on commit 5285b6a

Please sign in to comment.