16 | *
17 | * If we don't delay it, the canvas size in preload() and create() will be 0.
18 | * With the delay the canvas size will be set correctly.
19 | */
20 | async ngOnInit(): Promise
{
21 | console.log('HomePageComponent', 'ngOnInit');
22 | // eslint-disable-next-line @typescript-eslint/no-misused-promises
23 | setTimeout(this.init, 500);
24 | }
25 |
26 | async init(): Promise {
27 | await PhaserSingletonService.init();
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/apps/example-app-angular/src/app/pipes/reverse.pipe.ts:
--------------------------------------------------------------------------------
1 | /* eslint-disable @typescript-eslint/no-explicit-any */
2 | /* eslint-disable @typescript-eslint/no-unsafe-call */
3 | /* eslint-disable @typescript-eslint/explicit-module-boundary-types */
4 | /* eslint-disable @typescript-eslint/no-unsafe-member-access */
5 | import { Pipe, PipeTransform } from '@angular/core';
6 |
7 | @Pipe({ name: 'reverse' })
8 | export class ReversePipe implements PipeTransform {
9 | transform(value: any) {
10 | // eslint-disable-next-line @typescript-eslint/no-unsafe-return
11 | return value.slice().reverse();
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/apps/example-app-angular/src/app/shop/shop.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | Shop
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | Cheap Sword
22 | 10 seconds build time
23 |
24 |
25 |
26 | This sword won't take the blacksmith very long to create, but it looks a little flimsy.
27 |
28 | Purchase
29 |
30 |
31 |
32 |
33 |
34 |
35 | Fancy Sword
36 | 20 seconds build time
37 |
38 |
39 | A truly mysterious marvel! The craftmanship on this sword is amazing, and it has such a sharp looking blade...
40 |
41 | Purchase
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/apps/example-app-angular/src/app/shop/shop.component.scss:
--------------------------------------------------------------------------------
1 | .inventory-list {
2 | display: flex;
3 | }
4 |
5 | ion-card-content {
6 | height: 15.625rem;
7 | }
8 |
9 | ion-card {
10 | width: 50%;
11 | img {
12 | width: 50%;
13 | margin: auto;
14 | display: block;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/apps/example-app-angular/src/app/shop/shop.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { ShopPageComponent } from './shop.component';
4 |
5 | describe('ShopPageComponent', () => {
6 | let component: ShopPageComponent;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async () => {
10 | await TestBed.configureTestingModule({
11 | declarations: [ ShopPageComponent ]
12 | })
13 | .compileComponents();
14 | });
15 |
16 | beforeEach(() => {
17 | fixture = TestBed.createComponent(ShopPageComponent);
18 | component = fixture.componentInstance;
19 | fixture.detectChanges();
20 | });
21 |
22 | it('should create', () => {
23 | expect(component).toBeTruthy();
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/apps/example-app-angular/src/app/shop/shop.component.ts:
--------------------------------------------------------------------------------
1 | /* eslint-disable @typescript-eslint/no-unsafe-member-access */
2 | import { Component, OnInit } from '@angular/core';
3 | import { Router } from '@angular/router';
4 | import { SwordTypeEnum } from '@company-name/shared/data-access-model';
5 | import { PhaserSingletonService } from '@company-name/shared-phaser-singleton';
6 | import { ModalController } from '@ionic/angular';
7 |
8 | @Component({
9 | selector: 'openforge-shop',
10 | templateUrl: './shop.component.html',
11 | styleUrls: ['./shop.component.scss'],
12 | })
13 | export class ShopPageComponent implements OnInit {
14 | public isModal: boolean = false; // * Property to catch if component is on the modal or not
15 | constructor(private router: Router, private modalController: ModalController) {}
16 |
17 | ngOnInit(): void {
18 | console.log('ShopPageComponent ngOnInit');
19 | this.checkIfModal();
20 | }
21 |
22 | /**
23 | * * Purchase Sword
24 | */
25 | public async purchaseSword(type: string): Promise {
26 | const swordType = type === 'fancy' ? SwordTypeEnum.FANCY : SwordTypeEnum.CHEAP;
27 | console.log('shop.component.ts', `Purchasing ${swordType} Sword...`);
28 | await this.router.navigate(['/home']); // * Travel home first so that Phaser exists
29 | // eslint-disable-next-line @typescript-eslint/no-unsafe-call
30 | PhaserSingletonService.shopObservable.next(swordType);
31 | if (this.isModal) {
32 | this.closeModal();
33 | }
34 | }
35 |
36 | /**
37 | * * Check if component was opened on a modal
38 | */
39 | public checkIfModal(): void {
40 | void this.modalController.getTop().then(res => {
41 | if (res) {
42 | this.isModal = true;
43 | }
44 | });
45 | }
46 |
47 | /**
48 | * * Function to close modal
49 | */
50 | public closeModal(): void {
51 | void this.modalController.dismiss();
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/apps/example-app-angular/src/assets/blacksmith/blacksmith_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/src/assets/blacksmith/blacksmith_bg.png
--------------------------------------------------------------------------------
/apps/example-app-angular/src/assets/blacksmith/blacksmith_sprites.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/src/assets/blacksmith/blacksmith_sprites.png
--------------------------------------------------------------------------------
/apps/example-app-angular/src/assets/blacksmith/blacksmith_sprites_anim.json:
--------------------------------------------------------------------------------
1 | {
2 | "anims": [
3 | {
4 | "key": "blacksmith_hammer",
5 | "type": "frames",
6 | "repeat": -1,
7 | "frameRate": 6,
8 | "frames": [
9 | {
10 | "key": "blacksmith_hammer",
11 | "frame": "blacksmith_hammer_1"
12 | },
13 | {
14 | "key": "blacksmith_hammer",
15 | "frame": "blacksmith_hammer_2"
16 | },
17 | {
18 | "key": "blacksmith_hammer",
19 | "frame": "blacksmith_hammer_3"
20 | },
21 | {
22 | "key": "blacksmith_hammer",
23 | "frame": "blacksmith_hammer_4"
24 | }
25 | ]
26 | },
27 | {
28 | "key": "blacksmith_idle",
29 | "type": "frames",
30 | "repeat": -1,
31 | "frameRate": 6,
32 | "frames": [
33 | {
34 | "key": "blacksmith_idle",
35 | "frame": "blacksmith_idle_1"
36 | },
37 | {
38 | "key": "blacksmith_idle",
39 | "frame": "blacksmith_idle_2"
40 | },
41 | {
42 | "key": "blacksmith_idle",
43 | "frame": "blacksmith_idle_3"
44 | },
45 | {
46 | "key": "blacksmith_idle",
47 | "frame": "blacksmith_idle_4"
48 | }
49 | ]
50 | }
51 | ]
52 | }
--------------------------------------------------------------------------------
/apps/example-app-angular/src/assets/blacksmith/blacksmith_sprites_atlas.json:
--------------------------------------------------------------------------------
1 | {
2 | "frames": [
3 | {
4 | "filename": "blacksmith_hammer_1",
5 | "frame": {
6 | "w": 246,
7 | "h": 387,
8 | "x": 6,
9 | "y": 6
10 | },
11 | "anchor": {
12 | "x": 0.5,
13 | "y": 0.5
14 | }
15 | },
16 | {
17 | "filename": "blacksmith_hammer_2",
18 | "frame": {
19 | "w": 246,
20 | "h": 387,
21 | "x": 264,
22 | "y": 6
23 | },
24 | "anchor": {
25 | "x": 0.5,
26 | "y": 0.5
27 | }
28 | },
29 | {
30 | "filename": "blacksmith_hammer_3",
31 | "frame": {
32 | "w": 246,
33 | "h": 387,
34 | "x": 522,
35 | "y": 6
36 | },
37 | "anchor": {
38 | "x": 0.5,
39 | "y": 0.5
40 | }
41 | },
42 | {
43 | "filename": "blacksmith_hammer_4",
44 | "frame": {
45 | "w": 246,
46 | "h": 387,
47 | "x": 780,
48 | "y": 6
49 | },
50 | "anchor": {
51 | "x": 0.5,
52 | "y": 0.5
53 | }
54 | },
55 | {
56 | "filename": "blacksmith_idle_1",
57 | "frame": {
58 | "w": 246,
59 | "h": 387,
60 | "x": 6,
61 | "y": 405
62 | },
63 | "anchor": {
64 | "x": 0.5,
65 | "y": 0.5
66 | }
67 | },
68 | {
69 | "filename": "blacksmith_idle_2",
70 | "frame": {
71 | "w": 246,
72 | "h": 387,
73 | "x": 264,
74 | "y": 405
75 | },
76 | "anchor": {
77 | "x": 0.5,
78 | "y": 0.5
79 | }
80 | },
81 | {
82 | "filename": "blacksmith_idle_3",
83 | "frame": {
84 | "w": 246,
85 | "h": 387,
86 | "x": 522,
87 | "y": 405
88 | },
89 | "anchor": {
90 | "x": 0.5,
91 | "y": 0.5
92 | }
93 | },
94 | {
95 | "filename": "blacksmith_idle_4",
96 | "frame": {
97 | "w": 246,
98 | "h": 387,
99 | "x": 780,
100 | "y": 405
101 | },
102 | "anchor": {
103 | "x": 0.5,
104 | "y": 0.5
105 | }
106 | }
107 | ],
108 | "meta": {
109 | "description": "Atlas generado con Atlas Packer Gamma V2",
110 | "web": "https://gammafp.github.io/atlas-packer-phaser/"
111 | }
112 | }
--------------------------------------------------------------------------------
/apps/example-app-angular/src/assets/fancy_sword.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/src/assets/fancy_sword.png
--------------------------------------------------------------------------------
/apps/example-app-angular/src/assets/icon/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/src/assets/icon/favicon.png
--------------------------------------------------------------------------------
/apps/example-app-angular/src/assets/shapes.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/apps/example-app-angular/src/assets/swords/cheap_sword.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/src/assets/swords/cheap_sword.png
--------------------------------------------------------------------------------
/apps/example-app-angular/src/assets/swords/fancy_sword.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/src/assets/swords/fancy_sword.png
--------------------------------------------------------------------------------
/apps/example-app-angular/src/environments/environment.prod.ts:
--------------------------------------------------------------------------------
1 | export const environment = {
2 | production: true,
3 | };
4 |
--------------------------------------------------------------------------------
/apps/example-app-angular/src/environments/environment.ts:
--------------------------------------------------------------------------------
1 | // This file can be replaced during build by using the `fileReplacements` array.
2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
3 | // The list of file replacements can be found in `angular.json`.
4 |
5 | export const environment = {
6 | production: false,
7 | };
8 |
9 | /*
10 | * For easier debugging in development mode, you can import the following file
11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
12 | *
13 | * This import should be commented out in production mode because it will have a negative impact
14 | * on performance if an error is thrown.
15 | */
16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI.
17 |
--------------------------------------------------------------------------------
/apps/example-app-angular/src/global.scss:
--------------------------------------------------------------------------------
1 | /*
2 | * App Global CSS
3 | * ----------------------------------------------------------------------------
4 | * Put style rules here that you want to apply globally. These styles are for
5 | * the entire app and not just one component. Additionally, this file can be
6 | * used as an entry point to import other CSS/Sass files to be included in the
7 | * output CSS.
8 | * For more information on global stylesheets, visit the documentation:
9 | * https://ionicframework.com/docs/layout/global-stylesheets
10 | */
11 |
12 | /* Core CSS required for Ionic components to work properly */
13 | @import '~@ionic/angular/css/core.css';
14 |
15 | /* Basic CSS for apps built with Ionic */
16 | @import '~@ionic/angular/css/normalize.css';
17 | @import '~@ionic/angular/css/structure.css';
18 | @import '~@ionic/angular/css/typography.css';
19 | @import '~@ionic/angular/css/display.css';
20 |
21 | /* Optional CSS utils that can be commented out */
22 | @import '~@ionic/angular/css/padding.css';
23 | @import '~@ionic/angular/css/float-elements.css';
24 | @import '~@ionic/angular/css/text-alignment.css';
25 | @import '~@ionic/angular/css/text-transformation.css';
26 | @import '~@ionic/angular/css/flex-utils.css';
27 |
--------------------------------------------------------------------------------
/apps/example-app-angular/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Ionic App
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/apps/example-app-angular/src/main.ts:
--------------------------------------------------------------------------------
1 | import { enableProdMode } from '@angular/core';
2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3 |
4 | import { AppModule } from './app/app.module';
5 | import { environment } from './environments/environment';
6 |
7 | if (environment.production) {
8 | enableProdMode();
9 | }
10 |
11 | platformBrowserDynamic()
12 | .bootstrapModule(AppModule)
13 | .catch(err => console.log(err));
14 |
--------------------------------------------------------------------------------
/apps/example-app-angular/src/polyfills.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * This file includes polyfills needed by Angular and is loaded before the app.
3 | * You can add your own extra polyfills to this file.
4 | *
5 | * This file is divided into 2 sections:
6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main
8 | * file.
9 | *
10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that
11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
13 | *
14 | * Learn more in https://angular.io/guide/browser-support
15 | */
16 |
17 | /***************************************************************************************************
18 | * BROWSER POLYFILLS
19 | */
20 |
21 | /** IE11 requires the following for NgClass support on SVG elements */
22 | // import 'classlist.js'; // Run `npm install --save classlist.js`.
23 |
24 | /**
25 | * Web Animations `@angular/platform-browser/animations`
26 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
27 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
28 | */
29 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`.
30 |
31 | /**
32 | * By default, zone.js will patch all possible macroTask and DomEvents
33 | * user can disable parts of macroTask/DomEvents patch by setting following flags
34 | * because those flags need to be set before `zone.js` being loaded, and webpack
35 | * will put import in the top of bundle, so user need to create a separate file
36 | * in this directory (for example: zone-flags.ts), and put the following flags
37 | * into that file, and then add the following code before importing zone.js.
38 | * import './zone-flags';
39 | *
40 | * The flags allowed in zone-flags.ts are listed here.
41 | *
42 | * The following flags will work for all browsers.
43 | *
44 | * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
45 | * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
46 | * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
47 | *
48 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
49 | * with the following flag, it will bypass `zone.js` patch for IE/Edge
50 | *
51 | * (window as any).__Zone_enable_cross_context_check = true;
52 | *
53 | */
54 |
55 | import './zone-flags';
56 | /***************************************************************************************************
57 | * Zone JS is required by default for Angular itself.
58 | */
59 | import 'zone.js/dist/zone'; // Included with Angular CLI.
60 |
61 | /***************************************************************************************************
62 | * APPLICATION IMPORTS
63 | */
64 |
--------------------------------------------------------------------------------
/apps/example-app-angular/src/test.ts:
--------------------------------------------------------------------------------
1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files
2 |
3 | import 'zone.js/dist/zone-testing';
4 |
5 | import { getTestBed } from '@angular/core/testing';
6 | import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
7 |
8 | declare const require: {
9 | context(
10 | path: string,
11 | deep?: boolean,
12 | filter?: RegExp
13 | ): {
14 | keys(): string[];
15 | (id: string): T;
16 | };
17 | };
18 |
19 | // First, initialize the Angular testing environment.
20 | getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
21 | // Then we find all the tests.
22 | const context = require.context('./', true, /\.spec\.ts$/);
23 | // And load the modules.
24 | context.keys().map(context);
25 |
--------------------------------------------------------------------------------
/apps/example-app-angular/src/zone-flags.ts:
--------------------------------------------------------------------------------
1 | /* eslint-disable @typescript-eslint/no-explicit-any */
2 | /* eslint-disable @typescript-eslint/no-unsafe-member-access */
3 | /**
4 | * Prevents Angular change detection from
5 | * running with certain Web Component callbacks
6 | */
7 | // eslint-disable-next-line no-underscore-dangle
8 | (window as any).__Zone_disable_customElements = true;
9 |
--------------------------------------------------------------------------------
/apps/example-app-angular/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "./out-tsc/app",
5 | "types": [],
6 | "target": "ES2022",
7 | "useDefineForClassFields": false
8 | },
9 | "files": ["src/main.ts", "src/polyfills.ts"],
10 | "include": ["src/**/*.d.ts"]
11 | }
12 |
--------------------------------------------------------------------------------
/apps/example-app-angular/tsconfig.editor.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "include": ["**/*.ts"],
4 | "compilerOptions": {
5 | "types": ["jest", "node"]
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/apps/example-app-angular/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "exclude": ["jest.config.ts"],
4 | "compilerOptions": {
5 | "target": "es2020"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/apps/example-app-angular/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "files": ["src/test-setup.ts"],
9 | "include": ["**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"]
10 | }
11 |
--------------------------------------------------------------------------------
/apps/example-app-react-e2e/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["plugin:cypress/recommended", "../../.eslintrc.json"],
3 | "ignorePatterns": ["!**/*"],
4 | "overrides": [
5 | {
6 | "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7 | "rules": {}
8 | }
9 | ]
10 | }
11 |
--------------------------------------------------------------------------------
/apps/example-app-react-e2e/cypress.json:
--------------------------------------------------------------------------------
1 | {
2 | "fileServerFolder": ".",
3 | "fixturesFolder": "./src/fixtures",
4 | "integrationFolder": "./src/integration",
5 | "modifyObstructiveCode": false,
6 | "supportFile": "./src/support/index.ts",
7 | "pluginsFile": false,
8 | "video": true,
9 | "videosFolder": "../../dist/cypress/apps/example-app-react-e2e/videos",
10 | "screenshotsFolder": "../../dist/cypress/apps/example-app-react-e2e/screenshots",
11 | "chromeWebSecurity": false
12 | }
13 |
--------------------------------------------------------------------------------
/apps/example-app-react-e2e/project.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "example-app-react-e2e",
3 | "$schema": "../../node_modules/nx/schemas/project-schema.json",
4 | "sourceRoot": "apps/example-app-react-e2e/src",
5 | "projectType": "application",
6 | "targets": {
7 | "e2e": {
8 | "executor": "@nrwl/cypress:cypress",
9 | "options": {
10 | "cypressConfig": "apps/example-app-react-e2e/cypress.json",
11 | "devServerTarget": "example-app-react:serve:development",
12 | "testingType": "e2e"
13 | },
14 | "configurations": {
15 | "production": {
16 | "devServerTarget": "example-app-react:serve:production"
17 | }
18 | }
19 | },
20 | "lint": {
21 | "executor": "@nrwl/linter:eslint",
22 | "outputs": ["{options.outputFile}"],
23 | "options": {
24 | "lintFilePatterns": ["apps/example-app-react-e2e/**/*.{js,ts}"]
25 | }
26 | }
27 | },
28 | "tags": [],
29 | "implicitDependencies": ["example-app-react"]
30 | }
31 |
--------------------------------------------------------------------------------
/apps/example-app-react-e2e/src/fixtures/example.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Using fixtures to represent data",
3 | "email": "hello@cypress.io"
4 | }
5 |
--------------------------------------------------------------------------------
/apps/example-app-react-e2e/src/integration/app.spec.ts:
--------------------------------------------------------------------------------
1 | import { getGreeting } from '../support/app.po';
2 |
3 | describe('example-app-react', () => {
4 | beforeEach(() => cy.visit('/'));
5 |
6 | it('should display welcome message', () => {
7 | // Custom command example, see `../support/commands.ts` file
8 | cy.login('my-email@something.com', 'myPassword');
9 |
10 | // Function helper example, see `../support/app.po.ts` file
11 | getGreeting().contains('Welcome example-app-react');
12 | });
13 | });
14 |
--------------------------------------------------------------------------------
/apps/example-app-react-e2e/src/support/app.po.ts:
--------------------------------------------------------------------------------
1 | /* eslint-disable @typescript-eslint/no-unsafe-call */
2 | /* eslint-disable @typescript-eslint/explicit-module-boundary-types */
3 | /* eslint-disable @typescript-eslint/no-unsafe-member-access */
4 | // eslint-disable-next-line @typescript-eslint/no-unsafe-return
5 | export const getGreeting = () => cy.get('h1');
6 |
--------------------------------------------------------------------------------
/apps/example-app-react-e2e/src/support/commands.ts:
--------------------------------------------------------------------------------
1 | /* eslint-disable @typescript-eslint/no-unsafe-call */
2 | /* eslint-disable @typescript-eslint/no-unsafe-member-access */
3 | // ***********************************************
4 | // This example commands.js shows you how to
5 | // create various custom commands and overwrite
6 | // existing commands.
7 | //
8 | // For more comprehensive examples of custom
9 | // commands please read more here:
10 | // https://on.cypress.io/custom-commands
11 | // ***********************************************
12 |
13 | // eslint-disable-next-line @typescript-eslint/no-namespace
14 | declare namespace Cypress {
15 | // eslint-disable-next-line @typescript-eslint/no-unused-vars
16 | interface Chainable {
17 | login(email: string, password: string): void;
18 | }
19 | }
20 | //
21 | // -- This is a parent command --
22 | Cypress.Commands.add('login', (email, password) => {
23 | console.log('Custom command example: Login', email, password);
24 | });
25 | //
26 | // -- This is a child command --
27 | // Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
28 | //
29 | //
30 | // -- This is a dual command --
31 | // Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
32 | //
33 | //
34 | // -- This will overwrite an existing command --
35 | // Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
36 |
--------------------------------------------------------------------------------
/apps/example-app-react-e2e/src/support/index.ts:
--------------------------------------------------------------------------------
1 | // ***********************************************************
2 | // This example support/index.ts is processed and
3 | // loaded automatically before your test files.
4 | //
5 | // This is a great place to put global configuration and
6 | // behavior that modifies Cypress.
7 | //
8 | // You can change the location of this file or turn off
9 | // automatically serving support files with the
10 | // 'supportFile' configuration option.
11 | //
12 | // You can read more here:
13 | // https://on.cypress.io/configuration
14 | // ***********************************************************
15 |
16 | // Import commands.ts using ES2015 syntax:
17 | import './commands';
18 |
--------------------------------------------------------------------------------
/apps/example-app-react-e2e/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "sourceMap": false,
5 | "outDir": "../../dist/out-tsc",
6 | "allowJs": true,
7 | "types": ["cypress", "node"]
8 | },
9 | "include": ["src/**/*.ts", "src/**/*.js"]
10 | }
11 |
--------------------------------------------------------------------------------
/apps/example-app-react/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
3 | "ignorePatterns": ["!**/*"],
4 | "overrides": [
5 | {
6 | "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7 | "rules": {}
8 | },
9 | {
10 | "files": ["*.ts", "*.tsx"],
11 | "rules": {}
12 | },
13 | {
14 | "files": ["*.js", "*.jsx"],
15 | "rules": {}
16 | }
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/apps/example-app-react/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | ExampleAppReact
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/apps/example-app-react/project.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "example-app-react",
3 | "$schema": "../../node_modules/nx/schemas/project-schema.json",
4 | "sourceRoot": "apps/example-app-react/src",
5 | "projectType": "application",
6 | "targets": {
7 | "build": {
8 | "executor": "@nrwl/vite:build",
9 | "outputs": ["{options.outputPath}"],
10 | "defaultConfiguration": "production",
11 | "options": {
12 | "outputPath": "dist/apps/example-app-react"
13 | },
14 | "configurations": {
15 | "development": {
16 | "mode": "development"
17 | },
18 | "production": {
19 | "mode": "production"
20 | }
21 | }
22 | },
23 | "serve": {
24 | "executor": "@nrwl/vite:dev-server",
25 | "defaultConfiguration": "development",
26 | "options": {
27 | "buildTarget": "example-app-react:build"
28 | },
29 | "configurations": {
30 | "development": {
31 | "buildTarget": "example-app-react:build:development",
32 | "hmr": true
33 | },
34 | "production": {
35 | "buildTarget": "example-app-react:build:production",
36 | "hmr": false
37 | }
38 | }
39 | },
40 | "preview": {
41 | "executor": "@nrwl/vite:preview-server",
42 | "defaultConfiguration": "development",
43 | "options": {
44 | "buildTarget": "example-app-react:build"
45 | },
46 | "configurations": {
47 | "development": {
48 | "buildTarget": "example-app-react:build:development"
49 | },
50 | "production": {
51 | "buildTarget": "example-app-react:build:production"
52 | }
53 | }
54 | },
55 | "test": {
56 | "executor": "@nrwl/vite:test",
57 | "outputs": ["coverage/apps/example-app-react"],
58 | "options": {
59 | "passWithNoTests": true,
60 | "reportsDirectory": "../../coverage/apps/example-app-react"
61 | }
62 | },
63 | "lint": {
64 | "executor": "@nrwl/linter:eslint",
65 | "outputs": ["{options.outputFile}"],
66 | "options": {
67 | "lintFilePatterns": ["apps/example-app-react/**/*.{ts,tsx,js,jsx}"]
68 | }
69 | }
70 | },
71 | "tags": []
72 | }
73 |
--------------------------------------------------------------------------------
/apps/example-app-react/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-react/public/favicon.ico
--------------------------------------------------------------------------------
/apps/example-app-react/src/app/app.module.scss:
--------------------------------------------------------------------------------
1 | /* Your styles goes here. */
2 |
--------------------------------------------------------------------------------
/apps/example-app-react/src/app/app.spec.tsx:
--------------------------------------------------------------------------------
1 | import { render } from '@testing-library/react';
2 |
3 | import App from './app';
4 |
5 | describe('App', () => {
6 | it('should render successfully', () => {
7 | const { baseElement } = render( );
8 | expect(baseElement).toBeTruthy();
9 | });
10 |
11 | it('should have a greeting as the title', () => {
12 | const { getByText } = render( );
13 | expect(getByText(/Welcome example-app-react/gi)).toBeTruthy();
14 | });
15 | });
16 |
--------------------------------------------------------------------------------
/apps/example-app-react/src/app/app.tsx:
--------------------------------------------------------------------------------
1 | // eslint-disable-next-line @typescript-eslint/no-unused-vars
2 | import styles from './app.module.scss';
3 |
4 | import NxWelcome from './nx-welcome';
5 |
6 | export function App() {
7 | return (
8 | <>
9 |
10 |
11 |
12 | >
13 | );
14 | }
15 |
16 | export default App;
17 |
--------------------------------------------------------------------------------
/apps/example-app-react/src/assets/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-react/src/assets/.gitkeep
--------------------------------------------------------------------------------
/apps/example-app-react/src/main.tsx:
--------------------------------------------------------------------------------
1 | import { StrictMode } from 'react';
2 | import * as ReactDOM from 'react-dom/client';
3 |
4 | import App from './app/app';
5 |
6 | const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
7 | root.render(
8 |
9 |
10 |
11 | );
12 |
--------------------------------------------------------------------------------
/apps/example-app-react/src/styles.scss:
--------------------------------------------------------------------------------
1 | /* You can add global styles to this file, and also import other style files */
2 |
--------------------------------------------------------------------------------
/apps/example-app-react/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "types": ["node"]
6 | },
7 | "files": ["../../node_modules/@nrwl/react/typings/cssmodule.d.ts", "../../node_modules/@nrwl/react/typings/image.d.ts"],
8 | "exclude": ["src/**/*.spec.ts", "src/**/*.test.ts", "src/**/*.spec.tsx", "src/**/*.test.tsx", "src/**/*.spec.js", "src/**/*.test.js", "src/**/*.spec.jsx", "src/**/*.test.jsx"],
9 | "include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"]
10 | }
11 |
--------------------------------------------------------------------------------
/apps/example-app-react/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "jsx": "react-jsx",
4 | "allowJs": false,
5 | "esModuleInterop": false,
6 | "allowSyntheticDefaultImports": true,
7 | "strict": true,
8 | "types": ["vite/client", "vitest"]
9 | },
10 | "files": [],
11 | "include": [],
12 | "references": [
13 | {
14 | "path": "./tsconfig.app.json"
15 | },
16 | {
17 | "path": "./tsconfig.spec.json"
18 | }
19 | ],
20 | "extends": "../../tsconfig.base.json"
21 | }
22 |
--------------------------------------------------------------------------------
/apps/example-app-react/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "types": ["vitest/globals", "node"]
6 | },
7 | "include": [
8 | "vite.config.ts",
9 | "src/**/*.test.ts",
10 | "src/**/*.spec.ts",
11 | "src/**/*.test.tsx",
12 | "src/**/*.spec.tsx",
13 | "src/**/*.test.js",
14 | "src/**/*.spec.js",
15 | "src/**/*.test.jsx",
16 | "src/**/*.spec.jsx",
17 | "src/**/*.d.ts"
18 | ],
19 | "files": ["../../node_modules/@nrwl/react/typings/cssmodule.d.ts", "../../node_modules/@nrwl/react/typings/image.d.ts"]
20 | }
21 |
--------------------------------------------------------------------------------
/apps/example-app-react/vite.config.ts:
--------------------------------------------------------------------------------
1 | ///
2 | import react from '@vitejs/plugin-react';
3 | import { defineConfig } from 'vite';
4 | import viteTsConfigPaths from 'vite-tsconfig-paths';
5 |
6 | export default defineConfig({
7 | cacheDir: '../../node_modules/.vite/example-app-react',
8 |
9 | server: {
10 | port: 4200,
11 | host: 'localhost',
12 | },
13 |
14 | preview: {
15 | port: 4300,
16 | host: 'localhost',
17 | },
18 |
19 | plugins: [
20 | react(),
21 | viteTsConfigPaths({
22 | root: '../../',
23 | }),
24 | ],
25 |
26 | // Uncomment this if you are using workers.
27 | // worker: {
28 | // plugins: [
29 | // viteTsConfigPaths({
30 | // root: '../../',
31 | // }),
32 | // ],
33 | // },
34 |
35 | test: {
36 | globals: true,
37 | cache: {
38 | dir: '../../node_modules/.vitest',
39 | },
40 | environment: 'jsdom',
41 | include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
42 | },
43 | });
44 |
--------------------------------------------------------------------------------
/apps/example-app-vue/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | dist
12 | dist-ssr
13 | *.local
14 |
15 | # Editor directories and files
16 | .vscode/*
17 | !.vscode/extensions.json
18 | .idea
19 | .DS_Store
20 | *.suo
21 | *.ntvs*
22 | *.njsproj
23 | *.sln
24 | *.sw?
25 |
--------------------------------------------------------------------------------
/apps/example-app-vue/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
3 | }
4 |
--------------------------------------------------------------------------------
/apps/example-app-vue/README.md:
--------------------------------------------------------------------------------
1 | # Vue 3 + TypeScript + Vite
2 |
3 | This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `
12 |