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

Setup moon monorepo #3

Merged
merged 3 commits into from
Nov 19, 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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
26 changes: 26 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.DS_Store

.cache/
.next/
.svelte-kit/

node_modules/
build/
cjs/
coverage/
dist/
dts/
esm/
lib/
mjs/
umd/
*.d.ts
*.d.cts
*.d.mts
*.min.js
*.map
*.snap

pnpm-lock.yaml
package-lock.json
yarn.lock
43 changes: 43 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// https://www.npmjs.com/package/eslint-config-moon
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.eslint.json',
tsconfigRootDir: __dirname,
},
extends: [
'moon',
'moon/node',
// Uncomment when targeting browsers
// 'moon/browser',
// Uncomment if using React
// 'moon/react',
// Uncomment if using Solid
// 'moon/solid',
],
rules: {
// Doesn't understand the new TS 4.7 imports
'import/no-unresolved': 'off',

// We need to keep "index" around in imports for extensions
'import/no-useless-path-segments': 'off',
},
overrides: [
{
files: ['apps/**/*'],
rules: {
// App pages require default exports
'import/no-default-export': 'off',
},
},
{
files: ['*.config.js', '.eslintrc.js'],
rules: {
'sort-keys': 'off',
'import/no-commonjs': 'off',
'unicorn/prefer-module': 'off',
},
},
],
};
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: 'Pipeline'
on:
push:
branches:
- 'master'
pull_request:
jobs:
ci:
name: 'CI'
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: moonrepo/setup-toolchain@v0
- run: moon ci --color --log trace
env:
MOONBASE_SECRET_KEY: ${{ secrets.MOONBASE_SECRET_KEY }}
MOONBASE_ACCESS_KEY: ${{ secrets.MOONBASE_ACCESS_KEY }}
- uses: moonrepo/run-report-action@v1
if: success() || failure()
with:
access-token: ${{ secrets.GITHUB_TOKEN }}
56 changes: 35 additions & 21 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,26 +1,40 @@
node_modules
.DS_Store

# Output
.output
.vercel
.tsc
/.svelte-kit
/build
/dist
# Logs
logs/
*.log

# OS
.DS_Store
Thumbs.db
# Cache
.eslintcache
.idea
.npm
.vscode/*
!.vscode/*.shared.json

# Directories
build/
coverage/
cjs/
dist/
dts/
esm/
lib/
mjs/
tmp/
umd/
node_modules/

# Env
.env
.env.*
!.env.example
!.env.test
# Custom
*.min.js
*.map
*.tsbuildinfo

# Vite
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
# moon
.moon/cache
.moon/dts
.moon/docker

*storybook.log
.bolt
# Apps
.output/
.svelte-kit/
.vercel/
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 :lint :format --affected --status=staged

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

tasks:
# https://moonrepo.dev/docs/guides/examples/packemon
build:
command:
- 'packemon'
- 'pack'
- '--addEngines'
- '--addExports'
- '--declaration'
inputs:
- '@globs(sources)'
- 'package.json'
- 'tsconfig.*.json'
112 changes: 112 additions & 0 deletions .moon/tasks/node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
$schema: "https://moonrepo.dev/schemas/tasks.json"

implicitDeps:
- "^:build"

implicitInputs:
- "package.json"

fileGroups:
# Application specific files
app: []
configs:
- "*.{js,json,yml,yaml}"
sources:
- "public/**/*"
- "src/**/*"
- "types/**/*"
tests:
- "tests/**/*.test.*"
- "tests/**/*.stories.*"
- "**/__tests__/**/*"
assets:
- "assets/**/*"
- "images/**/*"
- "static/**/*"
- "**/*.{scss,css}"
- "**/*.{md,mdx}"

tasks:
# https://moonrepo.dev/docs/guides/examples/prettier
format:
command:
- "prettier"
- "--ignore-path"
- "@in(0)"
- "--check"
- "."
inputs:
- "/.prettierignore"
- "/prettier.config.js"
- "@group(app)"
- "@globs(sources)"
- "@globs(tests)"
- "@globs(configs)"
- "**/*.{md,mdx}"

format-write:
command:
- "prettier"
- "--ignore-path"
- "@in(0)"
- "--write"
- "."
inputs:
- "/.prettierignore"
- "/prettier.config.js"
- "@group(app)"
- "@globs(sources)"
- "@globs(tests)"
- "@globs(configs)"
- "**/*.{md,mdx}"
local: true

# https://moonrepo.dev/docs/guides/examples/eslint
lint:
command:
- "eslint"
- "--ext"
- ".ts,.tsx,.cts,.mts,.js,.jsx,.cjs,.mjs"
- "--fix"
- "--report-unused-disable-directives"
- "--no-error-on-unmatched-pattern"
- "--exit-on-fatal-error"
- "--ignore-path"
- "@in(2)"
- "."
inputs:
- "*.config.*"
- "**/.eslintrc.*"
- "/.eslintignore"
- "/.eslintrc.*"
- "tsconfig.json"
- "/tsconfig.eslint.json"
- "/tsconfig.options.json"
- "@group(app)"
- "@globs(sources)"
- "@globs(tests)"

# https://moonrepo.dev/docs/guides/examples/jest
test:
command:
- "jest"
- "--passWithNoTests"
- "--preset"
- "jest-preset-moon"
inputs:
- "@globs(sources)"
- "@globs(tests)"
- "jest.config.*"

# https://moonrepo.dev/docs/guides/examples/typescript
typecheck:
command:
- "tsc"
- "--build"
inputs:
- "@group(app)"
- "@globs(sources)"
- "@globs(tests)"
- "tsconfig.json"
- "tsconfig.*.json"
- "/tsconfig.options.json"
3 changes: 3 additions & 0 deletions .moon/tasks/tag-astro.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
$schema: "https://moonrepo.dev/schemas/tasks.json"

extends: 'https://raw.githubusercontent.com/moonrepo/moon-configs/master/javascript/astro/tasks.yml'
3 changes: 3 additions & 0 deletions .moon/tasks/tag-packemon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
$schema: "https://moonrepo.dev/schemas/tasks.json"

extends: "https://raw.githubusercontent.com/moonrepo/moon-configs/master/javascript/packemon/tasks.yml"
3 changes: 3 additions & 0 deletions .moon/tasks/tag-vite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
$schema: "https://moonrepo.dev/schemas/tasks.json"

extends: "https://raw.githubusercontent.com/moonrepo/moon-configs/master/javascript/vite/tasks.yml"
3 changes: 3 additions & 0 deletions .moon/tasks/tag-vitest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
$schema: "https://moonrepo.dev/schemas/tasks.json"

extends: 'https://raw.githubusercontent.com/moonrepo/moon-configs/master/javascript/vitest/tasks.yml'
Loading
Loading