├── .browserslistrc ├── .eslintrc.js ├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── babel.config.js ├── jest.config.js ├── package-lock.json ├── package.json ├── postcss.config.js ├── public ├── favicon.ico └── index.html ├── src ├── App.ts ├── VueApp.vue ├── VueFilters.ts ├── assets │ ├── images │ │ └── currencies │ │ │ ├── money.svg │ │ │ └── secondary.svg │ ├── logo.png │ └── socials │ │ ├── discord.png │ │ ├── docusaurus.svg │ │ └── github.png ├── components │ ├── developer-panel │ │ ├── fields │ │ │ ├── igt-button-field.vue │ │ │ ├── igt-choice-field.vue │ │ │ ├── igt-display-field.vue │ │ │ ├── igt-number-field.vue │ │ │ └── igt-range-field.vue │ │ └── igt-developer-panel.vue │ ├── features │ │ ├── achievements │ │ │ └── igt-achievements.vue │ │ ├── codes │ │ │ └── igt-redeemable-codes.vue │ │ ├── inventory │ │ │ ├── igt-inventory-slot-highlight.vue │ │ │ ├── igt-inventory-slot.vue │ │ │ └── igt-inventory.vue │ │ ├── key-items │ │ │ ├── igt-key-item-small.vue │ │ │ ├── igt-key-item.vue │ │ │ └── igt-key-items.vue │ │ ├── loot-tables │ │ │ ├── igt-loot-entry.vue │ │ │ ├── igt-loot-reward.vue │ │ │ └── igt-loot-table.vue │ │ ├── settings │ │ │ ├── igt-boolean-setting.vue │ │ │ └── igt-settings.vue │ │ ├── special-events │ │ │ ├── igt-special-event.vue │ │ │ └── igt-special-events.vue │ │ └── wallet │ │ │ ├── igt-currency.vue │ │ │ └── igt-wallet.vue │ ├── tools │ │ ├── actions │ │ │ └── igt-action.vue │ │ ├── boosters │ │ │ └── igt-booster.vue │ │ ├── exp-level │ │ │ └── igt-exp-level.vue │ │ └── upgrades │ │ │ └── igt-discrete-upgrade.vue │ └── util │ │ ├── igt-feature.vue │ │ ├── igt-notification.vue │ │ ├── igt-notifications.vue │ │ ├── igt-progress-bar.vue │ │ ├── igt-tab.vue │ │ ├── igt-tabs.vue │ │ └── sidebar │ │ ├── igt-sidebar-category.vue │ │ ├── igt-sidebar-external-link.vue │ │ └── igt-sidebar-layout.vue ├── index.css ├── main.ts ├── my-game │ ├── MyFeatures.ts │ └── MyGame.ts ├── shims-tsx.d.ts ├── shims-vue.d.ts └── vt-notifications.ts ├── tailwind.config.js ├── tests └── smoke │ └── Game.spec.ts ├── tsconfig.json └── vue.config.js /.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | not dead 4 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true 5 | }, 6 | 'extends': [ 7 | 'plugin:vue/essential', 8 | 'eslint:recommended', 9 | '@vue/typescript/recommended' 10 | ], 11 | parserOptions: { 12 | ecmaVersion: 2020 13 | }, 14 | rules: { 15 | '@typescript-eslint/no-inferrable-types': 'off', 16 | '@typescript-eslint/no-empty-interface': 'off', 17 | 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', 18 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off' 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | 6 | # Jest 7 | coverage 8 | 9 | # local env files 10 | .env.local 11 | .env.*.local 12 | 13 | # Log files 14 | npm-debug.log* 15 | yarn-debug.log* 16 | yarn-error.log* 17 | pnpm-debug.log* 18 | 19 | # Editor directories and files 20 | .idea 21 | .vscode 22 | *.suo 23 | *.ntvs* 24 | *.njsproj 25 | *.sln 26 | *.sw? 27 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | 3 | node_js: 4 | - "14" 5 | 6 | cache: 7 | directories: 8 | - node_modules 9 | 10 | 11 | script: 12 | - npm install codecov -g 13 | - npm run build 14 | - npm run test 15 | - npm run lint 16 | 17 | deploy: 18 | provider: pages 19 | skip_cleanup: true 20 | github_token: $GITHUB_TOKEN 21 | local_dir: dist 22 | on: 23 | branch: master 24 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 123ishaTest 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # igt-vue 2 | > A template Vue project to quickly create incremental games with the igt-library. 3 | 4 | [Please visit the actual Docs here](https://123ishatest.github.io/igt-docs) 5 | 6 | ## Requirements 7 | - [Nodejs](https://nodejs.org/en/) >= v12.13.0. 8 | 9 | ## Project setup 10 | ``` 11 | npm install 12 | ``` 13 | 14 | ### Compiles and hot-reloads for development 15 | ``` 16 | npm run serve 17 | ``` 18 | 19 | ### Compiles and minifies for production 20 | ``` 21 | npm run build 22 | ``` 23 | 24 | ### Lints and fixes files 25 | ``` 26 | npm run lint 27 | ``` 28 | 29 | ### Troubleshooting 30 | 31 | #### .flat is not a function 32 | If you get the following error 33 | ``` 34 | Syntax Error: TypeError: [(...variantsValue),(...extensions)].flat is not a function 35 | ``` 36 | This is caused by not having Nodejs >= v12.13.0. Please update your node version. 37 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preset: '@vue/cli-plugin-unit-jest/presets/typescript-and-babel', 3 | collectCoverage: true, 4 | collectCoverageFrom: ['src/ig-template/**/*.{js,jsx,ts}'], 5 | testMatch: ["/tests/**/*.{ts, js}"], 6 | transformIgnorePatterns: [ 7 | "node_modules/(?!(lodash-es" 8 | + "|incremental-game-template" 9 | + ")/)", 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "igt-vue", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint", 9 | "test": "vue-cli-service test:unit" 10 | }, 11 | "dependencies": { 12 | "@fortawesome/fontawesome-free": "^5.15.2", 13 | "@tailwindcss/postcss7-compat": "^2.0.3", 14 | "autoprefixer": "^9.8.6", 15 | "core-js": "^3.6.5", 16 | "incremental-game-template": "^1.2.1", 17 | "lodash-es": "^4.17.21", 18 | "mousetrap": "^1.6.5", 19 | "postcss": "^7.0.35", 20 | "strongly-typed-events": "^1.6.17", 21 | "tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.0.3", 22 | "vt-notifications": "^0.3.1", 23 | "vue": "^2.6.11" 24 | }, 25 | "devDependencies": { 26 | "@types/jest": "^26.0.14", 27 | "@types/lodash-es": "^4.17.4", 28 | "@types/mousetrap": "^1.6.4", 29 | "@typescript-eslint/eslint-plugin": "^2.33.0", 30 | "@typescript-eslint/parser": "^2.33.0", 31 | "@vue/cli-plugin-babel": "~4.5.0", 32 | "@vue/cli-plugin-eslint": "~4.5.0", 33 | "@vue/cli-plugin-typescript": "~4.5.0", 34 | "@vue/cli-plugin-unit-jest": "^4.5.11", 35 | "@vue/cli-service": "~4.5.0", 36 | "@vue/eslint-config-typescript": "^5.0.2", 37 | "@vue/test-utils": "^1.1.3", 38 | "eslint": "^6.7.2", 39 | "eslint-plugin-vue": "^6.2.2", 40 | "jest": "^26.6.3", 41 | "ts-jest": "^26.5.1", 42 | "typescript": "^4.4.3", 43 | "vue-template-compiler": "^2.6.11" 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/123ishaTest/igt-vue/8fad6c9b078e4dc245989abf24ec14f5427f5d9d/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | <%= htmlWebpackPlugin.options.title %> 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/App.ts: -------------------------------------------------------------------------------- 1 | import {MyGame} from "./my-game/MyGame"; 2 | import {IgtSettings} from "incremental-game-template"; 3 | 4 | export class App { 5 | static inProduction: boolean = (process.env.NODE_ENV === "production"); 6 | 7 | static game: MyGame; 8 | 9 | static start(): void { 10 | this.game = this.getDefaultGame(); 11 | this.game.initialize(); 12 | this.game.load(); 13 | this.game.start(); 14 | } 15 | 16 | public static getDefaultGame(): MyGame { 17 | return new MyGame( 18 | { 19 | settings: new IgtSettings(), 20 | // Add your own features here. 21 | } 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/VueApp.vue: -------------------------------------------------------------------------------- 1 | 31 | 32 | 67 | 68 | 70 | -------------------------------------------------------------------------------- /src/VueFilters.ts: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | 3 | Vue.filter('numberFormat', function (value: number) { 4 | if (value == undefined) { 5 | return ""; 6 | } 7 | return value.toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); 8 | }) 9 | 10 | Vue.filter('dateFormat', function (date: Date) { 11 | if (date == undefined) { 12 | return ""; 13 | } 14 | 15 | const year = new Intl.DateTimeFormat('en', {year: 'numeric'}).format(date); 16 | const month = new Intl.DateTimeFormat('en', {month: 'long'}).format(date); 17 | const day = new Intl.DateTimeFormat('en', {day: '2-digit'}).format(date); 18 | 19 | const hours = date.getHours(); 20 | const hoursString = hours < 10 ? `0${hours}` : `${hours}`; 21 | const minutes = date.getMinutes(); 22 | const minutesString = minutes < 10 ? `0${minutes}` : `${minutes}`; 23 | 24 | return `${day} ${month} ${year} ${hoursString}:${minutesString}`; 25 | 26 | }) 27 | 28 | Vue.filter('humanizeString', function (string: string) { 29 | if (string == undefined) { 30 | return ""; 31 | } 32 | string = string.charAt(0).toUpperCase() + string.slice(1); 33 | string.replace("_", " ").replace("-", " "); 34 | return string; 35 | }) 36 | -------------------------------------------------------------------------------- /src/assets/images/currencies/money.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/assets/images/currencies/secondary.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/123ishaTest/igt-vue/8fad6c9b078e4dc245989abf24ec14f5427f5d9d/src/assets/logo.png -------------------------------------------------------------------------------- /src/assets/socials/discord.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/123ishaTest/igt-vue/8fad6c9b078e4dc245989abf24ec14f5427f5d9d/src/assets/socials/discord.png -------------------------------------------------------------------------------- /src/assets/socials/docusaurus.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/socials/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/123ishaTest/igt-vue/8fad6c9b078e4dc245989abf24ec14f5427f5d9d/src/assets/socials/github.png -------------------------------------------------------------------------------- /src/components/developer-panel/fields/igt-button-field.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 30 | 31 | 34 | -------------------------------------------------------------------------------- /src/components/developer-panel/fields/igt-choice-field.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 27 | 28 | 31 | -------------------------------------------------------------------------------- /src/components/developer-panel/fields/igt-display-field.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 23 | 24 | 27 | -------------------------------------------------------------------------------- /src/components/developer-panel/fields/igt-number-field.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 25 | 26 | 29 | -------------------------------------------------------------------------------- /src/components/developer-panel/fields/igt-range-field.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 23 | 24 | 27 | -------------------------------------------------------------------------------- /src/components/developer-panel/igt-developer-panel.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 45 | 46 | 49 | -------------------------------------------------------------------------------- /src/components/features/achievements/igt-achievements.vue: -------------------------------------------------------------------------------- 1 | 22 | 57 | 58 | 61 | -------------------------------------------------------------------------------- /src/components/features/codes/igt-redeemable-codes.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 62 | 63 | 66 | -------------------------------------------------------------------------------- /src/components/features/inventory/igt-inventory-slot-highlight.vue: -------------------------------------------------------------------------------- 1 | 28 | 29 | 81 | 82 | 85 | -------------------------------------------------------------------------------- /src/components/features/inventory/igt-inventory-slot.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 62 | 63 | 66 | -------------------------------------------------------------------------------- /src/components/features/inventory/igt-inventory.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | 79 | 80 | 83 | -------------------------------------------------------------------------------- /src/components/features/key-items/igt-key-item-small.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 24 | 25 | 27 | -------------------------------------------------------------------------------- /src/components/features/key-items/igt-key-item.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 36 | 37 | 39 | -------------------------------------------------------------------------------- /src/components/features/key-items/igt-key-items.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 43 | 44 | 46 | -------------------------------------------------------------------------------- /src/components/features/loot-tables/igt-loot-entry.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 58 | 59 | 61 | -------------------------------------------------------------------------------- /src/components/features/loot-tables/igt-loot-reward.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 39 | 40 | 42 | -------------------------------------------------------------------------------- /src/components/features/loot-tables/igt-loot-table.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | 47 | 48 | 50 | -------------------------------------------------------------------------------- /src/components/features/settings/igt-boolean-setting.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 45 | 46 | 48 | -------------------------------------------------------------------------------- /src/components/features/settings/igt-settings.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 33 | 34 | 37 | -------------------------------------------------------------------------------- /src/components/features/special-events/igt-special-event.vue: -------------------------------------------------------------------------------- 1 | 19 | 71 | 72 | 75 | -------------------------------------------------------------------------------- /src/components/features/special-events/igt-special-events.vue: -------------------------------------------------------------------------------- 1 | 18 | 73 | 74 | 77 | -------------------------------------------------------------------------------- /src/components/features/wallet/igt-currency.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 43 | 44 | 46 | -------------------------------------------------------------------------------- /src/components/features/wallet/igt-wallet.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 22 | 23 | 26 | -------------------------------------------------------------------------------- /src/components/tools/actions/igt-action.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 38 | 39 | 42 | -------------------------------------------------------------------------------- /src/components/tools/boosters/igt-booster.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 44 | 45 | 48 | -------------------------------------------------------------------------------- /src/components/tools/exp-level/igt-exp-level.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 40 | 41 | 44 | -------------------------------------------------------------------------------- /src/components/tools/upgrades/igt-discrete-upgrade.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 32 | 33 | 36 | -------------------------------------------------------------------------------- /src/components/util/igt-feature.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 19 | 20 | 23 | -------------------------------------------------------------------------------- /src/components/util/igt-notification.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 60 | 61 | 64 | -------------------------------------------------------------------------------- /src/components/util/igt-notifications.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | 30 | 31 | 34 | -------------------------------------------------------------------------------- /src/components/util/igt-progress-bar.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 29 | 30 | 33 | -------------------------------------------------------------------------------- /src/components/util/igt-tab.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 34 | 35 | 38 | -------------------------------------------------------------------------------- /src/components/util/igt-tabs.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 42 | 43 | 46 | -------------------------------------------------------------------------------- /src/components/util/sidebar/igt-sidebar-category.vue: -------------------------------------------------------------------------------- 1 | 5 | 6 | 24 | 25 | 28 | -------------------------------------------------------------------------------- /src/components/util/sidebar/igt-sidebar-external-link.vue: -------------------------------------------------------------------------------- 1 | 5 | 6 | 31 | 32 | 35 | -------------------------------------------------------------------------------- /src/components/util/sidebar/igt-sidebar-layout.vue: -------------------------------------------------------------------------------- 1 | 72 | 73 | 112 | 113 | 118 | -------------------------------------------------------------------------------- /src/index.css: -------------------------------------------------------------------------------- 1 | @import '~@fortawesome/fontawesome-free/css/all.css'; 2 | 3 | @tailwind base; 4 | @tailwind components; 5 | @tailwind utilities; 6 | 7 | .hover-highlight { 8 | @apply transition duration-300 ease-out transform hover:-translate-y-1 hover:scale-105; 9 | } 10 | 11 | /* Tooltips */ 12 | .tooltip { 13 | @apply hidden absolute; 14 | } 15 | 16 | .has-tooltip:hover .tooltip { 17 | @apply block z-50 border-4 rounded-md bg-gray-900 p-2 18 | } 19 | 20 | 21 | .feature-tab { 22 | @apply p-4; 23 | } 24 | 25 | .btn { 26 | @apply mx-1 my-1 py-2 px-4 font-semibold rounded-lg shadow-md disabled:opacity-50 text-sm sm:text-lg; 27 | } 28 | 29 | @layer utilities { 30 | .filter-none { 31 | filter: none; 32 | } 33 | 34 | .filter-grayscale { 35 | filter: grayscale(100%); 36 | } 37 | } 38 | 39 | .input-primary { 40 | @apply border border-gray-300 p-2 my-2 rounded-md focus:outline-none focus:ring-2 ring-blue-200 text-black; 41 | } 42 | 43 | .input-range { 44 | @apply border border-gray-300 py-2 my-2 rounded-md focus:outline-none; 45 | } 46 | 47 | .btn-green { 48 | @apply text-white bg-green-500 hover:bg-green-600; 49 | } 50 | 51 | .btn-blue { 52 | @apply text-white bg-blue-500 hover:bg-blue-600; 53 | } 54 | 55 | .btn-red { 56 | @apply text-white bg-red-500 hover:bg-red-600; 57 | } 58 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueApp from './VueApp.vue' 3 | import {App} from "./App"; 4 | 5 | import Notifications from "vt-notifications"; 6 | 7 | import './VueFilters'; 8 | 9 | import "./index.css"; 10 | 11 | Vue.config.productionTip = false 12 | 13 | Vue.use(Notifications); 14 | 15 | declare global { 16 | interface Window { 17 | App: App; 18 | } 19 | } 20 | 21 | 22 | /** 23 | * Start the application when all html elements are loaded. 24 | */ 25 | window.onload = function () { 26 | App.start(); 27 | 28 | // Expose the App class to the window (and the console) 29 | if (!App.inProduction && typeof window !== undefined) { 30 | console.log('Exposing App to console'); 31 | window.App = App; 32 | } 33 | 34 | 35 | console.log("Launched"); 36 | 37 | new Vue({ 38 | render: h => h(VueApp), 39 | }).$mount('#app') 40 | 41 | 42 | }; 43 | 44 | 45 | -------------------------------------------------------------------------------- /src/my-game/MyFeatures.ts: -------------------------------------------------------------------------------- 1 | import {IgtFeatures} from "incremental-game-template"; 2 | 3 | export interface MyFeatures extends IgtFeatures { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/my-game/MyGame.ts: -------------------------------------------------------------------------------- 1 | import {IgtGame} from "incremental-game-template"; 2 | import {MyFeatures} from "@/my-game/MyFeatures"; 3 | 4 | export class MyGame extends IgtGame { 5 | // @TODO Update SAVE_KEY to something unique 6 | protected readonly SAVE_KEY: string = 'igt-vue'; 7 | // @TODO Update TICK_DURATION to an appropriate value 8 | protected readonly TICK_DURATION: number = 0.01; 9 | features: MyFeatures; 10 | 11 | constructor(features: MyFeatures) { 12 | super(); 13 | this.features = features; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/shims-tsx.d.ts: -------------------------------------------------------------------------------- 1 | import Vue, { VNode } from 'vue' 2 | 3 | declare global { 4 | namespace JSX { 5 | // tslint:disable no-empty-interface 6 | interface Element extends VNode {} 7 | // tslint:disable no-empty-interface 8 | interface ElementClass extends Vue {} 9 | interface IntrinsicElements { 10 | [elem: string]: any; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/shims-vue.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.vue' { 2 | import Vue from 'vue' 3 | export default Vue 4 | } 5 | -------------------------------------------------------------------------------- /src/vt-notifications.ts: -------------------------------------------------------------------------------- 1 | declare module 'vt-notifications'; 2 | -------------------------------------------------------------------------------- /tailwind.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | purge: ['./index.html', './src/**/*.{vue,js,ts,jsx,tsx}'], 3 | darkMode: 'class', // or 'media' or 'class' 4 | theme: { 5 | extend: {}, 6 | }, 7 | variants: { 8 | extend: { 9 | 'opacity': 'disabled', 10 | }, 11 | }, 12 | plugins: [], 13 | } 14 | -------------------------------------------------------------------------------- /tests/smoke/Game.spec.ts: -------------------------------------------------------------------------------- 1 | import {App} from "@/App"; 2 | import VueApp from "@/VueApp.vue"; 3 | 4 | import '@/VueFilters'; 5 | import {mount} from "@vue/test-utils"; 6 | 7 | /** 8 | * This smoke test starts the game and runs 100 game ticks. 9 | * It will also mount the Vue instance. 10 | * It fails if any exceptions are thrown. 11 | */ 12 | describe('Game launch smoke test', () => { 13 | 14 | test('smoke test', () => { 15 | expect(() => { 16 | App.start() 17 | 18 | mount(VueApp); 19 | 20 | for (let i = 0; i < 100; i++) { 21 | App.game.update(); 22 | } 23 | }).not.toThrow(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "esnext", 4 | "module": "esnext", 5 | "strict": true, 6 | "jsx": "preserve", 7 | "importHelpers": true, 8 | "moduleResolution": "node", 9 | "skipLibCheck": true, 10 | "esModuleInterop": true, 11 | "allowSyntheticDefaultImports": true, 12 | "sourceMap": true, 13 | "baseUrl": ".", 14 | "types": [ 15 | "webpack-env", 16 | "jest" 17 | ], 18 | "paths": { 19 | "@/*": [ 20 | "src/*" 21 | ] 22 | }, 23 | "lib": [ 24 | "esnext", 25 | "dom", 26 | "dom.iterable", 27 | "scripthost" 28 | ] 29 | }, 30 | "include": [ 31 | "src/**/*.ts", 32 | "src/**/*.tsx", 33 | "src/**/*.vue", 34 | "tests/**/*.ts", 35 | "tests/**/*.tsx" 36 | ], 37 | "exclude": [ 38 | "node_modules" 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /vue.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | publicPath: process.env.NODE_ENV === 'production' 3 | ? '/incremental-game-template/' 4 | : '/' 5 | } --------------------------------------------------------------------------------