Skip to content

Commit 96e9a29

Browse files
authored
Merge pull request #1538 from decentraland/chore/sync-main-to-authserver
chore: sync main to authserver
2 parents 5ffe873 + 26ad1a9 commit 96e9a29

133 files changed

Lines changed: 9071 additions & 14351 deletions

File tree

Some content is hidden

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

.eslintignore

Lines changed: 0 additions & 11 deletions
This file was deleted.

AGENTS.md

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ For deeper context on a specific subsystem (component serialization, CRDT suppre
1414

1515
## Packages
1616

17-
Six packages under `packages/@dcl/` (npm workspaces):
17+
Six packages under `packages/@dcl/` (a monorepo layout, but **not** npm workspaces):
1818

1919
| Package | Purpose |
2020
| --- | --- |
@@ -27,6 +27,8 @@ Six packages under `packages/@dcl/` (npm workspaces):
2727

2828
Internal references use `file:../` paths during development; published versions get pinned semver ranges (managed via syncpack — see `make sync-deps`).
2929

30+
The root `package.json` has no `workspaces` field — root `make install` only installs root-level tooling deps. Each package keeps its own standalone `package-lock.json`, and per-package `node_modules/` are populated by `make build`, which runs `npm i` inside each package (`scripts/build.spec.ts`). Don't expect package deps to be hoisted to the root `node_modules/`.
31+
3032
## Development commands
3133

3234
The repo is orchestrated via **`make`** (the Makefile is the source of truth — `package.json` only carries `postinstall`). All commands run from the repo root:
@@ -47,10 +49,10 @@ The repo is orchestrated via **`make`** (the Makefile is the source of truth —
4749
The full Jest suite is slow. For faster iteration, scope to a path pattern:
4850

4951
```bash
50-
node_modules/.bin/jest --colors --forceExit --testPathPattern='test/sdk-commands'
51-
node_modules/.bin/jest --colors --forceExit --testPathPattern='test/ecs'
52-
node_modules/.bin/jest --colors --forceExit --testPathPattern='test/react-ecs'
53-
node_modules/.bin/jest --colors --forceExit --testPathPattern='test/snapshots'
52+
node_modules/.bin/jest --colors --forceExit --testPathPatterns='test/sdk-commands'
53+
node_modules/.bin/jest --colors --forceExit --testPathPatterns='test/ecs'
54+
node_modules/.bin/jest --colors --forceExit --testPathPatterns='test/react-ecs'
55+
node_modules/.bin/jest --colors --forceExit --testPathPatterns='test/snapshots'
5456
```
5557

5658
### Per-package typecheck
@@ -73,6 +75,21 @@ An `ERR!` line means the QuickJS eval threw mid-execution (commonly a missing mo
7375

7476
**Anti-pattern:** committing snapshots containing `ERR! Error: Unknown module ...`, `ERR! TypeError: ... is not a function`, or any other `ERR!` trace. Treat them as broken artifacts — fix the mock (or the underlying scene-load failure), regenerate, and re-verify before committing.
7577

78+
### Bumping `@dcl/inspector` (the vehicle for `@dcl/asset-packs`)
79+
80+
`@dcl/asset-packs` is not a direct dependency of this repo — it ships nested inside `@dcl/inspector`, and `packages/@dcl/sdk-commands/src/logic/bundle.ts` resolves it from the inspector's `node_modules`. To bump (prior art: commits `04270ca5`, `8b6bd63d`):
81+
82+
1. `cd packages/@dcl/sdk-commands && npm i --save-exact @dcl/inspector@<x.y.z>` — updates the pin, the package's standalone lockfile, and its `node_modules/` in one step (same pattern as the Makefile's `update-protocol` target).
83+
2. `make build` from the repo root.
84+
3. Regenerate snapshots with a `UPDATE_SNAPSHOTS=true` scoped Jest run — `test/snapshots/package-lock.json` updates itself during this run. Verify no `ERR!` lines (see above).
85+
86+
Asset-packs injection is gated behind `isEditorScene` (requires `assets/scene/main.composite` — see `packages/@dcl/sdk-commands/src/logic/project-validations.ts`), so inspector bumps no longer change `.crdt` snapshots. An empty snapshot diff is expected, not a stale artifact.
87+
88+
## Committing hygiene gotchas
89+
90+
- A newer local npm rewrites committed lockfiles with `"peer": true` / `"dev": true` metadata churn during installs (root and per-package lockfiles). Revert lockfile changes unrelated to your dependency change before committing.
91+
- `make format` runs prettier over the whole repo, including paths CI's `make lint` does not check (`test/`, `scripts/`, dot-files), where HEAD may carry drift — a blind `make format` can dirty dozens of unrelated files. Check your own files, revert the rest.
92+
7693
## Code conventions
7794

7895
- **TypeScript** 5.0.2, strict mode.

docs/ai-agent-context.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,14 @@ Uses esbuild with `platform: 'browser'`, `format: 'cjs'`, `target: 'es2020'`, an
110110
| `-p, --port <number>` | HTTP port (auto-detected if omitted) |
111111
| `--dclenv <env>` | Explorer environment: `org` (mainnet production, default), `zone` (staging), `today` |
112112
| `--realm <name>` | Realm name shown in Explorer (default: `Localhost`) |
113-
| `--web3` | Enable Web3 wallet integration in the preview |
113+
| `--web3` | (deprecated) No effect; kept for backwards compatibility |
114114
| `--skip-build` | Serve pre-built files without rebuilding |
115115
| `--no-watch` | Disable file watching / hot reload |
116116
| `--no-browser` | Don't auto-open Explorer |
117117
| `--ci` | CI mode: disable browser and debug panel |
118118
| `--debug` | Enable scene debug panel (on by default with `--explorer-alpha`) |
119119
| `--explorer-alpha` | Use the new Alpha Explorer deeplink (default) |
120-
| `--web-explorer` | Use legacy web-based Explorer |
120+
| `--web, --bevy-web` | Open the preview in Bevy Web (`https://decentraland.org/bevy-web/`) instead of the desktop Explorer. Chrome 142+ requires the Local Network Access permission ("Apps on device" in 145+) for the page to reach the localhost preview server; the CLI prints instructions |
121121
| `--mobile` | Print ASCII QR code for mobile preview |
122122
| `--position <x,y>` | Initial spawn position (default: from `scene.json`) |
123123
| `--skip-auth-screen` | Skip Explorer's authentication screen |

eslint.config.mjs

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import { FlatCompat } from '@eslint/eslintrc'
2+
import path from 'path'
3+
import { fileURLToPath } from 'url'
4+
5+
// @dcl/eslint-config still publishes an eslintrc-style config; wrap it for eslint 9.
6+
const compat = new FlatCompat({ baseDirectory: path.dirname(fileURLToPath(import.meta.url)) })
7+
8+
export default [
9+
...compat.config({
10+
extends: '@dcl/eslint-config/sdk',
11+
parserOptions: {
12+
project: [
13+
'packages/@dcl/ecs/tsconfig.json',
14+
'packages/@dcl/sdk-commands/tsconfig.json',
15+
'packages/@dcl/sdk/tsconfig.json',
16+
'packages/@dcl/playground-assets/tsconfig.json',
17+
'packages/@dcl/react-ecs/tsconfig.json',
18+
'scripts/tsconfig.json',
19+
'test/tsconfig.json',
20+
'test/ecs/snippets/tsconfig.json'
21+
]
22+
}
23+
}),
24+
{
25+
rules: {
26+
'no-param-reassign': 'warn',
27+
'no-console': 'error',
28+
'@typescript-eslint/no-unused-vars': [
29+
'warn',
30+
{
31+
ignoreRestSiblings: true,
32+
argsIgnorePattern: '^_',
33+
varsIgnorePattern: '^_|ReactEcs',
34+
caughtErrorsIgnorePattern: '^_'
35+
}
36+
]
37+
}
38+
},
39+
{
40+
files: ['packages/@dcl/ecs/**/*.ts', 'packages/@dcl/sdk/**/*.ts', 'scripts/**/*.ts', 'test/**/*.ts'],
41+
rules: { 'no-console': 'off' }
42+
},
43+
{
44+
ignores: [
45+
'**/*.gen.ts',
46+
'**/dist/**',
47+
'**/node_modules/**',
48+
'**/*.d.ts',
49+
'**/*.js',
50+
'packages/@dcl/ecs/dist/**',
51+
'packages/@dcl/ecs/src/components/generated',
52+
'packages/@dcl/js-runtime',
53+
'packages/@dcl/playground-assets/dist',
54+
'packages/@dcl/sdk/dist/**',
55+
'packages/@dcl/sdk/internal/**',
56+
'packages/@dcl/sdk/testing/**',
57+
'test/sdk/simple-scene',
58+
'tmp'
59+
]
60+
}
61+
]

jest.config.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@ module.exports = {
33
moduleFileExtensions: ['ts', 'js', 'tsx', 'jsx'],
44
transform: {
55
'^.+\\.(js|jsx|ts|tsx)$': [
6-
'ts-jest',
6+
'babel-jest',
77
{
8-
tsconfig: 'test/tsconfig.json'
8+
presets: [['@babel/preset-typescript', { isTSX: true, allExtensions: true, onlyRemoveTypeImports: true }]],
9+
plugins: [
10+
'@babel/plugin-transform-modules-commonjs',
11+
'@babel/plugin-transform-dynamic-import',
12+
['@babel/plugin-transform-react-jsx', { pragma: 'ReactEcs.createElement' }]
13+
]
914
}
1015
]
1116
},

0 commit comments

Comments
 (0)