This repository has been archived by the owner on Oct 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ci(react-ui): migrate project to use moon * ci(main-db): migrate project to use moon * ci: migrate website and react-ui to moon * ci: migrate to using moon * style(protobuf): remove needless borrow * ci(main-db): add command to lint target * ci: remove files from eslint and jest * ci: remove last references to nrwl Also bring back the commit scripts. * ci: fail clippy check on warnings * ci(devcontainer): install moon globally in development environment * ci(moon): remove typecheck task * ci(moon): configure local tasks This enables us to use the `moon check` command that does things parallely. * refactor(website): use path alias for imports * ci(main-db): add empty line between tasks * ci(moon): use noop command to make commands do nothing
- Loading branch information
Showing
90 changed files
with
1,864 additions
and
6,182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
node_modules | ||
*.min.js | ||
*.map | ||
*.snap | ||
dts | ||
coverage | ||
jest.config.* | ||
dbschema | ||
build | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module.exports = { | ||
root: true, | ||
extends: ['moon'], | ||
rules: { | ||
'import/no-extraneous-dependencies': [ | ||
'error', | ||
{ | ||
devDependencies: true, | ||
}, | ||
], | ||
'no-console': 'error', | ||
'no-await-in-loop': 'off', | ||
}, | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
project: 'tsconfig.eslint.json', | ||
tsconfigRootDir: __dirname, | ||
}, | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,6 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
two_commits_ago="$(git log --format="%H" -n 2 | tail -n 1)" | ||
# check if remotes exist | ||
if [ "$(git remote)" ]; then | ||
branch_exists=$(git ls-remote --heads origin $(git branch --show-current)) | ||
# if branch_exists is empty, then the branch does not exist in the remote | ||
if [ -z "$branch_exists" ]; then | ||
# use $two_commits_ago if the current branch does not exist in the remote | ||
last_remote_commit=$two_commits_ago | ||
else | ||
# a remote may exist but it might not have commits, so we will use the last local one | ||
last_remote_commit=$(git rev-parse origin/"$(git branch --show-current)") || $two_commits_ago | ||
fi | ||
fi | ||
last_local_commit=$(git log --format="%H" -n 1 | tail -n 1) | ||
# detect force push, ref: https://github.com/kyanny/git-hooks-detect-force-update | ||
if [ "$(git rev-list "$last_remote_commit" ^"$last_local_commit")" ]; then | ||
echo "Force push detected..." | ||
last_remote_commit="$two_commits_ago" | ||
fi | ||
echo "Setting base=\"$last_remote_commit\" and head=\"$last_local_commit\"" | ||
for target in "lint" "build" "test"; do | ||
pnpm nx affected \ | ||
--base="$last_remote_commit" \ | ||
--target="$target" \ | ||
--nx-bail \ | ||
--parallel=6 | ||
done | ||
cargo clippy -- -D warnings | ||
|
||
moon check "website" "react-ui" "generated" "main-db" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# https://moonrepo.dev/docs/config/global-project | ||
$schema: 'https://moonrepo.dev/schemas/global-project.json' | ||
|
||
tasks: | ||
lint: | ||
command: | ||
- 'eslint' | ||
- '--ext' | ||
- '.js,.jsx,.ts,.tsx' | ||
- '--fix' | ||
- '--report-unused-disable-directives' | ||
- '--no-error-on-unmatched-pattern' | ||
- '--exit-on-fatal-error' | ||
- '--ignore-path' | ||
- '@in(4)' | ||
- '.' | ||
inputs: | ||
- 'src/**/*' | ||
- 'tests/**/*' | ||
- '*.config.*' | ||
- '**/.eslintrc.*' | ||
- '/.eslintignore' | ||
- '/.eslintrc.*' | ||
- 'types/**/*' | ||
- 'tsconfig.json' | ||
- '/tsconfig.eslint.json' | ||
- '/tsconfig.options.json' | ||
|
||
test: | ||
command: | ||
- 'jest' | ||
- '--coverage' | ||
- '--passWithNoTests' | ||
inputs: | ||
- 'src/**/*' | ||
- 'tests/**/*' | ||
- 'jest.config.*' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# https://moonrepo.dev/docs/config/workspace | ||
$schema: 'https://moonrepo.dev/schemas/workspace.json' | ||
|
||
# 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: | ||
website: 'apps/website' | ||
generated: 'libs/generated' | ||
main-db: 'libs/main-db' | ||
react-ui: 'libs/react-ui' | ||
|
||
# Configures Node.js within the toolchain. moon manages its own version of Node.js | ||
# instead of relying on a version found on the host machine. This ensures deterministic | ||
# and reproducible builds across any machine. | ||
node: | ||
# The version to use. Must be a semantic version that includes major, minor, and patch. | ||
# We suggest using the latest active LTS version: https://nodejs.org/en/about/releases | ||
version: '19.0.0' | ||
|
||
# The package manager to use when managing dependencies. | ||
# Accepts "npm" (default), "pnpm", or "yarn". | ||
packageManager: 'pnpm' | ||
|
||
# The version of the package manager (above) to use. | ||
pnpm: | ||
version: '7.14.0' | ||
|
||
# Add `node.version` as a constraint in the root `package.json` `engines`. | ||
addEnginesConstraint: true | ||
|
||
# Use the `package.json` name as an alias for the respective moon project. | ||
# aliasPackageNames: 'name-and-scope' | ||
|
||
# Dedupe dependencies after the lockfile has changed. | ||
dedupeOnLockfileChange: true | ||
|
||
# Version format to use when syncing dependencies within the project's `package.json`. | ||
# dependencyVersionFormat: 'workspace' | ||
|
||
# Infer and automatically create moon tasks from `package.json` scripts, per project. | ||
# BEWARE: Tasks and scripts are not 1:1 in functionality, so please refer to the documentation. | ||
# inferTasksFromScripts: false | ||
|
||
# Sync a project's `dependsOn` as dependencies within the project's `package.json`. | ||
syncProjectWorkspaceDependencies: true | ||
|
||
# Sync `node.version` to a 3rd-party version manager's config file. | ||
# Accepts "nodenv" (.node-version), "nvm" (.nvmrc), or none. | ||
# syncVersionManagerConfig: 'nvm' | ||
|
||
# Configures how moon integrates with TypeScript. | ||
typescript: | ||
# When `syncProjectReferences` is enabled and a dependent project reference | ||
# *does not* have a `tsconfig.json`, automatically create one. | ||
createMissingConfig: true | ||
|
||
# Name of `tsconfig.json` file in the project root. | ||
# projectConfigFileName: 'tsconfig.json' | ||
|
||
# Name of `tsconfig.json` file in the workspace root. | ||
# rootConfigFileName: 'tsconfig.json' | ||
|
||
# Name of the config file in the workspace root that defines shared compiler options | ||
# for all project reference based config files. | ||
# rootOptionsConfigFileName: 'tsconfig.options.json' | ||
|
||
# Update the project's `tsconfig.json` to route the `outDir` to moon's cache. | ||
# routeOutDirToCache: true | ||
|
||
# Sync a project's `dependsOn` as TypeScript project references within the | ||
# project's `tsconfig.json` and the workspace root `tsconfig.json`. | ||
syncProjectReferences: true | ||
|
||
# Sync a project's project references as `paths` aliases. | ||
# syncProjectReferencesToPaths: true | ||
|
||
# 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 manager/binary to use when managing the repository. | ||
# Accepts "git", or "svn". 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 /). For svn, this should always be "trunk". | ||
defaultBranch: 'origin/main' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.