Integrate Webpack and Babel via Vue CLI

This commit is contained in:
Andrei Andreev 2021-11-14 11:01:37 +03:00
parent 6e969ea92e
commit 12a50a8174
137 changed files with 11602 additions and 614 deletions

3
.browserslistrc Normal file
View File

@ -0,0 +1,3 @@
> 1%
last 2 versions
not dead

View File

@ -1,2 +1 @@
javascripts/lib/*.js
javascripts/DragDropTouch.js
public/**/*.js

View File

@ -3,12 +3,12 @@
"eslint:recommended"
],
"env": {
"es2021": true,
"browser": true,
"jquery": true
"es6": true,
"node": true,
"browser": true
},
"parserOptions": {
"ecmaVersion": 2021,
"ecmaVersion": 6,
"sourceType": "module"
},
"rules": {

30
.github/workflows/deploy.yml vendored Normal file
View File

@ -0,0 +1,30 @@
name: Deploy 🚀
on:
pull_request:
branches:
- master
types: [closed]
push:
branches:
- master
jobs:
build:
name: Deploy 🚀
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
lfs: true
- uses: actions/setup-node@v2
with:
node-version: '14'
cache: 'npm'
- run: npm install
- run: npm run build
- uses: JamesIves/github-pages-deploy-action@4.1.3
with:
branch: gh-pages
folder: dist
single-commit: true

2
.gitignore vendored
View File

@ -1,3 +1,5 @@
dist
.vscode
.idea
node_modules

5
babel.config.js Normal file
View File

@ -0,0 +1,5 @@
module.exports = {
presets: [
"@vue/cli-plugin-babel/preset"
]
};

View File

@ -262,7 +262,7 @@ if (!isLocalEnvironment()) {
return;
}
if (commit === json.sha) return;
// GH Pages need some time to get rebuilt, so show message after 30 seconds
// GH Pages need some time to get rebuilt, so show message after 60 seconds
setTimeout(() => {
Modal.message.show(
"Refresh the page (game will be saved), we've got new stuff: " +
@ -270,7 +270,7 @@ if (!isLocalEnvironment()) {
updateRefresh,
true
);
}, 30000);
}, 60000);
});
}, 60000);
}

View File

@ -1,47 +0,0 @@
function mergeIntoGlobal(object) {
for (const key in object) {
const value = object[key];
const existingValue = window[key];
if (existingValue !== undefined) {
throw `Property ${key} already exists in global context`;
}
window[key] = value;
}
}
import * as Utils from "./core/utils.js";
mergeIntoGlobal(Utils);
import "./components/index.js";
import * as GameDB from "./core/secret-formula/index.js";
mergeIntoGlobal(GameDB);
// Start of bullshit
// Hevi, why
import * as AutomatorBlockEditor from "./components/reality/automator/automator-block-editor.js";
mergeIntoGlobal(AutomatorBlockEditor);
// Hevi, whyy
import * as AutomatorBlocks from "./components/reality/automator/automator-blocks.js";
mergeIntoGlobal(AutomatorBlocks);
// Garnet, nooo
import * as AutomatorTextEditor from "./components/reality/automator/automator-text-editor.js";
mergeIntoGlobal(AutomatorTextEditor);
// Spec, reeee
import * as PerksTab from "./components/reality/perks-tab.js";
mergeIntoGlobal(PerksTab);
// End of bullshit
import * as core from "./core/globals.js";
mergeIntoGlobal(core);
import * as game from "./game.js";
mergeIntoGlobal(game);
game.init();

11893
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,10 +1,21 @@
{
"private": true,
"scripts": {
"serve": "serve"
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^3.6.5",
"vue": "^2.6.11"
},
"dependencies": {},
"devDependencies": {
"eslint": "^8.2.0",
"serve": "^13.0.2"
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"vue-template-compiler": "^2.6.11"
}
}

View File

