chore: organize pnpm workspaces
This commit is contained in:
parent
45507df720
commit
dab366496e
10 changed files with 141 additions and 23 deletions
|
|
@ -9,7 +9,8 @@
|
||||||
<title>Play Minesweeper online for FREE!</title>
|
<title>Play Minesweeper online for FREE!</title>
|
||||||
|
|
||||||
<link rel="shortcut icon" type="image/png" href="/favicon.ico" />
|
<link rel="shortcut icon" type="image/png" href="/favicon.ico" />
|
||||||
<link rel="stylesheet" href="./main.css" >
|
<link rel="stylesheet" href="./main.css" />
|
||||||
|
<link rel="stylesheet" href="../utils/loading/loading.css" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="body-wrapper">
|
<div id="body-wrapper">
|
||||||
|
|
|
||||||
17
app/main.js
17
app/main.js
|
|
@ -1,5 +1,7 @@
|
||||||
import mnswpr from '../lib/mnswpr.js'
|
import mnswpr from '@ayo-run/mnswpr/mnswpr.js'
|
||||||
import * as pkg from '../package.json'
|
import '@ayo-run/mnswpr/mnswpr.css'
|
||||||
|
import * as pkg from '@ayo-run/mnswpr/package.json'
|
||||||
|
import { LoadingService } from '../utils/'
|
||||||
|
|
||||||
const version = import.meta.env.MODE === 'development'
|
const version = import.meta.env.MODE === 'development'
|
||||||
? 'dev'
|
? 'dev'
|
||||||
|
|
@ -9,4 +11,13 @@ const game = new mnswpr('app', version, {
|
||||||
levelChanged: () => console.log('[hook]: level reset'),
|
levelChanged: () => console.log('[hook]: level reset'),
|
||||||
gameDone: (game) => console.log('[hook]: game done', game)
|
gameDone: (game) => console.log('[hook]: game done', game)
|
||||||
})
|
})
|
||||||
game.initialize()
|
game.initialize()
|
||||||
|
|
||||||
|
const loadingService = new LoadingService()
|
||||||
|
const loadingWrapper = document.createElement('div')
|
||||||
|
loadingWrapper.id = 'loading-wrapper'
|
||||||
|
loadingService.addLoading(loadingWrapper)
|
||||||
|
|
||||||
|
const appElement = document.getElementById('app')
|
||||||
|
appElement.append(loadingWrapper)
|
||||||
|
|
||||||
|
|
|
||||||
11
app/package.json
Normal file
11
app/package.json
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"name": "app",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"description": "the mnswpr.com web app",
|
||||||
|
"private": true,
|
||||||
|
"main": "main.js",
|
||||||
|
"devDependencies": {
|
||||||
|
"@ayo-run/mnswpr": "workspace:*"
|
||||||
|
},
|
||||||
|
"author": "Ayo Ayco"
|
||||||
|
}
|
||||||
28
lib/package.json
Normal file
28
lib/package.json
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
{
|
||||||
|
"name": "@ayo-run/mnswpr",
|
||||||
|
"version": "0.4.26",
|
||||||
|
"description": "Classic Minesweeper browser game",
|
||||||
|
"author": "Ayo",
|
||||||
|
"type": "module",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/ayo-run/mnswpr"
|
||||||
|
},
|
||||||
|
"main": "mnswpr.js",
|
||||||
|
"exports": {
|
||||||
|
".": {
|
||||||
|
"default": "./dist/mnswpr.js"
|
||||||
|
},
|
||||||
|
"./dist/*": {
|
||||||
|
"default": "./dist/*"
|
||||||
|
},
|
||||||
|
"./*": {
|
||||||
|
"default": "./*"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"./*",
|
||||||
|
"./dist"
|
||||||
|
],
|
||||||
|
"license": "BSD-2-Clause"
|
||||||
|
}
|
||||||
25
package.json
25
package.json
|
|
@ -1,14 +1,14 @@
|
||||||
{
|
{
|
||||||
"name": "@ayo-run/mnswpr",
|
"name": "monorepo",
|
||||||
"version": "0.4.26",
|
"version": "0.0.1",
|
||||||
|
"private": true,
|
||||||
"description": "Classic Minesweeper browser game",
|
"description": "Classic Minesweeper browser game",
|
||||||
"author": "Ayo",
|
"author": "Ayo Ayco",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/ayo-run/mnswpr"
|
"url": "https://github.com/ayo-run/mnswpr"
|
||||||
},
|
},
|
||||||
"main": "dist/mnswpr.js",
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Warn: no test specified\"",
|
"test": "echo \"Warn: no test specified\"",
|
||||||
"dev": "vite app",
|
"dev": "vite app",
|
||||||
|
|
@ -23,20 +23,6 @@
|
||||||
"lint": "eslint .",
|
"lint": "eslint .",
|
||||||
"lint:fix": "eslint . --fix"
|
"lint:fix": "eslint . --fix"
|
||||||
},
|
},
|
||||||
"exports": {
|
|
||||||
".": {
|
|
||||||
"default": "./lib/dist/mnswpr.js"
|
|
||||||
},
|
|
||||||
"./*": {
|
|
||||||
"default":"./lib/dist/*"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"files": [
|
|
||||||
"lib/dist",
|
|
||||||
"README.md",
|
|
||||||
"LICENSE"
|
|
||||||
],
|
|
||||||
"license": "BSD-2-Clause",
|
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/css": "^1.1.0",
|
"@eslint/css": "^1.1.0",
|
||||||
"@eslint/js": "^10.0.1",
|
"@eslint/js": "^10.0.1",
|
||||||
|
|
@ -47,5 +33,6 @@
|
||||||
"husky": "^9.1.7",
|
"husky": "^9.1.7",
|
||||||
"simple-git": "^3.33.0",
|
"simple-git": "^3.33.0",
|
||||||
"vite": "^8.0.3"
|
"vite": "^8.0.3"
|
||||||
}
|
},
|
||||||
|
"packageManager": "pnpm@10.33.0+sha512.10568bb4a6afb58c9eb3630da90cc9516417abebd3fabbe6739f0ae795728da1491e9db5a544c76ad8eb7570f5c4bb3d6c637b2cb41bfdcdb47fa823c8649319"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,14 @@ importers:
|
||||||
specifier: ^8.0.3
|
specifier: ^8.0.3
|
||||||
version: 8.0.3(@emnapi/core@1.9.2)(@emnapi/runtime@1.9.2)(jiti@2.6.1)(yaml@2.8.3)
|
version: 8.0.3(@emnapi/core@1.9.2)(@emnapi/runtime@1.9.2)(jiti@2.6.1)(yaml@2.8.3)
|
||||||
|
|
||||||
|
app:
|
||||||
|
devDependencies:
|
||||||
|
'@ayo-run/mnswpr':
|
||||||
|
specifier: workspace:*
|
||||||
|
version: link:../lib
|
||||||
|
|
||||||
|
lib: {}
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
|
|
||||||
'@emnapi/core@1.9.2':
|
'@emnapi/core@1.9.2':
|
||||||
|
|
|
||||||
3
pnpm-workspace.yaml
Normal file
3
pnpm-workspace.yaml
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
packages:
|
||||||
|
- "lib"
|
||||||
|
- "app"
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
export * from './logger/logger.js'
|
export * from './logger/logger.js'
|
||||||
export * from './storage/storage.js'
|
export * from './storage/storage.js'
|
||||||
export * from './timer/timer.js'
|
export * from './timer/timer.js'
|
||||||
|
export * from './loading/loading.js'
|
||||||
|
|
||||||
|
|
|
||||||
55
utils/loading/loading.css
Normal file
55
utils/loading/loading.css
Normal file
|
|
@ -0,0 +1,55 @@
|
||||||
|
.lds-ellipsis {
|
||||||
|
display: inline-block;
|
||||||
|
position: relative;
|
||||||
|
width: 80px;
|
||||||
|
height: 80px;
|
||||||
|
}
|
||||||
|
.lds-ellipsis div {
|
||||||
|
position: absolute;
|
||||||
|
top: 33px;
|
||||||
|
width: 13px;
|
||||||
|
height: 13px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: #fff;
|
||||||
|
animation-timing-function: cubic-bezier(0, 1, 1, 0);
|
||||||
|
}
|
||||||
|
.lds-ellipsis div:nth-child(1) {
|
||||||
|
left: 8px;
|
||||||
|
animation: lds-ellipsis1 0.6s infinite;
|
||||||
|
}
|
||||||
|
.lds-ellipsis div:nth-child(2) {
|
||||||
|
left: 8px;
|
||||||
|
animation: lds-ellipsis2 0.6s infinite;
|
||||||
|
}
|
||||||
|
.lds-ellipsis div:nth-child(3) {
|
||||||
|
left: 32px;
|
||||||
|
animation: lds-ellipsis2 0.6s infinite;
|
||||||
|
}
|
||||||
|
.lds-ellipsis div:nth-child(4) {
|
||||||
|
left: 56px;
|
||||||
|
animation: lds-ellipsis3 0.6s infinite;
|
||||||
|
}
|
||||||
|
@keyframes lds-ellipsis1 {
|
||||||
|
0% {
|
||||||
|
transform: scale(0);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: scale(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@keyframes lds-ellipsis3 {
|
||||||
|
0% {
|
||||||
|
transform: scale(1);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: scale(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@keyframes lds-ellipsis2 {
|
||||||
|
0% {
|
||||||
|
transform: translate(0, 0);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: translate(24px, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
13
utils/loading/loading.js
Normal file
13
utils/loading/loading.js
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
/**
|
||||||
|
* import styles for vite bundling
|
||||||
|
*/
|
||||||
|
import './loading.css'
|
||||||
|
|
||||||
|
export class LoadingService {
|
||||||
|
addLoading(element) {
|
||||||
|
element.innerHTML = '<div class="lds-ellipsis"><div></div><div></div><div></div><div></div></div>'
|
||||||
|
}
|
||||||
|
removeLoading(element) {
|
||||||
|
element.innerHTML = ''
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue