Skip to content

Commit

Permalink
project setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Zyie committed Nov 17, 2022
1 parent 8ccc21f commit 86c59a3
Show file tree
Hide file tree
Showing 40 changed files with 13,376 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This file is for unifying the coding style for different editors and IDEs.
# More information at http://EditorConfig.org
root = true

[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4

[{package.json,bower.json,.github/workflows/*.yml,*.md}]

indent_size = 2
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.eslintrc.js
**/dist
**/node_modules
43 changes: 43 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
module.exports = {
extends: ['@pixi/eslint-config'],
parserOptions: {
project: ['./tsconfig.eslint.json', './packages/*/tsconfig.json'],
tsconfigRootDir: __dirname
},
settings: {
jsdoc: {
mode: 'typescript',
tagNamePreference: {
method: 'method',
function: 'function',
extends: 'extends',
typeParam: 'typeParam',
api: 'api'
}
}
},
rules: {
'spaced-comment': [1, 'always', { markers: ['/'] }],
'@typescript-eslint/triple-slash-reference': [1, { path: 'always' }],
'@typescript-eslint/consistent-type-imports': [1, { disallowTypeAnnotations: false }],
'@typescript-eslint/no-parameter-properties': 1,
'@typescript-eslint/type-annotation-spacing': 1,
},
overrides: [
{
files: ['*.tests.ts', '*.test.ts'],
rules: {
'@typescript-eslint/no-unused-expressions': 0,
'@typescript-eslint/dot-notation': [
0,
{
allowPrivateClassPropertyAccess: true,
allowProtectedClassPropertyAccess: true,
allowIndexSignaturePropertyAccess: true
}
],
'dot-notation': 0
}
}
]
};
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*.js text eol=lf
*.ts text eol=lf
*.json text eol=lf
*.yml text eol=lf
*.md text eol=lf
*.txt text eol=lf
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: CI
on:
push:
branches:
- main
pull_request:

jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: nrwl/nx-set-shas@v3
- run: npm ci

- run: npx nx workspace-lint
- run: npm run lint
- run: npx nx affected --target=test --parallel=3 --ci
- run: npx nx affected --target=build --parallel=3
25 changes: 25 additions & 0 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Pull Request Title Format

on:
pull_request:
branches:
- '*'
types:
- opened
- reopened
- edited
- synchronize

jobs:
prTitle:
name: Check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check PR Title
uses: clowdhaus/actions/[email protected]
with:
on-fail-message: "Your PR title doesn't match the required format. The title should be in the conventional commit (https://www.conventionalcommits.org/en/v1.0.0-beta.4/) format. e.g.\n\n```\nchore(plugin-name): add pr title workflow\n```"
title-regex: '^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([\w|,|\-|\|]+\))?(!)?\:\s.*$'
github-token: ${{ secrets.GITHUB_TOKEN }}
19 changes: 19 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Release Notes

on: [push]

jobs:
release:
runs-on: macos-latest
if: contains(github.ref, 'refs/tags/v')
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Install GitHub CLI
run: |
brew update
brew install gh
- name: Generate Release
run: gh release create ${{github.ref_name}} --generate-notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43 changes: 43 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
dist
tmp
/out-tsc

# dependencies
node_modules

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings

# System Files
.DS_Store
Thumbs.db

.eslintcache
.testInput
.testOutput
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
9 changes: 9 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
testPathIgnorePatterns: ['/node_modules/', '/src/', '/dist/'],
testTimeout: 300000,
moduleNameMapper: {
'^@assetpack/(.*)$': '<rootDir>/packages/$1/src',
},
};
24 changes: 24 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"extends": "nx/presets/npm.json",
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"tasksRunnerOptions": {
"default": {
"runner": "@nrwl/nx-cloud",
"options": {
"cacheableOperations": [
"build",
"lint",
"test",
"e2e"
],
"accessToken": "ZjQ3OWVmMTAtMTBlYS00YmJkLTk1ZjMtNmM5MWQ0YWFhYzY4fHJlYWQtd3JpdGU=",
"scan": true
}
}
},
"targetDefaults": {
"build": {
"dependsOn": ["^build"]
}
}
}
Loading

0 comments on commit 86c59a3

Please sign in to comment.