Skip to content

Commit

Permalink
Merge branch 'master' into feat/add-set-resolver-step
Browse files Browse the repository at this point in the history
  • Loading branch information
meelrossi committed Jan 26, 2024
2 parents 30079cc + c9b0c6a commit 27203ae
Show file tree
Hide file tree
Showing 205 changed files with 21,518 additions and 58,478 deletions.
6 changes: 3 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
NODE_PATH=src
REACT_APP_DCL_DEFAULT_ENV=dev
VITE_REACT_APP_DCL_DEFAULT_ENV="dev"
VITE_BASE_URL=""
VITE_REACT_APP_WEBSITE_VERSION="0.0.0-development"
GEN_STATIC_LOCAL=true
PUBLIC_URL=/

; Feature Flags
; These are controlled by a remote service, you can still enforce the flags by setting a
Expand Down
14 changes: 10 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
"root": true,
"parser": "@typescript-eslint/parser",
"ignorePatterns": [
"__mocks__/*",
"src/contracts/*",
"src/ecsScene/*",
"scripts/*.js",
"scripts/*.cjs",
"src/modules/project/export.ts",
"src/modules/analytics/sentry.ts",
"src/modules/editor/base64.ts",
Expand All @@ -14,17 +15,21 @@
"src/setupProxy.js"
],
"plugins": ["@typescript-eslint"],
"extends": ["eslint:recommended", "react-app", "react-app/jest", "prettier"],
"extends": ["eslint:recommended", "prettier"],
"env": {
"browser": true,
"es6": true
"es6": true,
"jest": true
},
"rules": {
"@typescript-eslint/ban-types": "error",
"@typescript-eslint/ban-tslint-comment": "error",
"@typescript-eslint/quotes": ["error", "single", { "avoidEscape": true }],
"@typescript-eslint/no-misused-promises": ["error", { "checksVoidReturn": false }]
},
"parserOptions": {
"project": ["./tsconfig.json"]
},
"overrides": [
{
"files": ["*.ts", "*.tsx"],
Expand All @@ -38,7 +43,8 @@
"@typescript-eslint/no-unsafe-member-access": "off", // TODO: migrate code progressively to remove this line. https://typescript-eslint.io/rules/no-unsafe-member-access/
"@typescript-eslint/no-unsafe-argument": "off", // TODO: migrate code progressively to remove this line. https://typescript-eslint.io/rules/no-unsafe-argument/
"@typescript-eslint/no-explicit-any": "off", // TODO: migrate code progressively to remove this line. https://typescript-eslint.io/rules/no-explicit-any
"@typescript-eslint/no-non-null-assertion": "off" // TODO: migrate code progressively to remove this line. https://typescript-eslint.io/rules/no-non-null-assertion
"@typescript-eslint/no-non-null-assertion": "off", // TODO: migrate code progressively to remove this line. https://typescript-eslint.io/rules/no-non-null-assertion
"@typescript-eslint/no-unsafe-enum-comparison": "off"
},
"parserOptions": {
"project": ["./tsconfig.json"]
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ on: [push, pull_request]
jobs:
audit:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Clean install dependencies
run: npm ci

- uses: actions/checkout@master
- name: Use Node.js 18.x
uses: actions/setup-node@v4.0.1
with:
node-version: 18.x
cache: 'npm'
- name: Install
run: npm i --legacy-peer-deps
- name: Audit signatures
run: npm audit signatures
14 changes: 8 additions & 6 deletions .github/workflows/build-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,34 @@ on:

jobs:
build-release:
permissions:
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Use Node.js 16.x
uses: actions/setup-node@v1
- name: Use Node.js 18.x
uses: actions/setup-node@v4.0.1
with:
node-version: 16.x
node-version: 18.x
cache: 'npm'
- name: Set package.json version
uses: menduz/oddish-action@master
with:
deterministic-snapshot: true
only-update-versions: true
- name: Install
run: npm ci --legacy-peer-deps
run: npm install --legacy-peer-deps
env:
HUSKY: 0
- name: Build
run: npm run build
env:
CI: 'false'
NODE_PATH: 'src'
NODE_OPTIONS: '--max-old-space-size=6144'
- name: Publish
uses: menduz/oddish-action@master
with:
cwd: './build'
cwd: './dist'
deterministic-snapshot: true
registry-url: 'https://registry.npmjs.org'
access: public
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

# production
/build
/dist

# misc
.DS_Store
Expand Down
34 changes: 34 additions & 0 deletions __mocks__/@babylonjs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Export all old ECS math functions as mocks
const Scalar = {
toHex: i => {
const str = i.toString(16)

if (i <= 15) {
return ('0' + str).toUpperCase()
}

return str.toUpperCase()
}
}

const decentralandEcs = {
core: {
Color4: function (r, g, b, a) {
return {
r,
g,
b,
a,
toHexString: () => {
const intR = (r * 255) | 0
const intG = (g * 255) | 0
const intB = (b * 255) | 0
const intA = (a * 255) | 0
return '#' + Scalar.toHex(intR) + Scalar.toHex(intG) + Scalar.toHex(intB) + Scalar.toHex(intA)
}
}
}
}
}

module.exports = decentralandEcs
1 change: 1 addition & 0 deletions __mocks__/decentraland-crypto-fetch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = () => undefined
7 changes: 4 additions & 3 deletions public/index.html → index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="shortcut icon" href="https://decentraland.org/images/icons/favicon-32x32.png" />
<meta
name="description"
content="Add your own 3D elements or choose from hundreds of pre-loaded items. Select, drag and drop them onto the canvas to create cool interactive scenes. No coding required, no design skills needed!"
Expand Down Expand Up @@ -32,8 +32,7 @@
<meta itemprop="image" content="https://decentraland.org/images/logo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="theme-color" content="#000000" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<script type="text/javascript" src="%PUBLIC_URL%/config/hotjar.js"></script>
<link rel="manifest" href="%VITE_BASE_URL%/manifest.json" />

<style>
.loading-overlay {
Expand Down Expand Up @@ -81,5 +80,7 @@
</div>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="module" src="/src/node.ts"></script>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>
51 changes: 51 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/* eslint-disable */
import type { Config } from 'jest'

export default async (): Promise<Config> => {
return {
verbose: true,
testEnvironment: 'jsdom',
setupFiles: ['<rootDir>/src/tests/beforeSetupTests.ts'],
setupFilesAfterEnv: ['<rootDir>/src/tests/afterSetupTest.ts'],
transform: {
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/src/tests/config/fileTransformer.cjs',
'^.+\\.(t|j)sx?$': [
'@swc/jest',
{
jsc: {
transform: {
react: {
runtime: 'automatic'
}
}
}
}
]
},
testRegex: '(/__tests__/.*|(\\.|/)(spec))\\.[jt]sx?$',
moduleNameMapper: {
'^three/.*$': 'identity-obj-proxy',
'decentraland-ecs': 'identity-obj-proxy',
'^.*/modules/curations/collectionCuration/toasts.*$': 'identity-obj-proxy',
'@dcl/ecs': 'identity-obj-proxy',
canvas: 'identity-obj-proxy',
'^.+?raw': 'identity-obj-proxy',
'@dcl/single-sign-on-client': 'identity-obj-proxy',
'\\.(css|less)$': 'identity-obj-proxy',
'^components/(.*)$': '<rootDir>/src/components/$1',
'^config$': '<rootDir>/src/config',
'^contracts(/.*)$': '<rootDir>/src/contracts/$1',
'^contracts$': '<rootDir>/src/contracts',
'^ecsScene/(.*)$': '<rootDir>/src/ecsScene/$1',
'^experiments/(.*)$': '<rootDir>/src/experiments/$1',
'^icons/(.*)$': '<rootDir>/src/icons/$1',
'^images/(.*)$': '<rootDir>/src/images/$1',
'^lib/(.*)$': '<rootDir>/src/lib/$1',
'^modules/(.*)$': '<rootDir>/src/modules/$1',
'^routing/(.*)$': '<rootDir>/src/routing/$1',
'^specs/(.*)$': '<rootDir>/src/specs/$1'
},
transformIgnorePatterns: ['node_modules/?!@0xsquid|eccrypto|libsodium-wrappers-sumo']
}
}
Loading

0 comments on commit 27203ae

Please sign in to comment.