@ -17,7 +17,7 @@ TypeScript Project Setup
* Download and extract the [PlayFab JavaScriptSDK](https://github.com/PlayFab/JavaScriptSDK/archive/master.zip) to a local folder of your choosing {playFabSdkLocation}
* New Project Setup
* Open Visual Studio and create a new "Blank Node.js Web Application"
* ![TS image](/images/TypeScript/NewProj.png)
* ![TS image](/public/images/TypeScript/NewProj.png)
* This creates a project with several setup files
* [OPTIONAL] delete app.cs (We won't be using it)
* In Windows Explorer, navigate to {playFabSdkLocation}/PlayFabSdk and find the "src" folder
@ -26,7 +26,7 @@ TypeScript Project Setup
* Close the explorer windows, and return to Visual Studio
* Toggle the "Show All Files" button a few times, until you can see the PlayFab source files
* RClick "src" and "Include in Project"
* ![TS image](/images/TypeScript/IncludeSdk.png)
* ![TS image](/public/images/TypeScript/IncludeSdk.png)
* At this point, running the project will open a browser, and display the default Microsoft example
* Project setup complete!

View File

@ -89,4 +89,4 @@
</tr> </table>
</body>
</html>
</html>

View File

@ -9,8 +9,8 @@
<body>
<div id="depression"></div>
</body>
<script type="text/javascript" src="../javascripts/lib/vue.min.js"></script>
<script type="text/javascript" src="../javascripts/lib/break_infinity.min.js"></script>
<script type="text/javascript" src="../javascripts/lib/ad-notations.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.10"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/break_infinity.js@1.2.0/dist/break_infinity.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@antimatter-dimensions/notations@1.1.1/dist/ad-notations.min.js"></script>
<script type="text/javascript" src="depression.js"></script>
</html>

View File

@ -191,11 +191,19 @@ function gameLoop() {
updateUI();
}
function format(value, places, placesUnder1000) {
return notation.format(value, places, placesUnder1000);
}
function formatX(value, places, placesUnder1000) {
return `×${format(value, places, placesUnder1000)}`;
}
Vue.mixin({
methods: {
format(value, places, placesUnder1000) {
return notation.format(value, places, placesUnder1000);
}
format,
formatX
},
created() {
if (this.update) {

View File

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

Before

Width:  |  Height:  |  Size: 717 KiB

After

Width:  |  Height:  |  Size: 717 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 MiB

After

Width:  |  Height:  |  Size: 1.8 MiB

View File

Before

Width:  |  Height:  |  Size: 179 KiB

After

Width:  |  Height:  |  Size: 179 KiB

View File

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

View File

Before

Width:  |  Height:  |  Size: 512 B

After

Width:  |  Height:  |  Size: 512 B

View File

Before

Width:  |  Height:  |  Size: 459 B

After

Width:  |  Height:  |  Size: 459 B

View File

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 1.2 MiB

View File

Before

Width:  |  Height:  |  Size: 533 KiB

After

Width:  |  Height:  |  Size: 533 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 1.7 MiB

View File

Before

Width:  |  Height:  |  Size: 637 B

After

Width:  |  Height:  |  Size: 637 B

View File

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

View File

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 77 KiB

View File

Before

Width:  |  Height:  |  Size: 658 KiB

After

Width:  |  Height:  |  Size: 658 KiB

View File

Before

Width:  |  Height:  |  Size: 407 KiB

After

Width:  |  Height:  |  Size: 407 KiB

View File

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

Before

Width:  |  Height:  |  Size: 256 KiB

After

Width:  |  Height:  |  Size: 256 KiB

View File

Before

Width:  |  Height:  |  Size: 586 KiB

After

Width:  |  Height:  |  Size: 586 KiB

View File

@ -1,11 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Antimatter Dimensions</title>
<link rel="icon" type="image/png" href="icon.png">
<meta name="Antimatter Dimensions" content="A game about huge numbers and watching them go up." charset="utf-8" />
<meta name="Antimatter Dimensions" content="A game about huge numbers and watching them go up." >
<script type="text/javascript" src='https://cdn1.kongregate.com/javascripts/kongregate_api.js'></script>
<script type="text/javascript" src="javascripts/lib/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="lib/jquery-3.2.1.min.js"></script>
<link href="https://fonts.googleapis.com/css?family=PT+Mono" rel="stylesheet">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css" integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="stylesheets/codemirror/codemirror.css">
@ -56,41 +57,39 @@
</video>
</div>
<div id="performance-stats" class="c-performance-stats" style="display: none;"></div>
<!-- Here's some firebase stuff -->
<script src="https://www.gstatic.com/firebasejs/8.8.0/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.8.0/firebase-auth.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.8.0/firebase-database.js"></script>
<script type="text/javascript" src="lib/vue.js"></script>
<script type="text/javascript" src="lib/v-tooltip.min.js"></script>
<script type="text/javascript" src="lib/mousetrap.min.js"></script>
<script type="text/javascript" src="lib/break_infinity.min.js"></script>
<script type="text/javascript" src="lib/lz-string.min.js"></script>
<script type="text/javascript" src="lib/vis-network.min.js"></script>
<script type="text/javascript" src="lib/sha512.min.js"></script>
<script type="text/javascript" src="lib/deepmerge.js"></script>
<script type="text/javascript" src="lib/Sortable.min.js"></script>
<script type="text/javascript" src="lib/vuedraggable.umd.min.js"></script>
<script type="text/javascript" src="lib/Tween.min.js"></script>
<script type="text/javascript" src="lib/gamma.js"></script>
<script type="text/javascript" src="lib/vue-split-pane.min.js"></script>
<script type="text/javascript" src="lib/chevrotain.min.js"></script>
<script type="text/javascript" src="lib/codemirror.js"></script>
<script type="text/javascript" src="lib/simple.js"></script>
<script type="text/javascript" src="lib/show-hint.js"></script>
<script type="text/javascript" src="lib/lint.js"></script>
<script type="text/javascript" src="lib/active-line.js"></script>
<script type="text/javascript" src="lib/closebrackets.js"></script>
<script type="text/javascript" src="lib/ad-notations.min.js"></script>
<script type="text/javascript" src="lib/svg-pan-zoom.min.js"></script>
<script type="text/javascript" src="lib/pako.min.js"></script>
<script type="text/javascript" src="lib/base64-binary.js"></script>
<script type="text/javascript" src="lib/DragDropTouch.js"></script>
<script type="text/javascript" src="lib/longpress.js"></script>
<script type="text/javascript" src="PlayFab/PlayFabClientApi.js"></script>
</body>
<!-- Here's some firebase stuff -->
<script src="https://www.gstatic.com/firebasejs/8.8.0/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.8.0/firebase-auth.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.8.0/firebase-database.js"></script>
<script type="text/javascript" src="javascripts/lib/vue.js"></script>
<script type="text/javascript" src="javascripts/lib/v-tooltip.min.js"></script>
<script type="text/javascript" src="javascripts/lib/mousetrap.min.js"></script>
<script type="text/javascript" src="javascripts/lib/break_infinity.min.js"></script>
<script type="text/javascript" src="javascripts/lib/lz-string.min.js"></script>
<script type="text/javascript" src="javascripts/lib/vis-network.min.js"></script>
<script type="text/javascript" src="javascripts/lib/sha512.min.js"></script>
<script type="text/javascript" src="javascripts/lib/deepmerge.js"></script>
<script type="text/javascript" src="javascripts/lib/Sortable.min.js"></script>
<script type="text/javascript" src="javascripts/lib/vuedraggable.umd.min.js"></script>
<script type="text/javascript" src="javascripts/lib/Tween.min.js"></script>
<script type="text/javascript" src="javascripts/lib/gamma.js"></script>
<script type="text/javascript" src="javascripts/lib/vue-split-pane.min.js"></script>
<script type="text/javascript" src="javascripts/lib/chevrotain.min.js"></script>
<script type="text/javascript" src="javascripts/lib/codemirror.js"></script>
<script type="text/javascript" src="javascripts/lib/simple.js"></script>
<script type="text/javascript" src="javascripts/lib/show-hint.js"></script>
<script type="text/javascript" src="javascripts/lib/lint.js"></script>
<script type="text/javascript" src="javascripts/lib/active-line.js"></script>
<script type="text/javascript" src="javascripts/lib/closebrackets.js"></script>
<script type="text/javascript" src="javascripts/lib/ad-notations.min.js"></script>
<script type="text/javascript" src="javascripts/lib/svg-pan-zoom.min.js"></script>
<script type="text/javascript" src="javascripts/lib/pako.min.js"></script>
<script type="text/javascript" src="javascripts/lib/base64-binary.js"></script>
<script type="text/javascript" src="javascripts/lib/DragDropTouch.js"></script>
<script type="text/javascript" src="javascripts/lib/longpress.js"></script>
<script type="text/javascript" src="PlayFab/PlayFabClientApi.js"></script>
<script type="module" src="javascripts/main.js"></script>
</html>

View File

@ -5,7 +5,7 @@
<link rel="icon" type="image/png" href="icon.png">
<meta name="Antimatter Dimensions" content="A game about huge numbers and watching them go up." charset="utf-8" />
<script type="text/javascript" src='https://cdn1.kongregate.com/javascripts/kongregate_api.js'></script>
<script type="text/javascript" src="javascripts/lib/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="lib/jquery-3.2.1.min.js"></script>
<link href="https://fonts.googleapis.com/css?family=PT+Mono" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="stylesheets/ad-slider-component.css">
<link rel="stylesheet" type="text/css" href="stylesheets/styles.css?3">
@ -107,29 +107,29 @@
</div>
</body>
<script type="text/javascript" src="javascripts/lib/vue.js"></script>
<script type="text/javascript" src="javascripts/lib/v-tooltip.min.js"></script>
<script type="text/javascript" src="javascripts/lib/vuedraggable.js"></script>
<script type="text/javascript" src="javascripts/lib/Tween.min.js"></script>
<script type="text/javascript" src="lib/vue.js"></script>
<script type="text/javascript" src="lib/v-tooltip.min.js"></script>
<script type="text/javascript" src="public/lib/vuedraggable.js"></script>
<script type="text/javascript" src="lib/Tween.min.js"></script>
<script type="text/javascript" src="javascripts/DragDropTouch.js"></script>
<script type="text/javascript" src="javascripts/longpress.js"></script>
<script type="text/javascript" src="javascripts/core/polyfill.js"></script>
<script type="text/javascript" src="javascripts/core/extensions.js"></script>
<script type="text/javascript" src="../javascripts/core/polyfill.js"></script>
<script type="text/javascript" src="../javascripts/core/extensions.js"></script>
<script type="text/javascript" src="javascripts/components/common/plus-minus-button.js"></script>
<script type="text/javascript" src="javascripts/components/common/ad-slider-component.js"></script>
<script type="text/javascript" src="../javascripts/components/common/plus-minus-button.js"></script>
<script type="text/javascript" src="../javascripts/components/common/ad-slider-component.js"></script>
<script type="text/javascript" src="javascripts/core/app/ui.init.js"></script>
<script type="text/javascript" src="javascripts/core/app/player-progress.js"></script>
<script type="text/javascript" src="javascripts/core/app/modal.js"></script>
<script type="text/javascript" src="javascripts/core/app/themes.js"></script>
<script type="text/javascript" src="../javascripts/core/app/ui.init.js"></script>
<script type="text/javascript" src="../javascripts/core/app/player-progress.js"></script>
<script type="text/javascript" src="../javascripts/core/app/modal.js"></script>
<script type="text/javascript" src="../javascripts/core/app/themes.js"></script>
<script type="text/javascript" src="javascripts/core/notations.js"></script>
<script type="text/javascript" src="../javascripts/core/notations.js"></script>
<script type="text/javascript" src="javascripts/core/app/options.js"></script>
<script type="text/javascript" src="javascripts/core/event-hub.js"></script>
<script type="text/javascript" src="javascripts/core/app/ui.js"></script>
<script type="text/javascript" src="javascripts/core/app/notify.js"></script>
<script type="text/javascript" src="../javascripts/core/app/options.js"></script>
<script type="text/javascript" src="../javascripts/core/event-hub.js"></script>
<script type="text/javascript" src="../javascripts/core/app/ui.js"></script>
<script type="text/javascript" src="../javascripts/core/app/notify.js"></script>
</html>

Some files were not shown because too many files have changed in this diff Show More