你好谢谢小笼包再见
akirarika / milkio Goto Github PK
View Code? Open in Web Editor NEW🌟 A TypeScript Framework - Now, break the boundaries between Frontend and Backend
Home Page: https://milkio.fun
🌟 A TypeScript Framework - Now, break the boundaries between Frontend and Backend
Home Page: https://milkio.fun
你好谢谢小笼包再见
{
"executeId": "01HXVBMDHJ5AA1NWF17E8VC3MP",
"success": false,
"fail": {
"code": "TYPE_SAFE_ERROR",
"message": "xxx不能为空"
}
}
类似于这种吧。
执行co build
命令后,astro在generating static routes
时出现遇到了如下异常:
generating static routes
11:52:25 λ src/pages/index/bootstrap.ts
11:52:25 └─ /index/bootstrap11:52:25 [WARN] [router] No API Route handler exists for the method "GET" for the route "/index/bootstrap".
Found handlers: "bootstrap"
(+2ms)
(node:17588) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
E:\project\milk\milk-bv-player\node_modules\@arco-design\web-vue\es\menu\style\css.js:1
import "../../style/index.css";
^^^^^^
SyntaxError: Cannot use import statement outside a module
at wrapSafe (node:internal/modules/cjs/loader:1281:20)
at Module._compile (node:internal/modules/cjs/loader:1321:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
at Module.load (node:internal/modules/cjs/loader:1208:32)
at Module._load (node:internal/modules/cjs/loader:1024:12)
at cjsLoader (node:internal/modules/esm/translators:348:17)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:297:7)
at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
at async generatePage (file:///E:/project/milk/milk-bv-player/node_modules/astro/dist/core/build/generate.js:157:22)
Node.js v20.15.0
🍫 Script error exited with code 1.
package.json
和packages/client/package.json
均已设置"type": "module"
。
以下是完整的日志信息以及配置文件。
完整日志:
PS E:\project\milk\milk-bv-player> co build
😸 Command running on E:\project\milk\milk-bv-player
🍫 Run script $ErrorActionPreference = "Stop"; npm run build
> [email protected] build
> npm run milkio gen && astro build && electron-forge package
> [email protected] milkio
> bun run ./node_modules/milkio/c.ts gen
🥛 Milkio Generating..
[25.63ms] File Stage
----------------------------------------
Typia Generate Wizard
----------------------------------------
[2.33s] Typia Stage
[0.75ms] Significant Stage (LINE 1)
run-command.js 1.55 KB
info-f1f2a35b4d88a43f.js 31.86 KB
save-fe7f4e095aab7487.js 40.22 KB
opendf-802b412f56135aa9.js 31.38 KB
default-dd2a2a232e28c7eb.js 41.92 KB
rcmd-72578ad797510204.js 37.25 KB
get-f1521122e9d00722.js 30.67 KB
all-421684700bdde7e3.js 31.90 KB
clean-314f4e7d22419a3e.js 31.41 KB
download-5eaa9b039746f1cb.js 34.71 KB
poll-e4bb0bbdb0027a04.js 32.00 KB
info-96dce7d07ee1131b.js 32.07 KB
related-6ccc785ea9893ffe.js 31.88 KB
card-1a8f719b0f90aea6.js 32.88 KB
playurl-56cb4ecd0cadc1bb.js 34.00 KB
info-553f4b0ee4ec44e7.js 30.67 KB
generate-9b7ba3ebee63a6fd.js 30.75 KB
st-2de88372e433a205.js 44.75 KB
info-2e5cd32ee21e70e3.js 2.57 KB
save-f9d0adf2ac16f95b.js 3.02 KB
opendf-f2ca22a65ed27e44.js 2.06 KB
default-7466e8810d9b2b1d.js 34.66 KB
rcmd-047c20ff2854e37b.js 3.77 KB
clean-7bfb98adb2b55b0d.js 1.98 KB
get-4783e92a43952176.js 1.99 KB
all-9920ee7df5d550fd.js 2.48 KB
download-b434570ce7d727e3.js 2.99 KB
poll-188761801a54a2e2.js 2.20 KB
info-82b027b36319c9a2.js 2.60 KB
related-86164682f17c041e.js 2.59 KB
card-5866142d7f60b8bc.js 2.75 KB
generate-8aeaf057087d8eb6.js 2.03 KB
playurl-8d11fda8874348be.js 3.00 KB
info-923a3e2daf3142a6.js 2.25 KB
st-680fc061753ca5db.js 3.98 KB
api-test-9f95a37bdb8a1d4f.js 0.78 KB
run-command-e95cea5f83ecfc7b.js 38.03 KB
run-command-f8700df9fe857317.js 6.72 KB
run-command-a5d14cb2a90cf577.js 370.63 KB
run-command-e6ae64a16d895b8d.js 225.44 KB
run-command-b53d88efca140dbe.js 0.77 KB
run-command-ec99b1844d74ca48.js 8.66 KB
run-command-27f4e301f6059fb9.js 6.90 KB
run-command-8ad01a55e21e4c5c.js 4.98 KB
run-command-22b208be2cbf0977.js 141.87 KB
run-command-0bfaf97c071abb70.js 3.71 KB
run-command-23061eba5aa06d38.js 3.57 KB
[64ms] bundle 203 modules
[106.19ms] Significant Stage (LINE 2)
[9.03ms] Cookbook Stage
bun install v1.1.17 (bb66bba1)
Checked 8 installs across 9 packages (no changes) [8.00ms]
[2.82s] Client Stage
[0.71ms] Insignificant Stage (LINE 1)
run-command.js 1.55 KB
info-f1f2a35b4d88a43f.js 31.86 KB
save-fe7f4e095aab7487.js 40.22 KB
opendf-802b412f56135aa9.js 31.38 KB
default-dd2a2a232e28c7eb.js 41.92 KB
rcmd-72578ad797510204.js 37.25 KB
get-f1521122e9d00722.js 30.67 KB
all-421684700bdde7e3.js 31.90 KB
clean-314f4e7d22419a3e.js 31.41 KB
download-5eaa9b039746f1cb.js 34.71 KB
poll-e4bb0bbdb0027a04.js 32.00 KB
info-96dce7d07ee1131b.js 32.07 KB
related-6ccc785ea9893ffe.js 31.88 KB
card-1a8f719b0f90aea6.js 32.88 KB
playurl-56cb4ecd0cadc1bb.js 34.00 KB
info-553f4b0ee4ec44e7.js 30.67 KB
generate-9b7ba3ebee63a6fd.js 30.75 KB
st-2de88372e433a205.js 44.75 KB
info-2e5cd32ee21e70e3.js 2.57 KB
save-f9d0adf2ac16f95b.js 3.02 KB
opendf-f2ca22a65ed27e44.js 2.06 KB
default-7466e8810d9b2b1d.js 34.66 KB
rcmd-047c20ff2854e37b.js 3.77 KB
clean-7bfb98adb2b55b0d.js 1.98 KB
get-4783e92a43952176.js 1.99 KB
all-9920ee7df5d550fd.js 2.48 KB
download-b434570ce7d727e3.js 2.99 KB
poll-188761801a54a2e2.js 2.20 KB
info-82b027b36319c9a2.js 2.60 KB
related-86164682f17c041e.js 2.59 KB
card-5866142d7f60b8bc.js 2.75 KB
generate-8aeaf057087d8eb6.js 2.03 KB
playurl-8d11fda8874348be.js 3.00 KB
info-923a3e2daf3142a6.js 2.25 KB
st-680fc061753ca5db.js 3.98 KB
api-test-9f95a37bdb8a1d4f.js 0.78 KB
run-command-e95cea5f83ecfc7b.js 38.03 KB
run-command-f8700df9fe857317.js 6.72 KB
run-command-a5d14cb2a90cf577.js 370.63 KB
run-command-e6ae64a16d895b8d.js 225.44 KB
run-command-b53d88efca140dbe.js 0.77 KB
run-command-ec99b1844d74ca48.js 8.66 KB
run-command-27f4e301f6059fb9.js 6.90 KB
run-command-8ad01a55e21e4c5c.js 4.98 KB
run-command-22b208be2cbf0977.js 141.87 KB
run-command-0bfaf97c071abb70.js 3.71 KB
run-command-23061eba5aa06d38.js 3.57 KB
[59ms] bundle 203 modules
[90.12ms] Insignificant Stage (LINE 2)
✅ Milkio Generated!
11:52:20 [WARN] Unsupported file type E:\project\milk\milk-bv-player\src\pages\index\App.vue found. Prefix filename with an underscore (`_`) to ignore.
11:52:20 [types] Added src/env.d.ts type declarations.
11:52:20 [vite] Re-optimizing dependencies because vite config has changed
11:52:20 [build] output: "static"
11:52:20 [build] directory: E:\project\milk\milk-bv-player\dist-static\
11:52:20 [build] Collecting build info...
11:52:20 [build] ✓ Completed in 236ms.
11:52:20 [build] Building static entrypoints...
11:52:20 [types] Added src/env.d.ts type declarations.
11:52:21 [vite] ✓ built in 838ms
11:52:21 [build] ✓ Completed in 871ms.
building client (vite)
11:52:21 [types] Added src/env.d.ts type declarations.
11:52:24 [vite] ✓ 1252 modules transformed.
11:52:25 [vite] dist-static/_astro/index.DX5cz4Ys.css 14.59 kB │ gzip: 1.70 kB
11:52:25 [vite] dist-static/_astro/index.Dh0ak4E_.css 23.54 kB │ gzip: 2.46 kB
11:52:25 [vite] dist-static/_astro/index.Dze7GQZA.css 51.14 kB │ gzip: 8.30 kB
11:52:25 [vite] dist-static/_astro/Search.D9BiYHgt.css 72.71 kB │ gzip: 7.38 kB
11:52:25 [vite] dist-static/_astro/index.JBCEkeOk.css 405.62 kB │ gzip: 50.07 kB
11:52:25 [vite] dist-static/_astro/Favlist.SmwjQkh8.js 0.33 kB │ gzip: 0.30 kB │ map: 0.28 kB
11:52:25 [vite] dist-static/_astro/History.DGLkYU6c.js 0.33 kB │ gzip: 0.31 kB │ map: 0.28 kB
11:52:25 [vite] dist-static/_astro/client.CEDkKrb1.js 0.82 kB │ gzip: 0.54 kB │ map: 3.74 kB
11:52:25 [vite] dist-static/_astro/constant.BBYdlxuc.js 1.02 kB │ gzip: 0.58 kB │ map: 3.14 kB
11:52:25 [vite] dist-static/_astro/hoisted.DuIRD6Tn.js 1.25 kB │ gzip: 0.76 kB │ map: 2.09 kB
11:52:25 [vite] dist-static/_astro/index.BnknCh0V.js 1.49 kB │ gzip: 0.81 kB │ map: 6.04 kB
11:52:25 [vite] dist-static/_astro/index.BJrfKziR.js 5.23 kB │ gzip: 2.22 kB │ map: 20.15 kB
11:52:25 [vite] dist-static/_astro/number_util.Dhj2Z7CR.js 7.09 kB │ gzip: 2.78 kB │ map: 29.69 kB
11:52:25 [vite] dist-static/_astro/client.BSv1LQzQ.js 9.56 kB │ gzip: 3.69 kB │ map: 48.66 kB
11:52:25 [vite] dist-static/_astro/Index.CmhlcSmc.js 9.93 kB │ gzip: 3.37 kB │ map: 19.30 kB
11:52:25 [vite] dist-static/_astro/index.Bj4LYnkT.js 13.19 kB │ gzip: 5.75 kB │ map: 55.24 kB
11:52:25 [vite] dist-static/_astro/VideoView.Bx0xe-Hv.js 20.81 kB │ gzip: 5.88 kB │ map: 43.61 kB
11:52:25 [vite] dist-static/_astro/Setting.TL63jW6S.js 42.18 kB │ gzip: 15.92 kB │ map: 185.55 kB
11:52:25 [vite] dist-static/_astro/runtime-dom.esm-bundler.BxbuBwzQ.js 76.94 kB │ gzip: 30.53 kB │ map: 527.86 kB
11:52:25 [vite] dist-static/_astro/Search.B-9w3ELh.js 84.48 kB │ gzip: 25.82 kB │ map: 330.56 kB
11:52:25 [vite] dist-static/_astro/index.BPcKAtIK.js 503.47 kB │ gzip: 81.37 kB │ map: 1,909.03 kB
11:52:25 [WARN] [vite]
(!) Some chunks are larger than 500 kB after minification. Consider:
- Using dynamic import() to code-split the application
- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
11:52:25 [vite] ✓ built in 3.88s
generating static routes
11:52:25 λ src/pages/index/bootstrap.ts
11:52:25 └─ /index/bootstrap11:52:25 [WARN] [router] No API Route handler exists for the method "GET" for the route "/index/bootstrap".
Found handlers: "bootstrap"
(+2ms)
(node:17588) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
E:\project\milk\milk-bv-player\node_modules\@arco-design\web-vue\es\menu\style\css.js:1
import "../../style/index.css";
^^^^^^
SyntaxError: Cannot use import statement outside a module
at wrapSafe (node:internal/modules/cjs/loader:1281:20)
at Module._compile (node:internal/modules/cjs/loader:1321:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
at Module.load (node:internal/modules/cjs/loader:1208:32)
at Module._load (node:internal/modules/cjs/loader:1024:12)
at cjsLoader (node:internal/modules/esm/translators:348:17)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:297:7)
at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
at async generatePage (file:///E:/project/milk/milk-bv-player/node_modules/astro/dist/core/build/generate.js:157:22)
Node.js v20.15.0
🍫 Script error exited with code 1.
PS E:\project\milk\milk-bv-player>
配置文件package.json
:
{
"name": "milk-bv-player",
"productName": "milkio-project",
"version": "0.1.0",
"type": "module",
"description": "My Electron application description",
"main": "index.mjs",
"scripts": {
"dev": "npm run electron-forge start --inspect=8229",
"start": "npm run electron-forge start",
"build": "npm run milkio gen && astro build && electron-forge package",
"api-test": "node vite-node.mjs run-api-test.ts",
"command": "node vite-node.mjs run-command.ts",
"milkio": "bun run ./node_modules/milkio/c.ts",
"electron-forge": "electron-forge",
"astro": "astro"
},
"devDependencies": {
"@biomejs/biome": "1.8.0",
"@electron-forge/cli": "^7.4.0",
"@electron-forge/maker-deb": "^7.4.0",
"@electron-forge/maker-rpm": "^7.4.0",
"@electron-forge/maker-squirrel": "^7.4.0",
"@electron-forge/maker-zip": "^7.4.0",
"@electron-forge/plugin-auto-unpack-natives": "^7.4.0",
"@electron-forge/plugin-fuses": "^7.4.0",
"@electron/fuses": "^1.8.0",
"@types/node": "latest",
"electron": "30.0.9",
"typescript": "^5.5.0",
"unplugin-vue-components": "^0.27.2",
"vite-node": "^1.6.0",
"vite-plugin-pages": "^0.32.3"
},
"dependencies": {
"@arco-design/web-vue": "^2.55.3",
"@astrojs/vue": "^4.5.0",
"@hattip/adapter-node": "^0.0.45",
"@rollup/plugin-babel": "^6.0.4",
"@vitejs/plugin-vue": "^5.0.5",
"astro": "^4.9.3",
"client": "file:packages/client",
"detect-port": "^1.6.1",
"electron-squirrel-startup": "^1.0.1",
"element-plus": "^2.7.7",
"esm": "^3.2.25",
"md5": "^2.3.0",
"milkio": "^0.7.0-alpha.3",
"milkio-static-for-node": "0.0.3",
"milkio-template": "^0.0.2",
"qrcode": "^1.5.3",
"typia": "^6.0.3",
"unplugin-auto-import": "^0.17.6",
"vue": "^3.4.31",
"vue-router": "^4.4.0"
}
}
配置文件packages/client/package.json
:
{
"name": "milk-bv-player-client",
"version": "0.0.0",
"module": "index.ts",
"type": "module",
"devDependencies": {
"@types/bun": "latest"
},
"peerDependencies": {
"typescript": "^5.5.0"
},
"dependencies": {
"milkio-client": "^0.7.2"
}
}
已经全局安装了 ts-node 和 typescript 但是构建环境时依然提示TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for E:\project\milk\test\milkio-project\node_modules\milkio\c.ts
构建时的信息如下:
E:\project\milk\test>bun create milkio
√ 🥛 Hello! What language do you want to read? · 中文
√ 🥛 你更喜欢哪个运行时? · electron (beta)
√ 🥛 你的工程叫什么名字? · milkio-project
√ 🥛 你更喜欢哪个镜像源?(推荐**大陆用户使用非默认的镜像源哦) · https://mirrors.cloud.tencent.com/npm/
\ 🥛 Milkio Creating..
bun install v1.1.17 (bb66bba1)
[31.00ms] migrated lockfile from package-lock.json
+ @biomejs/[email protected]
+ @electron-forge/[email protected]
+ @electron-forge/[email protected]
+ @electron-forge/[email protected]
+ @electron-forge/[email protected]
+ @electron-forge/[email protected]
+ @electron-forge/[email protected]
+ @electron-forge/[email protected]
+ @electron/[email protected]
+ @types/[email protected]
+ [email protected]
+ [email protected]
+ [email protected]
+ @hattip/[email protected]
+ [email protected]
+ client@packages/client
+ [email protected]
+ [email protected]
+ [email protected] (v0.6.0 available)
+ [email protected]
+ [email protected]
+ [email protected]
+ [email protected]
917 packages installed [11.80s]
Blocked 1 postinstall. Run `bun pm untrusted` for details.
Removed: 2
bun add v1.1.17 (bb66bba1)
+ client@packages/client
installed [email protected] with binaries:
- milkio
installed [email protected]
5 packages installed [7.08s]
$ node node_modules/milkio/c.ts gen
node:internal/modules/esm/get_format:160
throw new ERR_UNKNOWN_FILE_EXTENSION(ext, filepath);
^
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for E:\project\milk\test\milkio-project\node_modules\milkio\c.ts
at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:160:9)
at defaultGetFormat (node:internal/modules/esm/get_format:203:36)
at defaultLoad (node:internal/modules/esm/load:143:22)
at async ModuleLoader.load (node:internal/modules/esm/loader:396:7)
at async ModuleLoader.moduleProvider (node:internal/modules/esm/loader:278:45)
at async link (node:internal/modules/esm/module_job:78:21) {
code: 'ERR_UNKNOWN_FILE_EXTENSION'
}
Node.js v20.15.0
error: script "milkio" exited with code 1
node:internal/errors:984
const err = new Error(message);
^
Error: Command failed: bun run milkio gen
at genericNodeError (node:internal/errors:984:15)
at wrappedFn (node:internal/errors:538:14)
at checkExecSyncError (node:child_process:890:11)
at execFileSync (node:child_process:926:15)
at createMilkio (file:///C:/Users/34886/AppData/Local/Temp/bunx-771214610-create-milkio@latest/node_modules/create-milkio/index.mjs:186:2)
at async file:///C:/Users/34886/AppData/Local/Temp/bunx-771214610-create-milkio@latest/node_modules/create-milkio/index.mjs:249:1 {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 8272,
stdout: null,
stderr: null
}
Node.js v20.15.0
E:\project\milk\test>
genearted/
folder generated by vscode, i think we should move generate logic to prepare/dev/build, like nuxt.generated
is a common name, we should move this folder to a hidden name, for example .milkio
/.milkio/generated
milkio
I found packages/client/project
is also ignored.
Thank you all for your love for milkio!
Milkio is about to undertake the development of version 1.0, which will introduce many significant changes. Therefore, I would like to understand your thoughts.
In the past, in order to be cross-platform as much as possible, milkio placed too many functions inside the VS Code extension. This led to a strong binding with VS Code, making it difficult for developers who use other editors to use milkio.
At the same time, this also resulted in the loss of many runtime-specific capabilities. For example, Bun's hot update feature is great; without restarting the development server, new code changes will take effect. Milkio used its own automatic server restart feature, preventing such runtime-specific capabilities from being fully utilized.
Also, the Cookbook's functionality is quite basic. I want to rebuild the Cookbook to be as user-friendly as Laravel Telescope.
The specific changes planned are as follows:
The existing milkio package will be renamed to the milkio-core
package and will remove the code related to building.
A new package will be developed, named milkio
, responsible for managing the entire workflow from development start to compilation and release. It does not need to be installed in the production environment, or rather, it only needs bun install --save-dev milkio
.
The Cookbook will be refactored and built into this new package. When we develop, the Cookbook will start up automatically. You can access the Cookbook through the browser.
Through the Cookbook, you will be able to live view the following in your remote or local milkio project:
If you want the Cookbook to run normally in a remote environment, you need to ensure that Milkio's caching feature has been correctly configured (it uses Redis or another compatible caching application).
Milkio will support generating a documentation webpage containing only the information of APIs marked as 'public' in the normal Cookbook, including their input and output parameters. You can share this document with others who need access to your API without worrying about it being unsafe (e.g., seeing your logs or running your tests).
This documentation webpage will be pure static HTML, meaning that search engines can properly index it (if you wish).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.