diff --git a/.github/workflows/project-build.yml b/.github/workflows/project-build.yml new file mode 100644 index 0000000..a00deb7 --- /dev/null +++ b/.github/workflows/project-build.yml @@ -0,0 +1,48 @@ +name: project-build +on: push +jobs: + secrets-gate: + runs-on: ubuntu-latest + outputs: + ok: ${{ steps.check-secrets.outputs.ok }} + steps: + - name: check for secrets needed to run workflows + id: check-secrets + run: | + if [ ${{ secrets.PROJECT_BUILD_ENABLED }} == 'true' ]; then + echo "ok=enabled" >> $GITHUB_OUTPUT + fi + compile-codebase: + needs: + - secrets-gate + if: ${{ needs.secrets-gate.outputs.ok == 'enabled' }} + runs-on: ubuntu-latest + steps: + - name: Checkout Ethereal Engine + uses: actions/checkout@v3 + with: + repository: etherealengine/etherealengine + - name: Checkout Project + uses: actions/checkout@v3 + with: + path: './packages/projects/projects/${{ github.event.repository.name }}' + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: 18.x + - name: restore lerna + uses: actions/cache@v3 + with: + path: | + node_modules + */*/node_modules + package-lock.json + key: ${{ runner.os }}-branch-build-${{ hashFiles('**/package.json') }} + - run: cp .env.local.default .env.local + - run: npm install --production=false --loglevel notice --legacy-peer-deps + - run: npm run lint + - run: npm run check-errors + - run: npm run dev-docker + - run: npm run dev-reinit + - run: npx lerna run --ignore '@etherealengine/*' test + - run: npm run build-client diff --git a/.github/workflows/version-increment.yml b/.github/workflows/version-increment.yml new file mode 100644 index 0000000..2f5adc6 --- /dev/null +++ b/.github/workflows/version-increment.yml @@ -0,0 +1,61 @@ +name: version-increment + +on: + release: + types: [created] + +jobs: + secrets-gate: + runs-on: ubuntu-latest + outputs: + ok: ${{ steps.check-secrets.outputs.ok }} + steps: + - name: check for secrets needed to run workflows + id: check-secrets + run: | + if [ ${{ secrets.PROJECT_VERSION_INCREMENT_ENABLED }} == 'true' ]; then + echo "ok=enabled" >> $GITHUB_OUTPUT + fi + publish-npm: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18.x + scope: '@etherealengine' + - name: Set git username + run: git config user.name "CI Bot" + - name: Set git email + run: git config user.email ci-bot@etherealengine.org + - name: Set pr_branch_name environment variable + run: echo pr_branch_name=version-increment-${{ github.event.release.tag_name }} >> $GITHUB_ENV + - name: Switch to branch ${{ env.pr_branch_name }} + run: git switch -c ${{ env.pr_branch_name }} + - name: NPM increment version + run: npm version ${{ github.event.release.tag_name }} --no-git-tag-version + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} + - name: Move root package.json + run: mv package.json package.json.altered + - name: Install dependencies for running bump-project-versions + run: npm install cross-env@7.0.3 ts-node@10.8.2 cli@1.0.1 app-root-path@3.0.0 + - name: Move root package.json back + run: mv package.json.altered package.json + - name: Bump default and template project version + run: node scripts/bump-project-versions.js + - name: Run git add + run: git add . + - name: Commit changes + run: git commit -m ${{ github.event.release.tag_name }} + - name: Push changes to new branch + run: git push --no-verify origin ${{ env.pr_branch_name }} + - name: Create version bump PR + uses: repo-sync/pull-request@v2 + with: + destination_branch: ${{ github.event.release.target_commitish }} + github_token: ${{ secrets.GITHUB_TOKEN }} + source_branch: ${{ env.pr_branch_name }} + pr_title: ${{ github.event.release.tag_name }} + pr_body: Bump version to ${{ github.event.release.tag_name }} \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..160ee47 --- /dev/null +++ b/.gitignore @@ -0,0 +1,112 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.test + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# Next.js build output +.next + +# Nuxt.js build / generate output +.nuxt + +# Gatsby files +.cache/ + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port +.buildcache + +build/ +dist/ +**/docs/ + +.DS_Store + +.history +.history/ + +index.ts.bak \ No newline at end of file diff --git a/.mocharc.js b/.mocharc.js new file mode 100644 index 0000000..ab86d6d --- /dev/null +++ b/.mocharc.js @@ -0,0 +1,42 @@ + +/* +CPAL-1.0 License + +The contents of this file are subject to the Common Public Attribution License +Version 1.0. (the "License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at +https://github.com/EtherealEngine/etherealengine/blob/dev/LICENSE. +The License is based on the Mozilla Public License Version 1.1, but Sections 14 +and 15 have been added to cover use of software over a computer network and +provide for limited attribution for the Original Developer. In addition, +Exhibit A has been modified to be consistent with Exhibit B. + +Software distributed under the License is distributed on an "AS IS" basis, +WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the +specific language governing rights and limitations under the License. + +The Original Code is Ethereal Engine. + +The Original Developer is the Initial Developer. The Initial Developer of the +Original Code is the Ethereal Engine team. + +All portions of the code written by the Ethereal Engine team are Copyright © 2021-2023 +Ethereal Engine. All Rights Reserved. +*/ + +module.exports = { + failZero: false, + parallel: false, + require: [ + 'tests/mocha.env', // init env here + 'jsdom-global/register' + ], + extension: [ + 'ts' + ], + bail: true, + exit: true, + recursive: true, + jobs: '1', + timeout: '60000' +}; diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..5c4d004 --- /dev/null +++ b/LICENSE @@ -0,0 +1,22 @@ +CPAL-1.0 License + +The contents of this file are subject to the Common Public Attribution License +Version 1.0. (the "License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at +https://github.com/EtherealEngine/etherealengine/blob/dev/LICENSE. +The License is based on the Mozilla Public License Version 1.1, but Sections 14 +and 15 have been added to cover use of software over a computer network and +provide for limited attribution for the Original Developer. In addition, +Exhibit A has been modified to be consistent with Exhibit B. + +Software distributed under the License is distributed on an "AS IS" basis, +WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the +specific language governing rights and limitations under the License. + +The Original Code is Ethereal Engine. + +The Original Developer is the Initial Developer. The Initial Developer of the +Original Code is the Ethereal Engine team. + +All portions of the code written by the Ethereal Engine team are Copyright © 2021-2023 +Ethereal Engine. All Rights Reserved. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..b5c1cf4 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# ee-assets-basic diff --git a/package.json b/package.json new file mode 100644 index 0000000..0cd678a --- /dev/null +++ b/package.json @@ -0,0 +1,31 @@ +{ + "name": "ee-assets-basic", + "version": "0.0.0", + "description": "", + "main": "", + "etherealEngine": { + "version": "1.4.0" + }, + "scripts": { + "test": "mocha --config .mocharc.js", + "format": "prettier --write \"**/*.{ts,tsx}\"", + "format-scss": "stylelint \"**/*.scss\" --fix", + "format-staged": "lint-staged", + "precommit": "no-master-commits -b master" + }, + "peerDependencies": {}, + "dependencies": {}, + "devDependencies": {}, + "license": "ISC", + "pre-commit": [ + "format-staged" + ], + "lint-staged": { + "*.{ts,tsx}": [ + "prettier --write" + ], + "*.scss": [ + "stylelint --fix" + ] + } +} \ No newline at end of file diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..0a60be2 --- /dev/null +++ b/readme.md @@ -0,0 +1,3 @@ +### Ethereal Engine Project + +This is an Ethereal Engine project. \ No newline at end of file diff --git a/tests/dummy.test.ts b/tests/dummy.test.ts new file mode 100644 index 0000000..1cbd7e6 --- /dev/null +++ b/tests/dummy.test.ts @@ -0,0 +1,24 @@ +/* +CPAL-1.0 License + +The contents of this file are subject to the Common Public Attribution License +Version 1.0. (the "License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at +https://github.com/EtherealEngine/etherealengine/blob/dev/LICENSE. +The License is based on the Mozilla Public License Version 1.1, but Sections 14 +and 15 have been added to cover use of software over a computer network and +provide for limited attribution for the Original Developer. In addition, +Exhibit A has been modified to be consistent with Exhibit B. + +Software distributed under the License is distributed on an "AS IS" basis, +WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the +specific language governing rights and limitations under the License. + +The Original Code is Ethereal Engine. + +The Original Developer is the Initial Developer. The Initial Developer of the +Original Code is the Ethereal Engine team. + +All portions of the code written by the Ethereal Engine team are Copyright © 2021-2023 +Ethereal Engine. All Rights Reserved. +*/ diff --git a/tests/mocha.env.js b/tests/mocha.env.js new file mode 100644 index 0000000..e944856 --- /dev/null +++ b/tests/mocha.env.js @@ -0,0 +1,37 @@ + +/* +CPAL-1.0 License + +The contents of this file are subject to the Common Public Attribution License +Version 1.0. (the "License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at +https://github.com/EtherealEngine/etherealengine/blob/dev/LICENSE. +The License is based on the Mozilla Public License Version 1.1, but Sections 14 +and 15 have been added to cover use of software over a computer network and +provide for limited attribution for the Original Developer. In addition, +Exhibit A has been modified to be consistent with Exhibit B. + +Software distributed under the License is distributed on an "AS IS" basis, +WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the +specific language governing rights and limitations under the License. + +The Original Code is Ethereal Engine. + +The Original Developer is the Initial Developer. The Initial Developer of the +Original Code is the Ethereal Engine team. + +All portions of the code written by the Ethereal Engine team are Copyright © 2021-2023 +Ethereal Engine. All Rights Reserved. +*/ + +process.env.APP_ENV = 'test' +process.env.NODE_ENV = 'test' +process.env.NODE_TLS_REJECT_UNAUTHORIZED='0' + +require("ts-node").register({ + project: './tsconfig.json', + files: true, + swc: true +}) + +require("fix-esm").register() diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..ca187ec --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,41 @@ +{ + "compilerOptions": { + "target": "esnext", + "lib": [ + "esnext", + "dom", + "dom.iterable", + "WebWorker" + ], + "allowJs": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "noEmit": true, + "module": "CommonJS", + "strict": false, + "strictNullChecks": true, + "strictBindCallApply": true, + "noImplicitAny": false, + "resolveJsonModule": true, + "esModuleInterop": true, + "moduleResolution": "node", + "sourceMap": true, + "jsx": "react", + "isolatedModules": false, + "experimentalDecorators": true, + "allowSyntheticDefaultImports": true, + "emitDecoratorMetadata": true, + "declaration": true, + "outDir": "./lib" + }, + "exclude": [ + "../projects/projects/**", + "**/node_modules/**" + ], + "include": [ + "../../../../__global.d.ts", + "../../../server-core/src/*", + "./**/*.ts", + "./**/*.tsx" + ] +} diff --git a/xrengine.config.ts b/xrengine.config.ts new file mode 100644 index 0000000..397409b --- /dev/null +++ b/xrengine.config.ts @@ -0,0 +1,36 @@ +/* +CPAL-1.0 License + +The contents of this file are subject to the Common Public Attribution License +Version 1.0. (the "License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at +https://github.com/EtherealEngine/etherealengine/blob/dev/LICENSE. +The License is based on the Mozilla Public License Version 1.1, but Sections 14 +and 15 have been added to cover use of software over a computer network and +provide for limited attribution for the Original Developer. In addition, +Exhibit A has been modified to be consistent with Exhibit B. + +Software distributed under the License is distributed on an "AS IS" basis, +WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the +specific language governing rights and limitations under the License. + +The Original Code is Ethereal Engine. + +The Original Developer is the Initial Developer. The Initial Developer of the +Original Code is the Ethereal Engine team. + +All portions of the code written by the Ethereal Engine team are Copyright © 2021-2023 +Ethereal Engine. All Rights Reserved. +*/ + +import type { ProjectConfigInterface } from '@etherealengine/projects/ProjectConfigInterface' + +const config: ProjectConfigInterface = { + onEvent: undefined, + thumbnail: '/static/etherealengine.png', + routes: {}, + services: undefined, + databaseSeed: undefined +} + +export default config