Skip to content

Commit 510e23e

Browse files
authored
Merge pull request #4 from AR-js-org/copilot/add-ecs-architecture-and-plugins
Add ECS architecture and plugin system with source capture plugins
2 parents 6a02e6c + eea9464 commit 510e23e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+21754
-2146
lines changed

.editorconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
charset = utf-8
7+
indent_style = space
8+
indent_size = 2

.gitattributes

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Enforce LF for source and text files across platforms
2+
*.js text eol=lf
3+
*.mjs text eol=lf
4+
*.cjs text eol=lf
5+
*.ts text eol=lf
6+
*.json text eol=lf
7+
*.md text eol=lf
8+
*.css text eol=lf
9+
*.html text eol=lf
10+
11+
# Keep binary files untouched
12+
*.png binary
13+
*.jpg binary
14+
*.jpeg binary
15+
*.gif binary
16+
*.webp binary
17+
*.mp4 binary
18+
*.mp3 binary
19+
*.woff binary
20+
*.woff2 binary
21+
*.ttf binary
22+
*.otf binary

.github/workflows/ci.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ['**'] # run on pushes to all branches
6+
paths:
7+
- 'src/**'
8+
- 'plugins/**'
9+
- 'examples/**'
10+
- 'tests/**'
11+
- 'package.json'
12+
- 'vite.config.js'
13+
- 'vitest.config.js'
14+
- '.github/workflows/**'
15+
pull_request:
16+
branches: ['**'] # run on PRs against any branch
17+
18+
concurrency:
19+
group: ci-${{ github.ref }}
20+
cancel-in-progress: true
21+
22+
jobs:
23+
# Primary job: format/lint, webpack build, then tests with coverage.
24+
build-and-test:
25+
runs-on: ubuntu-24.04
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
30+
- name: Setup Node.js (from .nvmrc)
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version-file: .nvmrc
34+
cache: npm
35+
36+
- name: Install dependencies
37+
run: |
38+
if [ -f package-lock.json ]; then
39+
npm ci
40+
else
41+
npm install
42+
fi
43+
44+
- name: Prettier check
45+
run: npm run format-check
46+
47+
- name: ESLint
48+
run: npm run lint
49+
50+
# Use the webpack build for CI stability (dist via webpack)
51+
- name: Build (webpack)
52+
run: npm run build
53+
54+
- name: Run tests (with coverage)
55+
run: npm run test:coverage
56+
env:
57+
CI: true
58+
59+
- name: Upload coverage artifact
60+
if: always()
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: coverage
64+
path: coverage
65+
if-no-files-found: ignore
66+
67+
# Secondary job: attempt Vite build with mitigations; doesn't fail the PR if it breaks.
68+
vite-build-linux:
69+
runs-on: ubuntu-24.04
70+
continue-on-error: true
71+
needs: build-and-test
72+
steps:
73+
- name: Checkout
74+
uses: actions/checkout@v4
75+
76+
- name: Setup Node.js (from .nvmrc)
77+
uses: actions/setup-node@v4
78+
with:
79+
node-version-file: .nvmrc
80+
cache: npm
81+
82+
- name: Install dependencies
83+
run: |
84+
if [ -f package-lock.json ]; then
85+
npm ci
86+
else
87+
npm install
88+
fi
89+
90+
- name: Diagnostics (platform and rollup)
91+
run: |
92+
node -e "console.log('platform:', process.platform, 'arch:', process.arch, 'node:', process.version)"
93+
npm ls rollup @rollup/rollup-linux-x64-gnu vite || true
94+
95+
# Workaround: ensure Linux native binary is present. Harmless if already resolved.
96+
- name: Ensure rollup native linux package
97+
run: npm i -D @rollup/rollup-linux-x64-gnu@^4 || true
98+
99+
- name: Vite build (library)
100+
run: npm run build:vite
101+
env:
102+
# Ask rollup to use JS fallback if native optional dep is still missing
103+
ROLLUP_SKIP_NODEJS_NATIVE: '1'

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
node_modules
1+
node_modules
2+
dist
3+
.idea/
4+
coverage/
5+
.eslintcache

.husky/pre-commit

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Only format and lint what's staged (fast)
2+
npx lint-staged

.lintstagedignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
examples/vite-artoolkit/vendor/**
2+
examples/vite-artoolkit/data/**
3+
*.dat
4+
*.hiro
5+
*.map

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v22.21.1

.prettierignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
types
2-
dist
2+
dist
3+
examples/vite-artoolkit/vendor/**
4+
examples/vite-artoolkit/data/**
5+
*.dat
6+
*.hiro
7+
*.map

.prettierrc.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"printWidth": 100,
3+
"singleQuote": true,
4+
"trailingComma": "all",
5+
"semi": true,
6+
"arrowParens": "always",
7+
"endOfLine": "lf"
8+
}

0 commit comments

Comments
 (0)