Skip to content

Commit 8aacbeb

Browse files
committed
feat: replace module on the go
1 parent ed70e77 commit 8aacbeb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2574
-869
lines changed

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,25 @@
88
"@commitlint/cli": "17.4.4",
99
"@commitlint/config-conventional": "17.4.4",
1010
"@ls-lint/ls-lint": "1.11.2",
11-
"@types/node": "18.14.6",
12-
"@typescript-eslint/eslint-plugin": "5.54.1",
13-
"@typescript-eslint/parser": "5.54.1",
11+
"@types/node": "18.15.3",
12+
"@typescript-eslint/eslint-plugin": "5.55.0",
13+
"@typescript-eslint/parser": "5.55.0",
1414
"arg": "5.0.2",
1515
"c8": "7.13.0",
1616
"chai": "4.3.7",
1717
"changelogithub": "0.12.7",
18-
"esbuild": "0.17.10",
19-
"eslint": "8.35.0",
20-
"eslint-config-escapace": "3.16.1",
18+
"esbuild": "0.17.11",
19+
"eslint": "8.36.0",
20+
"eslint-config-escapace": "3.16.2",
2121
"eslint-config-prettier": "8.7.0",
2222
"eslint-plugin-editorconfig": "4.0.2",
2323
"eslint-plugin-no-null": "1.0.2",
24-
"execa": "7.0.0",
24+
"execa": "7.1.1",
2525
"fast-glob": "3.2.12",
2626
"fs-extra": "11.1.0",
2727
"husky": "8.0.3",
2828
"is-ci": "3.0.1",
29-
"lint-staged": "13.1.2",
29+
"lint-staged": "13.2.0",
3030
"lodash-es": "4.17.21",
3131
"prettier": "2.8.4",
3232
"prettier-config-escapace": "1.0.5",

packages/app/index.html

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
<!DOCTYPE html>
2-
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8" />
5-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6-
<meta
7-
name="viewport"
8-
content="width=device-width, initial-scale=1.0, user-scalable=no"
9-
/>
10-
<title>Vite + Vue + TS</title>
11-
</head>
12-
<body>
13-
<div id="app"></div>
14-
<script type="module" src="/src/main.ts"></script>
15-
</body>
2+
<html>
3+
4+
<head>
5+
<meta charset="utf-8" />
6+
<meta name="referrer" content="no-referrer-when-downgrade" />
7+
<link crossorigin="" rel="preconnect" href="/" />
8+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
9+
<meta name="robots" content="max-snippet:-1, max-image-preview: large, max-video-preview: -1" />
10+
<!--app-styles-->
11+
<!--app-state-->
12+
</head>
13+
14+
<body>
15+
<div id="app"><!--app-html--></div>
16+
<script type="module" src="/src/entry-browser.ts"></script>
17+
</body>
18+
1619
</html>

packages/app/package.json

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,53 +5,63 @@
55
"author": "escapace <opensource@escapace.com>",
66
"bugs": "https://github.com/escapace/cepheus/issues",
77
"dependencies": {
8-
"@cassiopeia/vite": "5.0.0",
9-
"@cassiopeia/vue": "5.0.0",
8+
"@cassiopeia/vite": "5.1.0",
9+
"@cassiopeia/vue": "5.1.0",
1010
"@cepheus/color": "workspace:*",
1111
"@cepheus/plugin": "workspace:*",
1212
"@cepheus/utilities": "workspace:*",
1313
"@cepheus/vue": "workspace:*",
1414
"@escapace/minimum-perimeter-triangle": "0.1.0",
1515
"@headlessui/vue": "1.7.12",
16+
"@hono/node-server": "0.3.0",
1617
"@js-temporal/polyfill": "0.4.3",
17-
"cassiopeia": "5.0.0",
18+
"@nuxt/devalue": "2.0.0",
19+
"@thi.ng/random": "3.3.27",
20+
"@tweakpane/core": "1.1.5",
21+
"@vueuse/core": "9.13.0",
22+
"cassiopeia": "5.1.0",
1823
"cepheus": "workspace:*",
24+
"esbuild": "0.17.11",
25+
"hono": "3.0.5",
1926
"lodash-es": "4.17.21",
20-
"tweakpane": "3.1.6"
27+
"pinia": "2.0.33",
28+
"tweakpane": "3.1.6",
29+
"vue-router": "4"
2130
},
2231
"devDependencies": {
2332
"@escapace/unocss-preset-escapace": "0.1.1",
24-
"@tweakpane/core": "1.1.5",
25-
"@types/lodash-es": "4.17.6",
26-
"@typescript-eslint/eslint-plugin": "5.54.1",
27-
"@typescript-eslint/parser": "5.54.1",
33+
"@types/lodash-es": "4.17.7",
34+
"@typescript-eslint/eslint-plugin": "5.55.0",
35+
"@typescript-eslint/parser": "5.55.0",
2836
"@unocss/reset": "0.50.4",
2937
"@vitejs/plugin-vue": "4.0.0",
30-
"@vueuse/core": "9.13.0",
31-
"eslint": "8.35.0",
32-
"eslint-config-escapace": "3.16.1",
38+
"@yeuxjs/types": "5.0.0",
39+
"eslint": "8.36.0",
40+
"eslint-config-escapace": "3.16.2",
3341
"eslint-config-prettier": "8.7.0",
3442
"eslint-plugin-editorconfig": "4.0.2",
3543
"eslint-plugin-no-null": "1.0.2",
3644
"eslint-plugin-vue": "9.9.0",
37-
"pinia": "2.0.33",
3845
"prettier": "2.8.4",
3946
"prettier-config-escapace": "1.0.5",
40-
"sass": "1.58.3",
47+
"sass": "1.59.2",
4148
"typescript": "4.9.5",
4249
"unocss": "0.50.4",
4350
"vite": "4.1.4",
4451
"vue": "3.2.47",
45-
"vue-router": "4",
46-
"vue-tsc": "1.2.0"
52+
"vue-tsc": "1.2.0",
53+
"wrangler": "2.12.3",
54+
"yeux": "5.0.0"
4755
},
4856
"homepage": "https://github.com/escapace/cepheus",
4957
"license": "MPL-2.0",
5058
"private": true,
5159
"repository": "https://github.com/escapace/cepheus.git",
5260
"scripts": {
53-
"build": "vite build",
61+
"build": "wrangler build",
62+
"dev": "yeux dev",
5463
"lint": "eslint --fix 'src/**/*.{ts,js,vue}'",
64+
"preview": "wrangler dev",
5565
"typecheck": "vue-tsc --noEmit"
5666
},
5767
"type": "module"

packages/app/scripts/build.mjs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { yeux } from 'yeux'
2+
import { build } from 'esbuild'
3+
import path from 'path'
4+
import { fileURLToPath } from 'url'
5+
6+
const cwd = path.dirname(path.dirname(fileURLToPath(import.meta.url)))
7+
process.chdir(cwd)
8+
9+
console.log(cwd)
10+
11+
await yeux({ command: 'build', directory: cwd })
12+
13+
await build({
14+
entryPoints: ['./dist/server/entry-server.mjs'],
15+
outfile: './dist/worker/index.mjs',
16+
bundle: true,
17+
treeShaking: true,
18+
platform: 'neutral',
19+
format: 'esm',
20+
external: ['__STATIC_CONTENT_MANIFEST'],
21+
allowOverwrite: true,
22+
mainFields: ['module', 'main'],
23+
target: 'es2022',
24+
logOverride: {
25+
'ignored-bare-import': 'silent'
26+
},
27+
define: {
28+
__VUE_OPTIONS_API__: 'true',
29+
__VUE_PROD_DEVTOOLS__: 'false'
30+
}
31+
})

packages/app/src/components/app.vue

Lines changed: 77 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -3,76 +3,83 @@ import { Menu, MenuButton, MenuItems, MenuItem } from '@headlessui/vue'
33
</script>
44

