Skip to content

Commit 553707d

Browse files
committed
feat: basic monorepo scaffolding, browser + wasm packages
1 parent dd54a03 commit 553707d

Some content is hidden

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

46 files changed

+16546
-1284
lines changed

.cargo/config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[build]
2+
target-dir = 'dist/target'

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,13 @@ jobs:
1919
filter: tree:0
2020
fetch-depth: 0
2121

22+
- uses: jetli/[email protected]
23+
with:
24+
version: 0.13.1
25+
2226
- uses: pnpm/action-setup@v4
2327
name: Install pnpm
2428
with:
25-
version: 9.8.0
2629
run_install: false
2730

2831
# This enables task distribution via Nx Cloud

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
dist
55
tmp
66
out-tsc
7+
target
78

89
# dependencies
910
node_modules
@@ -42,3 +43,6 @@ Thumbs.db
4243
.nx/workspace-data
4344
.cursor/rules/nx-rules.mdc
4445
.github/instructions/nx.instructions.md
46+
47+
vite.config.*.timestamp*
48+
vitest.config.*.timestamp*

.vscode/extensions.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
{
2-
"recommendations": ["nrwl.angular-console", "esbenp.prettier-vscode"]
2+
"recommendations": [
3+
"nrwl.angular-console",
4+
"esbenp.prettier-vscode",
5+
"dbaeumer.vscode-eslint"
6+
]
37
}

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"eslint.validate": ["json"]
3+
}

Cargo.lock

Lines changed: 144 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
[workspace]
3+
resolver = '2'
4+
members = [
5+
'packages/wasm',
6+
]
7+
8+
[profile.release]
9+
lto = true

error.log

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11

2-
fatal: not a git repository (or any of the parent directories): .git
2+
/bin/sh: gh: command not found

eslint.config.mjs

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import nx from '@nx/eslint-plugin';
2+
3+
export default [
4+
{
5+
files: ['**/*.json'],
6+
// Override or add rules here
7+
rules: {},
8+
languageOptions: {
9+
parser: await import('jsonc-eslint-parser'),
10+
},
11+
},
12+
...nx.configs['flat/base'],
13+
...nx.configs['flat/typescript'],
14+
...nx.configs['flat/javascript'],
15+
{
16+
ignores: [
17+
'**/dist',
18+
'**/vite.config.*.timestamp*',
19+
'**/vitest.config.*.timestamp*',
20+
],
21+
},
22+
{
23+
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
24+
rules: {
25+
'@nx/enforce-module-boundaries': [
26+
'error',
27+
{
28+
enforceBuildableLibDependency: true,
29+
allow: ['^.*/eslint(\\.base)?\\.config\\.[cm]?[jt]s$'],
30+
depConstraints: [
31+
{
32+
sourceTag: '*',
33+
onlyDependOnLibsWithTags: ['*'],
34+
},
35+
],
36+
},
37+
],
38+
},
39+
},
40+
{
41+
files: [
42+
'**/*.ts',
43+
'**/*.tsx',
44+
'**/*.cts',
45+
'**/*.mts',
46+
'**/*.js',
47+
'**/*.jsx',
48+
'**/*.cjs',
49+
'**/*.mjs',
50+
],
51+
// Override or add rules here
52+
rules: {},
53+
},
54+
];

nx.json

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22
"$schema": "./node_modules/nx/schemas/nx-schema.json",
33
"namedInputs": {
44
"default": ["{projectRoot}/**/*", "sharedGlobals"],
5-
"production": ["default"],
5+
"production": [
6+
"default",
7+
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
8+
"!{projectRoot}/tsconfig.spec.json",
9+
"!{projectRoot}/src/test-setup.[jt]s",
10+
"!{projectRoot}/.eslintrc.json",
11+
"!{projectRoot}/eslint.config.mjs"
12+
],
613
"sharedGlobals": ["{workspaceRoot}/.github/workflows/ci.yml"]
714
},
815
"nxCloudId": "6881413b0e4a9139ff67b78b",
@@ -20,6 +27,37 @@
2027
"watchDepsName": "watch-deps"
2128
}
2229
}
30+
},
31+
{
32+
"plugin": "@nx/vite/plugin",
33+
"options": {
34+
"buildTargetName": "build",
35+
"testTargetName": "test",
36+
"serveTargetName": "serve",
37+
"devTargetName": "dev",
38+
"previewTargetName": "preview",
39+
"serveStaticTargetName": "serve-static",
40+
"typecheckTargetName": "typecheck",
41+
"buildDepsTargetName": "build-deps",
42+
"watchDepsTargetName": "watch-deps"
43+
}
44+
},
45+
{
46+
"plugin": "@nx/eslint/plugin",
47+
"options": {
48+
"targetName": "lint"
49+
}
50+
},
51+
"@monodon/rust"
52+
],
53+
"targetDefaults": {
54+
"test": {
55+
"dependsOn": ["^build"]
56+
},
57+
"@nx/js:tsc": {
58+
"cache": true,
59+
"dependsOn": ["^build"],
60+
"inputs": ["production", "^production"]
2361
}
24-
]
62+
}
2563
}

0 commit comments

Comments
 (0)