Skip to content

Commit

Permalink
breaking: rewrite assetpack
Browse files Browse the repository at this point in the history
  • Loading branch information
Zyie committed Jul 3, 2024
1 parent 38e872a commit 57cb3c7
Show file tree
Hide file tree
Showing 323 changed files with 36,950 additions and 28,270 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ trim_trailing_whitespace = true
indent_style = space
indent_size = 4

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

indent_size = 2
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.eslintrc.js
.eslintrc.cjs
**/dist
**/node_modules
38 changes: 38 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
module.exports = {
extends: ["@pixi/eslint-config"],
parserOptions: {
project: "./tsconfig.eslint.json",
ecmaVersion: 2020,
sourceType: "module",
},
plugins: ['import'],
rules: {
"spaced-comment": [1, "always", { markers: ["/"] }],
"@typescript-eslint/triple-slash-reference": [1, { path: "always" }],
"@typescript-eslint/type-annotation-spacing": 1,
"@typescript-eslint/no-non-null-assertion": 0,
"@typescript-eslint/consistent-type-imports":
["error", { disallowTypeAnnotations: false }],
"import/consistent-type-specifier-style": ["error", "prefer-top-level"],
"import/no-duplicates": ["error"],
"camelcase": 0,
"max-len": ["error", { code: 180 }],
},
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,
},
},
],
};
44 changes: 0 additions & 44 deletions .eslintrc.js

This file was deleted.

34 changes: 18 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
name: CI

on:
push:
branches:
- main
pull_request:

jobs:
main:
verify:
name: CI
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
script:
- name: Typecheck
command: test:types
- name: Lint
command: test:lint
- name: Unit tests
command: test
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:types --parallel=3
- uses: FedericoCarboni/setup-ffmpeg@v2
- run: npx nx affected --target=test --parallel=3 --ci
- run: npx nx affected --target=build --parallel=3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: npm ci --ignore-scripts --no-audit --no-fund
- run: npm rebuild
- run: npm run ${{ matrix.script.command }}
33 changes: 33 additions & 0 deletions .github/workflows/deploy-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Reusable Deploy

on:
push:
branches:
- main
- docs

concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- run: npm ci
- run: |
git config --global user.name "$GITHUB_ACTOR"
git config --global user.email "[email protected]"
git remote set-url origin https://git:${GIT_PASS}@github.com/pixijs/assetpack.git
npm run deploy
env:
GIT_USER: $GITHUB_ACTOR
GIT_PASS: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ jobs:
- 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.*$'
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: add pr title workflow\n```"
title-regex: '^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)?(!)?\:\s.*$'
github-token: ${{ secrets.GITHUB_TOKEN }}
24 changes: 24 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Publish Package
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run build
- run: npm run publish-ci
if: github.event.release.prerelease
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
XS_PUBLISH_TAG: beta
- run: npm run publish-ci
if: github.event.release.prerelease == false
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
15 changes: 0 additions & 15 deletions .github/workflows/release.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ Thumbs.db
.testInput
.testOutput
.assetpack
packages/assetpack/test/cache
10 changes: 9 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
# Get a list of the staged files$files=$(git diff --cached --name-only --diff-filter=ACM -- '*.ts' | grep '^src/')
staged_files=$(git diff --cached --name-only --diff-filter=ACM -- '*.ts' | grep '^src/' || true)

npx lint-staged
# Run npm lint on the staged files
if [ -n "$staged_files" ]; then
#log files
echo 'linting the following commited files:' $staged_files
npx eslint --ext .ts --max-warnings 0 $staged_files
npm run test:types
fi
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18
20
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"singleQuote": true,
"trailingComma": "all",
"printWidth": 120
}
11 changes: 0 additions & 11 deletions jest.config.js

This file was deleted.

10 changes: 0 additions & 10 deletions lerna.json

This file was deleted.

37 changes: 0 additions & 37 deletions nx.json

This file was deleted.

Loading

0 comments on commit 57cb3c7

Please sign in to comment.