55
<template>
6-
<div id="app">
7-
<div class="top-8 w-10 text-right ml1 mb5">
8-
<Menu as="div" class="relative inline-block text-left">
9-
<MenuButton
10-
as="div"
11-
class="w-12 menu-button inline-flex justify-center rounded-md px-4 py-2 text-sm focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75"
12-
>
13-
More</MenuButton
14-
>
15-
<MenuItems
16-
class="menu-items absolute left-0 mt-2 w-56 origin-top-right divide-y rounded-md shadow-lg focus:outline-none"
17-
>
18-
<div class="menu-wrapper px-1 py-1 relative">
19-
<MenuItem v-slot="{ active }">
20-
<router-link
21-
to="/"
22-
:class="[
23-
active ? 'menu-link menu-link-active' : 'menu-link',
24-
'group flex w-full items-center rounded-md px-2 py-2 text-sm'
25-
]"
26-
>Calendar</router-link
27-
>
28-
</MenuItem>
29-
<MenuItem v-slot="{ active }">
30-
<router-link
31-
:class="[
32-
active ? 'menu-link menu-link-active' : 'menu-link',
33-
'group flex w-full items-center rounded-md px-2 py-2 text-sm'
34-
]"
35-
to="/swatches"
36-
>Swatches</router-link
37-
>
38-
</MenuItem>
39-
<MenuItem v-slot="{ active }">
40-
<router-link
41-
:class="[
42-
active ? 'menu-link menu-link-active' : 'menu-link',
43-
'group flex w-full items-center rounded-md px-2 py-2 text-sm'
44-
]"
45-
to="/triangle"
46-
>Triangle</router-link
47-
>
48-
</MenuItem>
49-
<MenuItem v-slot="{ active }">
50-
<router-link
51-
:class="[
52-
active ? 'menu-link menu-link-active' : 'menu-link',
53-
'group flex w-full items-center rounded-md px-2 py-2 text-sm'
54-
]"
55-
to="/fitting"
56-
>Fitting</router-link
57-
>
58-
</MenuItem>
59-
<MenuItem v-slot="{ active }">
60-
<router-link
61-
:class="[
62-
active ? 'menu-link menu-link-active' : 'menu-link',
63-
'group flex w-full items-center rounded-md px-2 py-2 text-sm'
64-
]"
65-
to="/constraint"
66-
>Constraint</router-link
67-
>
68-
</MenuItem>
69-
</div>
70-
</MenuItems>
71-
</Menu>
72-
</div>
73-
<!-- route outlet -->
74-
<!-- component matched by the route will render here -->
75-
<router-view></router-view>
6+
<div>
7+
<Suspense>
8+
<div>
9+
<div class="top-8 w-10 text-right ml1 mb5">
10+
<Menu as="div" class="relative inline-block text-left">
11+
<MenuButton
12+
as="div"
13+
class="w-12 menu-button inline-flex justify-center rounded-md px-4 py-2 text-sm focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75"
14+
>
15+
More</MenuButton
16+
>
17+
<MenuItems
18+
class="menu-items absolute left-0 mt-2 w-56 origin-top-right divide-y rounded-md shadow-lg focus:outline-none"
19+
>
20+
<div class="menu-wrapper px-1 py-1 relative">
21+
<MenuItem v-slot="{ active }">
22+
<router-link
23+
to="/"
24+
:class="[
25+
active ? 'menu-link menu-link-active' : 'menu-link',
26+
'group flex w-full items-center rounded-md px-2 py-2 text-sm'
27+
]"
28+
>Calendar</router-link
29+
>
30+
</MenuItem>
31+
<MenuItem v-slot="{ active }">
32+
<router-link
33+
:class="[
34+
active ? 'menu-link menu-link-active' : 'menu-link',
35+
'group flex w-full items-center rounded-md px-2 py-2 text-sm'
36+
]"
37+
to="/swatches"
38+
>Swatches</router-link
39+
>
40+
</MenuItem>
41+
<MenuItem v-slot="{ active }">
42+
<router-link
43+
:class="[
44+
active ? 'menu-link menu-link-active' : 'menu-link',
45+
'group flex w-full items-center rounded-md px-2 py-2 text-sm'
46+
]"
47+
to="/triangle"
48+
>Triangle</router-link
49+
>
50+
</MenuItem>
51+
<MenuItem v-slot="{ active }">
52+
<router-link
53+
:class="[
54+
active ? 'menu-link menu-link-active' : 'menu-link',
55+
'group flex w-full items-center rounded-md px-2 py-2 text-sm'
56+
]"
57+
to="/fitting"
58+
>Fitting</router-link
59+
>
60+
</MenuItem>
61+
<MenuItem v-slot="{ active }">
62+
<router-link
63+
:class="[
64+
active ? 'menu-link menu-link-active' : 'menu-link',
65+
'group flex w-full items-center rounded-md px-2 py-2 text-sm'
66+
]"
67+
to="/constraint"
68+
>Constraint</router-link
69+
>
70+
</MenuItem>
71+
</div>
72+
</MenuItems>
73+
</Menu>
74+
</div>
75+
<!-- route outlet -->
76+
<!-- component matched by the route will render here -->
77+
<router-view></router-view>
78+
</div>
79+
80+
<!-- loading state via #fallback slot -->
81+
<template #fallback> Loading... </template>
82+
</Suspense>
7683
</div>
7784
</template>
7885

0 commit comments

Comments
 (0)