prime-dev-cli 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.mjs +1 -0
- package/config/projects.json +84 -5
- package/dist/server/.next/BUILD_ID +1 -1
- package/dist/server/.next/app-build-manifest.json +60 -53
- package/dist/server/.next/app-path-routes-manifest.json +8 -7
- package/dist/server/.next/build-manifest.json +3 -3
- package/dist/server/.next/cache/.rscinfo +1 -1
- package/dist/server/.next/cache/.tsbuildinfo +1 -1
- package/dist/server/.next/cache/eslint/.cache_13k185s +1 -0
- package/dist/server/.next/cache/eslint/.cache_1qa5vxt +1 -1
- package/dist/server/.next/cache/webpack/client-production/0.pack +0 -0
- package/dist/server/.next/cache/webpack/client-production/1.pack +0 -0
- package/dist/server/.next/cache/webpack/client-production/10.pack +0 -0
- package/dist/server/.next/cache/webpack/client-production/11.pack +0 -0
- package/dist/server/.next/cache/webpack/client-production/12.pack +0 -0
- package/dist/server/.next/cache/webpack/client-production/5.pack +0 -0
- package/dist/server/.next/cache/webpack/client-production/8.pack +0 -0
- package/dist/server/.next/cache/webpack/client-production/9.pack +0 -0
- package/dist/server/.next/cache/webpack/client-production/index.pack +0 -0
- package/dist/server/.next/cache/webpack/client-production/index.pack.old +0 -0
- package/dist/server/.next/cache/webpack/edge-server-production/index.pack +0 -0
- package/dist/server/.next/cache/webpack/server-production/0.pack +0 -0
- package/dist/server/.next/cache/webpack/server-production/1.pack +0 -0
- package/dist/server/.next/cache/webpack/server-production/2.pack +0 -0
- package/dist/server/.next/cache/webpack/server-production/3.pack +0 -0
- package/dist/server/.next/cache/webpack/server-production/4.pack +0 -0
- package/dist/server/.next/cache/webpack/server-production/5.pack +0 -0
- package/dist/server/.next/cache/webpack/server-production/index.pack +0 -0
- package/dist/server/.next/cache/webpack/server-production/index.pack.old +0 -0
- package/dist/server/.next/next-minimal-server.js.nft.json +1 -1
- package/dist/server/.next/next-server.js.nft.json +1 -1
- package/dist/server/.next/prerender-manifest.json +20 -20
- package/dist/server/.next/required-server-files.json +3 -3
- package/dist/server/.next/server/app/_not-found/page.js +1 -1
- package/dist/server/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/server/.next/server/app/_not-found.html +1 -1
- package/dist/server/.next/server/app/_not-found.rsc +2 -2
- package/dist/server/.next/server/app/api/all-projects-envs/route.js +1 -1
- package/dist/server/.next/server/app/api/all-projects-envs/route_client-reference-manifest.js +1 -1
- package/dist/server/.next/server/app/api/check-mock-intercept/route.js +1 -1
- package/dist/server/.next/server/app/api/check-mock-intercept/route_client-reference-manifest.js +1 -1
- package/dist/server/.next/server/app/api/check-workspace/route.js +14 -1
- package/dist/server/.next/server/app/api/check-workspace/route_client-reference-manifest.js +1 -1
- package/dist/server/.next/server/app/api/cleanup-project/route.js +1 -0
- package/dist/server/.next/server/app/api/cleanup-project/route.js.nft.json +1 -0
- package/dist/server/.next/server/app/api/cleanup-project/route_client-reference-manifest.js +1 -0
- package/dist/server/.next/server/app/api/get-mock-data/route.js +1 -1
- package/dist/server/.next/server/app/api/get-mock-data/route_client-reference-manifest.js +1 -1
- package/dist/server/.next/server/app/api/initialize-workspace/route.js +16 -3
- package/dist/server/.next/server/app/api/initialize-workspace/route_client-reference-manifest.js +1 -1
- package/dist/server/.next/server/app/api/microapp-proxy-change-stream/route.js +3 -3
- package/dist/server/.next/server/app/api/microapp-proxy-change-stream/route_client-reference-manifest.js +1 -1
- package/dist/server/.next/server/app/api/microapp-proxy-config/route.js +2 -2
- package/dist/server/.next/server/app/api/microapp-proxy-config/route_client-reference-manifest.js +1 -1
- package/dist/server/.next/server/app/api/mock-file/route.js +2 -2
- package/dist/server/.next/server/app/api/mock-file/route_client-reference-manifest.js +1 -1
- package/dist/server/.next/server/app/api/mock-file-content/route.js +1 -1
- package/dist/server/.next/server/app/api/mock-file-content/route_client-reference-manifest.js +1 -1
- package/dist/server/.next/server/app/api/mock-open-status/route.js +3 -3
- package/dist/server/.next/server/app/api/mock-open-status/route_client-reference-manifest.js +1 -1
- package/dist/server/.next/server/app/api/mock-setting/route.js +1 -1
- package/dist/server/.next/server/app/api/mock-setting/route_client-reference-manifest.js +1 -1
- package/dist/server/.next/server/app/api/open-project/route.js +14 -1
- package/dist/server/.next/server/app/api/open-project/route_client-reference-manifest.js +1 -1
- package/dist/server/.next/server/app/api/project-config/route.js +1 -1
- package/dist/server/.next/server/app/api/project-config/route_client-reference-manifest.js +1 -1
- package/dist/server/.next/server/app/api/retry-project/route.js +14 -1
- package/dist/server/.next/server/app/api/retry-project/route_client-reference-manifest.js +1 -1
- package/dist/server/.next/server/app/configuration/page.js +3 -3
- package/dist/server/.next/server/app/configuration/page_client-reference-manifest.js +1 -1
- package/dist/server/.next/server/app/configuration.html +1 -1
- package/dist/server/.next/server/app/configuration.rsc +3 -3
- package/dist/server/.next/server/app/favicon.ico/route.js +1 -1
- package/dist/server/.next/server/app/index.html +1 -1
- package/dist/server/.next/server/app/index.rsc +2 -2
- package/dist/server/.next/server/app/initialization/page.js +1 -1
- package/dist/server/.next/server/app/initialization/page_client-reference-manifest.js +1 -1
- package/dist/server/.next/server/app/initialization.html +1 -1
- package/dist/server/.next/server/app/initialization.rsc +3 -3
- package/dist/server/.next/server/app/page.js +1 -1
- package/dist/server/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/server/.next/server/app-paths-manifest.json +8 -7
- package/dist/server/.next/server/chunks/131.js +4 -4
- package/dist/server/.next/server/chunks/967.js +3 -3
- package/dist/server/.next/server/middleware-build-manifest.js +1 -1
- package/dist/server/.next/server/next-font-manifest.js +1 -1
- package/dist/server/.next/server/next-font-manifest.json +1 -1
- package/dist/server/.next/server/pages/404.html +1 -1
- package/dist/server/.next/server/pages/500.html +1 -1
- package/dist/server/.next/server/pages-manifest.json +1 -1
- package/dist/server/.next/server/server-reference-manifest.json +1 -1
- package/dist/server/.next/static/W9gpINx4oQDxDFLMkCJQL/_buildManifest.js +1 -0
- package/dist/server/.next/static/W9gpINx4oQDxDFLMkCJQL/_ssgManifest.js +1 -0
- package/dist/server/.next/static/chunks/770-17268e5a9d004dae.js +1 -0
- package/dist/server/.next/static/chunks/app/api/all-projects-envs/route-70d14c8af28994db.js +1 -0
- package/dist/server/.next/static/chunks/app/api/check-mock-intercept/route-207d5b6627adc282.js +1 -0
- package/dist/server/.next/static/chunks/app/api/check-workspace/route-29f5d718929ea780.js +1 -0
- package/dist/server/.next/static/chunks/app/api/cleanup-project/route-3bf856128b701bac.js +1 -0
- package/dist/server/.next/static/chunks/app/api/get-mock-data/route-dc1cc7e42c23cc90.js +1 -0
- package/dist/server/.next/static/chunks/app/api/initialize-workspace/route-736e54e6ee59e3ce.js +1 -0
- package/dist/server/.next/static/chunks/app/api/microapp-proxy-change-stream/route-219fff48736f39a4.js +1 -0
- package/dist/server/.next/static/chunks/app/api/microapp-proxy-config/route-e535c24ff110bccf.js +1 -0
- package/dist/server/.next/static/chunks/app/api/mock-file/route-457801bb0f6a76f5.js +1 -0
- package/dist/server/.next/static/chunks/app/api/mock-file-content/route-4abdd46a628dfa45.js +1 -0
- package/dist/server/.next/static/chunks/app/api/mock-open-status/route-7e4d9c8f09b286c3.js +1 -0
- package/dist/server/.next/static/chunks/app/api/mock-setting/route-2f57558f61602b8d.js +1 -0
- package/dist/server/.next/static/chunks/app/api/open-project/route-dbd2412a4a395d57.js +1 -0
- package/dist/server/.next/static/chunks/app/api/project-config/route-52a76cdb81639dcd.js +1 -0
- package/dist/server/.next/static/chunks/app/api/retry-project/route-1672c3841762e7a2.js +1 -0
- package/dist/server/.next/static/chunks/app/configuration/page-68644ad1d0dbda4f.js +1 -0
- package/dist/server/.next/static/chunks/app/initialization/page-9c8eb31c4b362777.js +1 -0
- package/dist/server/.next/static/chunks/app/initialization/page-d107335a70a6aa9a.js +1 -0
- package/dist/server/.next/static/chunks/app/layout-2c381be4c1bb73ed.js +1 -0
- package/dist/server/.next/static/chunks/app/page-9ce2b4651df441b0.js +1 -0
- package/dist/server/.next/static/chunks/main-app-0672b5550b5e5a29.js +1 -0
- package/dist/server/.next/static/css/b10a602544a179de.css +3 -0
- package/dist/server/.next/static/ctEn8UHYZESgGhsRFLpGu/_buildManifest.js +1 -0
- package/dist/server/.next/static/ctEn8UHYZESgGhsRFLpGu/_ssgManifest.js +1 -0
- package/dist/server/.next/trace +12 -3
- package/dist/server/.next/types/app/api/all-projects-envs/route.ts +1 -1
- package/dist/server/.next/types/app/api/check-mock-intercept/route.ts +1 -1
- package/dist/server/.next/types/app/api/check-workspace/route.ts +1 -1
- package/dist/server/.next/types/app/api/cleanup-project/route.ts +347 -0
- package/dist/server/.next/types/app/api/get-mock-data/route.ts +1 -1
- package/dist/server/.next/types/app/api/initialize-workspace/route.ts +1 -1
- package/dist/server/.next/types/app/api/microapp-proxy-change-stream/route.ts +1 -1
- package/dist/server/.next/types/app/api/microapp-proxy-config/route.ts +1 -1
- package/dist/server/.next/types/app/api/mock-file/route.ts +1 -1
- package/dist/server/.next/types/app/api/mock-file-content/route.ts +1 -1
- package/dist/server/.next/types/app/api/mock-open-status/route.ts +1 -1
- package/dist/server/.next/types/app/api/mock-setting/route.ts +1 -1
- package/dist/server/.next/types/app/api/open-project/route.ts +1 -1
- package/dist/server/.next/types/app/api/project-config/route.ts +1 -1
- package/dist/server/.next/types/app/api/retry-project/route.ts +1 -1
- package/dist/server/.next/types/app/configuration/page.ts +1 -1
- package/dist/server/.next/types/app/initialization/page.ts +1 -1
- package/dist/server/.next/types/app/layout.ts +1 -1
- package/dist/server/.next/types/app/page.ts +1 -1
- package/package.json +3 -2
package/dist/server/.next/server/app/api/microapp-proxy-config/route_client-reference-manifest.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/microapp-proxy-config/route"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{"317":{"*":{"id":"5207","name":"*","chunks":[],"async":false}},"1020":{"*":{"id":"9136","name":"*","chunks":[],"async":false}},"3053":{"*":{"id":"767","name":"*","chunks":[],"async":false}},"3561":{"*":{"id":"9855","name":"*","chunks":[],"async":false}},"3604":{"*":{"id":"6996","name":"*","chunks":[],"async":false}},"3636":{"*":{"id":"7774","name":"*","chunks":[],"async":false}},"6665":{"*":{"id":"1681","name":"*","chunks":[],"async":false}},"7472":{"*":{"id":"1249","name":"*","chunks":[],"async":false}},"9203":{"*":{"id":"8751","name":"*","chunks":[],"async":false}},"9510":{"*":{"id":"
|
|
1
|
+
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/microapp-proxy-config/route"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{"317":{"*":{"id":"5207","name":"*","chunks":[],"async":false}},"1020":{"*":{"id":"9136","name":"*","chunks":[],"async":false}},"3053":{"*":{"id":"767","name":"*","chunks":[],"async":false}},"3561":{"*":{"id":"9855","name":"*","chunks":[],"async":false}},"3604":{"*":{"id":"6996","name":"*","chunks":[],"async":false}},"3636":{"*":{"id":"7774","name":"*","chunks":[],"async":false}},"6665":{"*":{"id":"1681","name":"*","chunks":[],"async":false}},"7472":{"*":{"id":"1249","name":"*","chunks":[],"async":false}},"9203":{"*":{"id":"8751","name":"*","chunks":[],"async":false}},"9510":{"*":{"id":"8843","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/client-page.js":{"id":3636,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/client-page.js":{"id":3636,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/client-segment.js":{"id":1020,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/client-segment.js":{"id":1020,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/error-boundary.js":{"id":3604,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":3604,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":3053,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":3053,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/layout-router.js":{"id":317,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/layout-router.js":{"id":317,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/metadata/async-metadata.js":{"id":3561,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/metadata/async-metadata.js":{"id":3561,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/metadata/metadata-boundary.js":{"id":9203,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/metadata/metadata-boundary.js":{"id":9203,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/render-from-template-context.js":{"id":6665,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":6665,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.tsx\",\"import\":\"Geist\",\"arguments\":[{\"variable\":\"--font-geist-sans\",\"subsets\":[\"latin\"]}],\"variableName\":\"geistSans\"}":{"id":6521,"name":"*","chunks":["177","static/chunks/app/layout-2c381be4c1bb73ed.js"],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.tsx\",\"import\":\"Geist_Mono\",\"arguments\":[{\"variable\":\"--font-geist-mono\",\"subsets\":[\"latin\"]}],\"variableName\":\"geistMono\"}":{"id":8947,"name":"*","chunks":["177","static/chunks/app/layout-2c381be4c1bb73ed.js"],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/app/globals.css":{"id":141,"name":"*","chunks":["177","static/chunks/app/layout-2c381be4c1bb73ed.js"],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/app/configuration/page.tsx":{"id":9510,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/components/project-initializer.tsx":{"id":7472,"name":"*","chunks":[],"async":false}},"entryCSSFiles":{"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/":[],"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/app/layout":[{"inlined":false,"path":"static/css/b10a602544a179de.css"}],"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/app/page":[],"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/app/api/microapp-proxy-config/route":[]},"rscModuleMapping":{"141":{"*":{"id":"3019","name":"*","chunks":[],"async":false}},"317":{"*":{"id":"7429","name":"*","chunks":[],"async":false}},"1020":{"*":{"id":"9670","name":"*","chunks":[],"async":false}},"3053":{"*":{"id":"5473","name":"*","chunks":[],"async":false}},"3561":{"*":{"id":"8653","name":"*","chunks":[],"async":false}},"3604":{"*":{"id":"1382","name":"*","chunks":[],"async":false}},"3636":{"*":{"id":"4928","name":"*","chunks":[],"async":false}},"6665":{"*":{"id":"9687","name":"*","chunks":[],"async":false}},"7472":{"*":{"id":"9624","name":"*","chunks":[],"async":false}},"9203":{"*":{"id":"8757","name":"*","chunks":[],"async":false}},"9510":{"*":{"id":"4761","name":"*","chunks":[],"async":false}}},"edgeRscModuleMapping":{"317":{"*":{"id":"5207","name":"*","chunks":[],"async":false}},"1020":{"*":{"id":"9136","name":"*","chunks":[],"async":false}},"3053":{"*":{"id":"767","name":"*","chunks":[],"async":false}},"3561":{"*":{"id":"9855","name":"*","chunks":[],"async":false}},"3604":{"*":{"id":"6996","name":"*","chunks":[],"async":false}},"3636":{"*":{"id":"7774","name":"*","chunks":[],"async":false}},"6665":{"*":{"id":"1681","name":"*","chunks":[],"async":false}},"9203":{"*":{"id":"8751","name":"*","chunks":[],"async":false}}}}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(()=>{var e={};e.id=979,e.ids=[979],e.modules={
|
|
1
|
+
(()=>{var e={};e.id=979,e.ids=[979],e.modules={483:()=>{},846:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},1820:e=>{"use strict";e.exports=require("os")},2601:(e,s,t)=>{"use strict";t.d(s,{ZR:()=>a,sF:()=>i});var r=t(9748),o=t(4946);async function a(){try{await (0,r.access)(o.lq,r.constants.F_OK)}catch{return await i({}),{}}try{let e=await (0,r.readFile)(o.lq,"utf-8");if(!e)return{};return JSON.parse(e)}catch(e){throw console.error("读取或解析项目配置文件失败:",e),Error("无法加载项目配置")}}async function i(e){let s=o.lq+".tmp";try{await (0,r.writeFile)(s,JSON.stringify(e,null,2),"utf-8"),await (0,r.rename)(s,o.lq)}catch(e){throw console.error("保存项目配置文件失败:",e),Error("无法保存项目配置")}}},3033:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},3295:e=>{"use strict";e.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3873:e=>{"use strict";e.exports=require("path")},4870:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},4907:()=>{},4946:(e,s,t)=>{"use strict";t.d(s,{Ks:()=>n,lq:()=>i,tu:()=>a});var r=t(1820),o=t(3873);let a={WORKSPACE_ROOT:(0,o.join)((0,r.homedir)(),"Documents","prime-workspace"),GIT_TIMEOUT:3e5,MAX_CONCURRENT_CLONES:Math.max(2,Math.min((0,r.cpus)().length,8)),MAX_RETRY_ATTEMPTS:3},i=(0,o.join)((0,r.homedir)(),".prime-projects.json");var n=function(e){return e.PENDING="pending",e.EXISTING="existing",e.CLONING="cloning",e.SUCCESS="success",e.FAILED="failed",e.RETRYING="retrying",e.INCOMPLETE="incomplete",e}({})},8844:(e,s,t)=>{"use strict";t.r(s),t.d(s,{patchFetch:()=>k,routeModule:()=>w,serverHooks:()=>g,workAsyncStorage:()=>h,workUnitAsyncStorage:()=>f});var r={};t.r(r),t.d(r,{DELETE:()=>j,GET:()=>d,POST:()=>l});var o=t(9227),a=t(9044),i=t(1131),n=t(7642),c=t(9021),u=t(3873),p=t(2601),m=t(4946);async function l(e){try{let{projectName:s,apiName:t,method:r,siteName:o,content:a}=await e.json();if(!s||!t||!r||!o||void 0===a)return n.NextResponse.json({success:!1,error:"缺少必要参数:projectName, apiName, method, siteName, content"},{status:400});if(!(await (0,p.ZR)())[s])return n.NextResponse.json({success:!1,error:`项目 ${s} 不存在`},{status:404});let i=(0,u.join)(m.tu.WORKSPACE_ROOT,s),l=(0,u.join)(i,".mock"),d=(0,u.join)(l,t),j=(0,u.join)(d,r.toLowerCase()),w=(0,u.join)(j,`${o}.js`);try{await c.promises.access(i)}catch{return n.NextResponse.json({success:!1,error:`项目目录 ${s} 不存在`},{status:404})}try{await c.promises.access(l)}catch{await c.promises.mkdir(l,{recursive:!0})}try{await c.promises.access(d)}catch{await c.promises.mkdir(d,{recursive:!0})}try{await c.promises.access(j)}catch{await c.promises.mkdir(j,{recursive:!0})}let h=(0,u.join)(j,"setting.js"),f=!1;try{await c.promises.access(h),console.log(`setting.js文件已存在: ${h}`)}catch{let e=`module.exports = {
|
|
2
2
|
// 当前场景名称
|
|
3
3
|
currentSite: '${o}',
|
|
4
4
|
// 开启Mock的场景列表
|
|
5
5
|
open: ['${o}']
|
|
6
|
-
};`;await c.promises.writeFile(h,e,"utf-8"),f=!0,console.log(`setting.js文件创建成功: ${h}`)}return await c.promises.writeFile(w,a,"utf-8"),n.NextResponse.json({success:!0,message:"Mock文件创建成功",data:{projectName:s,apiName:t,method:r.toLowerCase(),siteName:o,filePath:(0,u.join)(".mock",t,r.toLowerCase(),`${o}.js`),settingCreated:f,createdAt:new Date().toISOString()}})}catch(s){let e=s instanceof Error?s.message:"创建Mock文件失败";return console.error("创建Mock文件失败:",s),n.NextResponse.json({success:!1,error:e},{status:500})}}async function d(e){try{let{searchParams:s}=new URL(e.url),t=s.get("project");if(!t)return n.NextResponse.json({success:!1,error:"项目名称参数缺失"},{status:400});if(!(await (0,p.ZR)())[t])return n.NextResponse.json({success:!1,error:`项目 ${t} 不存在`},{status:404});let r=(0,u.join)(m.tu.WORKSPACE_ROOT,t),o=(0,u.join)(r,".mock");try{await c.promises.access(o)}catch{return n.NextResponse.json({success:!0,data:{projectName:t,mockFiles:[]},message:"Mock目录不存在,返回空列表"})}let a=[];for(let e of(await c.promises.readdir(o,{withFileTypes:!0})))if(e.isDirectory()){let s=(0,u.join)(o,e.name),t=await c.promises.readdir(s,{withFileTypes:!0}),r=[];for(let o of t)if(o.isDirectory()){let t,a=(0,u.join)(s,o.name),i=await c.promises.readdir(a,{withFileTypes:!0}),n=(0,u.join)(a,"setting.js");try{await c.promises.access(n);let e=(await c.promises.readFile(n,"utf-8")).match(/module\.exports\s*=\s*({[\s\S]*?});?\s*$/);if(e)try{t=Function("return "+e[1])()}catch(e){console.warn(`解析setting.js失败: ${n}`,e)}}catch(e){console.warn(`读取setting.js失败: ${n}`,e)}let p=i.filter(e=>e.isFile()&&e.name.endsWith(".js")&&"setting.js"!==e.name).map(s=>({siteName:s.name.replace(".js",""),fileName:s.name,filePath:(0,u.join)(".mock",e.name,o.name,s.name)}));p.length>0&&r.push({method:o.name,setting:t,files:p})}r.length>0&&a.push({apiName:e.name,methods:r})}return n.NextResponse.json({success:!0,data:{projectName:t,mockFiles:a},message:"获取Mock文件列表成功"})}catch(s){let e=s instanceof Error?s.message:"获取Mock文件列表失败";return console.error("获取Mock文件列表失败:",s),n.NextResponse.json({success:!1,error:e},{status:500})}}async function j(e){try{let{searchParams:s}=new URL(e.url),t=s.get("project"),r=s.get("apiName"),o=s.get("method"),a=s.get("siteName");if(!t||!r||!o||!a)return n.NextResponse.json({success:!1,error:"缺少必要参数:project, apiName, method, siteName"},{status:400});if(!(await (0,p.ZR)())[t])return n.NextResponse.json({success:!1,error:`项目 ${t} 不存在`},{status:404});let i=(0,u.join)(m.tu.WORKSPACE_ROOT,t),l=(0,u.join)(i,".mock",r,o.toLowerCase(),`${a}.js`);try{await c.promises.access(l)}catch{return n.NextResponse.json({success:!1,error:"Mock文件不存在"},{status:404})}await c.promises.unlink(l);let d=(0,u.join)(i,".mock",r,o.toLowerCase());try{let e=await c.promises.readdir(d);if(0===e.length){await c.promises.rmdir(d);let e=(0,u.join)(i,".mock",r);try{let s=await c.promises.readdir(e);0===s.length&&await c.promises.rmdir(e)}catch{}}}catch{}return n.NextResponse.json({success:!0,message:"Mock文件删除成功",data:{projectName:t,apiName:r,method:o.toLowerCase(),siteName:a,deletedFile:(0,u.join)(".mock",r,o.toLowerCase(),`${a}.js`)}})}catch(s){let e=s instanceof Error?s.message:"删除Mock文件失败";return console.error("删除Mock文件失败:",s),n.NextResponse.json({success:!1,error:e},{status:500})}}let w=new o.AppRouteRouteModule({definition:{kind:a.RouteKind.APP_ROUTE,page:"/api/mock-file/route",pathname:"/api/mock-file",filename:"route",bundlePath:"app/api/mock-file/route"},resolvedPagePath:"/Users/edy/Documents/
|
|
6
|
+
};`;await c.promises.writeFile(h,e,"utf-8"),f=!0,console.log(`setting.js文件创建成功: ${h}`)}return await c.promises.writeFile(w,a,"utf-8"),n.NextResponse.json({success:!0,message:"Mock文件创建成功",data:{projectName:s,apiName:t,method:r.toLowerCase(),siteName:o,filePath:(0,u.join)(".mock",t,r.toLowerCase(),`${o}.js`),settingCreated:f,createdAt:new Date().toISOString()}})}catch(s){let e=s instanceof Error?s.message:"创建Mock文件失败";return console.error("创建Mock文件失败:",s),n.NextResponse.json({success:!1,error:e},{status:500})}}async function d(e){try{let{searchParams:s}=new URL(e.url),t=s.get("project");if(!t)return n.NextResponse.json({success:!1,error:"项目名称参数缺失"},{status:400});if(!(await (0,p.ZR)())[t])return n.NextResponse.json({success:!1,error:`项目 ${t} 不存在`},{status:404});let r=(0,u.join)(m.tu.WORKSPACE_ROOT,t),o=(0,u.join)(r,".mock");try{await c.promises.access(o)}catch{return n.NextResponse.json({success:!0,data:{projectName:t,mockFiles:[]},message:"Mock目录不存在,返回空列表"})}let a=[];for(let e of(await c.promises.readdir(o,{withFileTypes:!0})))if(e.isDirectory()){let s=(0,u.join)(o,e.name),t=await c.promises.readdir(s,{withFileTypes:!0}),r=[];for(let o of t)if(o.isDirectory()){let t,a=(0,u.join)(s,o.name),i=await c.promises.readdir(a,{withFileTypes:!0}),n=(0,u.join)(a,"setting.js");try{await c.promises.access(n);let e=(await c.promises.readFile(n,"utf-8")).match(/module\.exports\s*=\s*({[\s\S]*?});?\s*$/);if(e)try{t=Function("return "+e[1])()}catch(e){console.warn(`解析setting.js失败: ${n}`,e)}}catch(e){console.warn(`读取setting.js失败: ${n}`,e)}let p=i.filter(e=>e.isFile()&&e.name.endsWith(".js")&&"setting.js"!==e.name).map(s=>({siteName:s.name.replace(".js",""),fileName:s.name,filePath:(0,u.join)(".mock",e.name,o.name,s.name)}));p.length>0&&r.push({method:o.name,setting:t,files:p})}r.length>0&&a.push({apiName:e.name,methods:r})}return n.NextResponse.json({success:!0,data:{projectName:t,mockFiles:a},message:"获取Mock文件列表成功"})}catch(s){let e=s instanceof Error?s.message:"获取Mock文件列表失败";return console.error("获取Mock文件列表失败:",s),n.NextResponse.json({success:!1,error:e},{status:500})}}async function j(e){try{let{searchParams:s}=new URL(e.url),t=s.get("project"),r=s.get("apiName"),o=s.get("method"),a=s.get("siteName");if(!t||!r||!o||!a)return n.NextResponse.json({success:!1,error:"缺少必要参数:project, apiName, method, siteName"},{status:400});if(!(await (0,p.ZR)())[t])return n.NextResponse.json({success:!1,error:`项目 ${t} 不存在`},{status:404});let i=(0,u.join)(m.tu.WORKSPACE_ROOT,t),l=(0,u.join)(i,".mock",r,o.toLowerCase(),`${a}.js`);try{await c.promises.access(l)}catch{return n.NextResponse.json({success:!1,error:"Mock文件不存在"},{status:404})}await c.promises.unlink(l);let d=(0,u.join)(i,".mock",r,o.toLowerCase());try{let e=await c.promises.readdir(d);if(0===e.length){await c.promises.rmdir(d);let e=(0,u.join)(i,".mock",r);try{let s=await c.promises.readdir(e);0===s.length&&await c.promises.rmdir(e)}catch{}}}catch{}return n.NextResponse.json({success:!0,message:"Mock文件删除成功",data:{projectName:t,apiName:r,method:o.toLowerCase(),siteName:a,deletedFile:(0,u.join)(".mock",r,o.toLowerCase(),`${a}.js`)}})}catch(s){let e=s instanceof Error?s.message:"删除Mock文件失败";return console.error("删除Mock文件失败:",s),n.NextResponse.json({success:!1,error:e},{status:500})}}let w=new o.AppRouteRouteModule({definition:{kind:a.RouteKind.APP_ROUTE,page:"/api/mock-file/route",pathname:"/api/mock-file",filename:"route",bundlePath:"app/api/mock-file/route"},resolvedPagePath:"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/app/api/mock-file/route.ts",nextConfigOutput:"",userland:r}),{workAsyncStorage:h,workUnitAsyncStorage:f,serverHooks:g}=w;function k(){return(0,i.patchFetch)({workAsyncStorage:h,workUnitAsyncStorage:f})}},9021:e=>{"use strict";e.exports=require("fs")},9294:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-async-storage.external.js")},9748:e=>{"use strict";e.exports=require("fs/promises")}};var s=require("../../../webpack-runtime.js");s.C(e);var t=e=>s(s.s=e),r=s.X(0,[131,426],()=>t(8844));module.exports=r})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/mock-file/route"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{"317":{"*":{"id":"5207","name":"*","chunks":[],"async":false}},"1020":{"*":{"id":"9136","name":"*","chunks":[],"async":false}},"3053":{"*":{"id":"767","name":"*","chunks":[],"async":false}},"3561":{"*":{"id":"9855","name":"*","chunks":[],"async":false}},"3604":{"*":{"id":"6996","name":"*","chunks":[],"async":false}},"3636":{"*":{"id":"7774","name":"*","chunks":[],"async":false}},"6665":{"*":{"id":"1681","name":"*","chunks":[],"async":false}},"7472":{"*":{"id":"1249","name":"*","chunks":[],"async":false}},"9203":{"*":{"id":"8751","name":"*","chunks":[],"async":false}},"9510":{"*":{"id":"
|
|
1
|
+
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/mock-file/route"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{"317":{"*":{"id":"5207","name":"*","chunks":[],"async":false}},"1020":{"*":{"id":"9136","name":"*","chunks":[],"async":false}},"3053":{"*":{"id":"767","name":"*","chunks":[],"async":false}},"3561":{"*":{"id":"9855","name":"*","chunks":[],"async":false}},"3604":{"*":{"id":"6996","name":"*","chunks":[],"async":false}},"3636":{"*":{"id":"7774","name":"*","chunks":[],"async":false}},"6665":{"*":{"id":"1681","name":"*","chunks":[],"async":false}},"7472":{"*":{"id":"1249","name":"*","chunks":[],"async":false}},"9203":{"*":{"id":"8751","name":"*","chunks":[],"async":false}},"9510":{"*":{"id":"8843","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/client-page.js":{"id":3636,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/client-page.js":{"id":3636,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/client-segment.js":{"id":1020,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/client-segment.js":{"id":1020,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/error-boundary.js":{"id":3604,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":3604,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":3053,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":3053,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/layout-router.js":{"id":317,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/layout-router.js":{"id":317,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/metadata/async-metadata.js":{"id":3561,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/metadata/async-metadata.js":{"id":3561,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/metadata/metadata-boundary.js":{"id":9203,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/metadata/metadata-boundary.js":{"id":9203,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/render-from-template-context.js":{"id":6665,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":6665,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.tsx\",\"import\":\"Geist\",\"arguments\":[{\"variable\":\"--font-geist-sans\",\"subsets\":[\"latin\"]}],\"variableName\":\"geistSans\"}":{"id":6521,"name":"*","chunks":["177","static/chunks/app/layout-2c381be4c1bb73ed.js"],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.tsx\",\"import\":\"Geist_Mono\",\"arguments\":[{\"variable\":\"--font-geist-mono\",\"subsets\":[\"latin\"]}],\"variableName\":\"geistMono\"}":{"id":8947,"name":"*","chunks":["177","static/chunks/app/layout-2c381be4c1bb73ed.js"],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/app/globals.css":{"id":141,"name":"*","chunks":["177","static/chunks/app/layout-2c381be4c1bb73ed.js"],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/app/configuration/page.tsx":{"id":9510,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/components/project-initializer.tsx":{"id":7472,"name":"*","chunks":[],"async":false}},"entryCSSFiles":{"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/":[],"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/app/layout":[{"inlined":false,"path":"static/css/b10a602544a179de.css"}],"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/app/page":[],"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/app/api/mock-file/route":[]},"rscModuleMapping":{"141":{"*":{"id":"3019","name":"*","chunks":[],"async":false}},"317":{"*":{"id":"7429","name":"*","chunks":[],"async":false}},"1020":{"*":{"id":"9670","name":"*","chunks":[],"async":false}},"3053":{"*":{"id":"5473","name":"*","chunks":[],"async":false}},"3561":{"*":{"id":"8653","name":"*","chunks":[],"async":false}},"3604":{"*":{"id":"1382","name":"*","chunks":[],"async":false}},"3636":{"*":{"id":"4928","name":"*","chunks":[],"async":false}},"6665":{"*":{"id":"9687","name":"*","chunks":[],"async":false}},"7472":{"*":{"id":"9624","name":"*","chunks":[],"async":false}},"9203":{"*":{"id":"8757","name":"*","chunks":[],"async":false}},"9510":{"*":{"id":"4761","name":"*","chunks":[],"async":false}}},"edgeRscModuleMapping":{"317":{"*":{"id":"5207","name":"*","chunks":[],"async":false}},"1020":{"*":{"id":"9136","name":"*","chunks":[],"async":false}},"3053":{"*":{"id":"767","name":"*","chunks":[],"async":false}},"3561":{"*":{"id":"9855","name":"*","chunks":[],"async":false}},"3604":{"*":{"id":"6996","name":"*","chunks":[],"async":false}},"3636":{"*":{"id":"7774","name":"*","chunks":[],"async":false}},"6665":{"*":{"id":"1681","name":"*","chunks":[],"async":false}},"9203":{"*":{"id":"8751","name":"*","chunks":[],"async":false}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var e={};e.id=403,e.ids=[403],e.modules={483:()=>{},846:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},
|
|
1
|
+
(()=>{var e={};e.id=403,e.ids=[403],e.modules={483:()=>{},846:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},1820:e=>{"use strict";e.exports=require("os")},2601:(e,t,r)=>{"use strict";r.d(t,{ZR:()=>a,sF:()=>n});var s=r(9748),o=r(4946);async function a(){try{await (0,s.access)(o.lq,s.constants.F_OK)}catch{return await n({}),{}}try{let e=await (0,s.readFile)(o.lq,"utf-8");if(!e)return{};return JSON.parse(e)}catch(e){throw console.error("读取或解析项目配置文件失败:",e),Error("无法加载项目配置")}}async function n(e){let t=o.lq+".tmp";try{await (0,s.writeFile)(t,JSON.stringify(e,null,2),"utf-8"),await (0,s.rename)(t,o.lq)}catch(e){throw console.error("保存项目配置文件失败:",e),Error("无法保存项目配置")}}},3033:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},3295:e=>{"use strict";e.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3873:e=>{"use strict";e.exports=require("path")},4870:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},4907:()=>{},4946:(e,t,r)=>{"use strict";r.d(t,{Ks:()=>i,lq:()=>n,tu:()=>a});var s=r(1820),o=r(3873);let a={WORKSPACE_ROOT:(0,o.join)((0,s.homedir)(),"Documents","prime-workspace"),GIT_TIMEOUT:3e5,MAX_CONCURRENT_CLONES:Math.max(2,Math.min((0,s.cpus)().length,8)),MAX_RETRY_ATTEMPTS:3},n=(0,o.join)((0,s.homedir)(),".prime-projects.json");var i=function(e){return e.PENDING="pending",e.EXISTING="existing",e.CLONING="cloning",e.SUCCESS="success",e.FAILED="failed",e.RETRYING="retrying",e.INCOMPLETE="incomplete",e}({})},4960:(e,t,r)=>{"use strict";r.r(t),r.d(t,{patchFetch:()=>R,routeModule:()=>j,serverHooks:()=>f,workAsyncStorage:()=>x,workUnitAsyncStorage:()=>w});var s={};r.r(s),r.d(s,{GET:()=>m,PUT:()=>d});var o=r(9227),a=r(9044),n=r(1131),i=r(7642),c=r(9021),u=r(3873),p=r(2601),l=r(4946);async function m(e){try{let{searchParams:t}=new URL(e.url),r=t.get("project"),s=t.get("apiName"),o=t.get("method"),a=t.get("siteName");if(!r||!s||!o||!a)return i.NextResponse.json({success:!1,error:"缺少必要参数:project, apiName, method, siteName"},{status:400});if(!(await (0,p.ZR)())[r])return i.NextResponse.json({success:!1,error:`项目 ${r} 不存在`},{status:404});let n=(0,u.join)(l.tu.WORKSPACE_ROOT,r),m=(0,u.join)(n,".mock",s,o.toLowerCase(),`${a}.js`);try{await c.promises.access(m)}catch{return i.NextResponse.json({success:!1,error:"Mock文件不存在"},{status:404})}let d=await c.promises.readFile(m,"utf-8");return i.NextResponse.json({success:!0,data:{projectName:r,apiName:s,method:o.toLowerCase(),siteName:a,content:d,filePath:(0,u.join)(".mock",s,o.toLowerCase(),`${a}.js`)},message:"获取Mock文件内容成功"})}catch(t){let e=t instanceof Error?t.message:"获取Mock文件内容失败";return console.error("获取Mock文件内容失败:",t),i.NextResponse.json({success:!1,error:e},{status:500})}}async function d(e){try{let{projectName:t,apiName:r,method:s,siteName:o,content:a}=await e.json();if(!t||!r||!s||!o||void 0===a)return i.NextResponse.json({success:!1,error:"缺少必要参数:projectName, apiName, method, siteName, content"},{status:400});if(!(await (0,p.ZR)())[t])return i.NextResponse.json({success:!1,error:`项目 ${t} 不存在`},{status:404});let n=(0,u.join)(l.tu.WORKSPACE_ROOT,t),m=(0,u.join)(n,".mock",r,s.toLowerCase(),`${o}.js`);try{await c.promises.access(m)}catch{return i.NextResponse.json({success:!1,error:"Mock文件不存在"},{status:404})}return await c.promises.writeFile(m,a,"utf-8"),i.NextResponse.json({success:!0,message:"Mock文件内容更新成功",data:{projectName:t,apiName:r,method:s.toLowerCase(),siteName:o,filePath:(0,u.join)(".mock",r,s.toLowerCase(),`${o}.js`),updatedAt:new Date().toISOString()}})}catch(t){let e=t instanceof Error?t.message:"更新Mock文件内容失败";return console.error("更新Mock文件内容失败:",t),i.NextResponse.json({success:!1,error:e},{status:500})}}let j=new o.AppRouteRouteModule({definition:{kind:a.RouteKind.APP_ROUTE,page:"/api/mock-file-content/route",pathname:"/api/mock-file-content",filename:"route",bundlePath:"app/api/mock-file-content/route"},resolvedPagePath:"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/app/api/mock-file-content/route.ts",nextConfigOutput:"",userland:s}),{workAsyncStorage:x,workUnitAsyncStorage:w,serverHooks:f}=j;function R(){return(0,n.patchFetch)({workAsyncStorage:x,workUnitAsyncStorage:w})}},9021:e=>{"use strict";e.exports=require("fs")},9294:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-async-storage.external.js")},9748:e=>{"use strict";e.exports=require("fs/promises")}};var t=require("../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),s=t.X(0,[131,426],()=>r(4960));module.exports=s})();
|
package/dist/server/.next/server/app/api/mock-file-content/route_client-reference-manifest.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/mock-file-content/route"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{"317":{"*":{"id":"5207","name":"*","chunks":[],"async":false}},"1020":{"*":{"id":"9136","name":"*","chunks":[],"async":false}},"3053":{"*":{"id":"767","name":"*","chunks":[],"async":false}},"3561":{"*":{"id":"9855","name":"*","chunks":[],"async":false}},"3604":{"*":{"id":"6996","name":"*","chunks":[],"async":false}},"3636":{"*":{"id":"7774","name":"*","chunks":[],"async":false}},"6665":{"*":{"id":"1681","name":"*","chunks":[],"async":false}},"7472":{"*":{"id":"1249","name":"*","chunks":[],"async":false}},"9203":{"*":{"id":"8751","name":"*","chunks":[],"async":false}},"9510":{"*":{"id":"
|
|
1
|
+
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/mock-file-content/route"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{"317":{"*":{"id":"5207","name":"*","chunks":[],"async":false}},"1020":{"*":{"id":"9136","name":"*","chunks":[],"async":false}},"3053":{"*":{"id":"767","name":"*","chunks":[],"async":false}},"3561":{"*":{"id":"9855","name":"*","chunks":[],"async":false}},"3604":{"*":{"id":"6996","name":"*","chunks":[],"async":false}},"3636":{"*":{"id":"7774","name":"*","chunks":[],"async":false}},"6665":{"*":{"id":"1681","name":"*","chunks":[],"async":false}},"7472":{"*":{"id":"1249","name":"*","chunks":[],"async":false}},"9203":{"*":{"id":"8751","name":"*","chunks":[],"async":false}},"9510":{"*":{"id":"8843","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/client-page.js":{"id":3636,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/client-page.js":{"id":3636,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/client-segment.js":{"id":1020,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/client-segment.js":{"id":1020,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/error-boundary.js":{"id":3604,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":3604,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":3053,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":3053,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/layout-router.js":{"id":317,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/layout-router.js":{"id":317,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/metadata/async-metadata.js":{"id":3561,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/metadata/async-metadata.js":{"id":3561,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/metadata/metadata-boundary.js":{"id":9203,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/metadata/metadata-boundary.js":{"id":9203,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/render-from-template-context.js":{"id":6665,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":6665,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.tsx\",\"import\":\"Geist\",\"arguments\":[{\"variable\":\"--font-geist-sans\",\"subsets\":[\"latin\"]}],\"variableName\":\"geistSans\"}":{"id":6521,"name":"*","chunks":["177","static/chunks/app/layout-2c381be4c1bb73ed.js"],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.tsx\",\"import\":\"Geist_Mono\",\"arguments\":[{\"variable\":\"--font-geist-mono\",\"subsets\":[\"latin\"]}],\"variableName\":\"geistMono\"}":{"id":8947,"name":"*","chunks":["177","static/chunks/app/layout-2c381be4c1bb73ed.js"],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/app/globals.css":{"id":141,"name":"*","chunks":["177","static/chunks/app/layout-2c381be4c1bb73ed.js"],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/app/configuration/page.tsx":{"id":9510,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/components/project-initializer.tsx":{"id":7472,"name":"*","chunks":[],"async":false}},"entryCSSFiles":{"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/":[],"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/app/layout":[{"inlined":false,"path":"static/css/b10a602544a179de.css"}],"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/app/page":[],"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/app/api/mock-file-content/route":[]},"rscModuleMapping":{"141":{"*":{"id":"3019","name":"*","chunks":[],"async":false}},"317":{"*":{"id":"7429","name":"*","chunks":[],"async":false}},"1020":{"*":{"id":"9670","name":"*","chunks":[],"async":false}},"3053":{"*":{"id":"5473","name":"*","chunks":[],"async":false}},"3561":{"*":{"id":"8653","name":"*","chunks":[],"async":false}},"3604":{"*":{"id":"1382","name":"*","chunks":[],"async":false}},"3636":{"*":{"id":"4928","name":"*","chunks":[],"async":false}},"6665":{"*":{"id":"9687","name":"*","chunks":[],"async":false}},"7472":{"*":{"id":"9624","name":"*","chunks":[],"async":false}},"9203":{"*":{"id":"8757","name":"*","chunks":[],"async":false}},"9510":{"*":{"id":"4761","name":"*","chunks":[],"async":false}}},"edgeRscModuleMapping":{"317":{"*":{"id":"5207","name":"*","chunks":[],"async":false}},"1020":{"*":{"id":"9136","name":"*","chunks":[],"async":false}},"3053":{"*":{"id":"767","name":"*","chunks":[],"async":false}},"3561":{"*":{"id":"9855","name":"*","chunks":[],"async":false}},"3604":{"*":{"id":"6996","name":"*","chunks":[],"async":false}},"3636":{"*":{"id":"7774","name":"*","chunks":[],"async":false}},"6665":{"*":{"id":"1681","name":"*","chunks":[],"async":false}},"9203":{"*":{"id":"8751","name":"*","chunks":[],"async":false}}}}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(()=>{var e={};e.id=552,e.ids=[552],e.modules={483:()=>{},
|
|
1
|
+
(()=>{var e={};e.id=552,e.ids=[552],e.modules={483:()=>{},495:(e,t,r)=>{"use strict";r.r(t),r.d(t,{patchFetch:()=>h,routeModule:()=>m,serverHooks:()=>f,workAsyncStorage:()=>x,workUnitAsyncStorage:()=>w});var s={};r.r(s),r.d(s,{PUT:()=>d});var o=r(9227),n=r(9044),a=r(1131),i=r(7642),c=r(9021),u=r(3873),p=r(2601),l=r(4946);async function d(e){try{let{projectName:t,apiName:r,method:s,siteName:o,isOpen:n}=await e.json();if(!t||!r||!s||!o||"boolean"!=typeof n)return i.NextResponse.json({success:!1,error:"缺少必要参数:projectName, apiName, method, siteName, isOpen"},{status:400});if(!(await (0,p.ZR)())[t])return i.NextResponse.json({success:!1,error:`项目 ${t} 不存在`},{status:404});let a=(0,u.join)(l.tu.WORKSPACE_ROOT,t),d=(0,u.join)(a,".mock",r,s.toLowerCase(),"setting.js");try{await c.promises.access(d)}catch{return i.NextResponse.json({success:!1,error:"setting.js文件不存在"},{status:404})}let m=(await c.promises.readFile(d,"utf-8")).match(/module\.exports\s*=\s*({[\s\S]*?});?\s*$/),x={};if(m)try{x=Function("return "+m[1])()}catch(e){console.warn(`解析setting.js失败: ${d}`,e)}Array.isArray(x.open)||(x.open=[]);let w=x.open,f=w.indexOf(o);n?-1===f&&w.push(o):-1!==f&&w.splice(f,1);let h=`module.exports = {
|
|
2
2
|
// 当前场景名称
|
|
3
3
|
currentSite: '${x.currentSite||o}',
|
|
4
4
|
// 开启Mock的场景列表
|
|
5
|
-
open: ${JSON.stringify(
|
|
6
|
-
};`;return await c.promises.writeFile(d,
|
|
5
|
+
open: ${JSON.stringify(w)}
|
|
6
|
+
};`;return await c.promises.writeFile(d,h,"utf-8"),i.NextResponse.json({success:!0,message:"Mock开启状态更新成功",data:{projectName:t,apiName:r,method:s.toLowerCase(),siteName:o,isOpen:n,openSites:w,filePath:(0,u.join)(".mock",r,s.toLowerCase(),"setting.js"),updatedAt:new Date().toISOString()}})}catch(t){let e=t instanceof Error?t.message:"更新Mock开启状态失败";return console.error("更新Mock开启状态失败:",t),i.NextResponse.json({success:!1,error:e},{status:500})}}let m=new o.AppRouteRouteModule({definition:{kind:n.RouteKind.APP_ROUTE,page:"/api/mock-open-status/route",pathname:"/api/mock-open-status",filename:"route",bundlePath:"app/api/mock-open-status/route"},resolvedPagePath:"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/app/api/mock-open-status/route.ts",nextConfigOutput:"",userland:s}),{workAsyncStorage:x,workUnitAsyncStorage:w,serverHooks:f}=m;function h(){return(0,a.patchFetch)({workAsyncStorage:x,workUnitAsyncStorage:w})}},846:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},1820:e=>{"use strict";e.exports=require("os")},2601:(e,t,r)=>{"use strict";r.d(t,{ZR:()=>n,sF:()=>a});var s=r(9748),o=r(4946);async function n(){try{await (0,s.access)(o.lq,s.constants.F_OK)}catch{return await a({}),{}}try{let e=await (0,s.readFile)(o.lq,"utf-8");if(!e)return{};return JSON.parse(e)}catch(e){throw console.error("读取或解析项目配置文件失败:",e),Error("无法加载项目配置")}}async function a(e){let t=o.lq+".tmp";try{await (0,s.writeFile)(t,JSON.stringify(e,null,2),"utf-8"),await (0,s.rename)(t,o.lq)}catch(e){throw console.error("保存项目配置文件失败:",e),Error("无法保存项目配置")}}},3033:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},3295:e=>{"use strict";e.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3873:e=>{"use strict";e.exports=require("path")},4870:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},4907:()=>{},4946:(e,t,r)=>{"use strict";r.d(t,{Ks:()=>i,lq:()=>a,tu:()=>n});var s=r(1820),o=r(3873);let n={WORKSPACE_ROOT:(0,o.join)((0,s.homedir)(),"Documents","prime-workspace"),GIT_TIMEOUT:3e5,MAX_CONCURRENT_CLONES:Math.max(2,Math.min((0,s.cpus)().length,8)),MAX_RETRY_ATTEMPTS:3},a=(0,o.join)((0,s.homedir)(),".prime-projects.json");var i=function(e){return e.PENDING="pending",e.EXISTING="existing",e.CLONING="cloning",e.SUCCESS="success",e.FAILED="failed",e.RETRYING="retrying",e.INCOMPLETE="incomplete",e}({})},9021:e=>{"use strict";e.exports=require("fs")},9294:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-async-storage.external.js")},9748:e=>{"use strict";e.exports=require("fs/promises")}};var t=require("../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),s=t.X(0,[131,426],()=>r(495));module.exports=s})();
|
package/dist/server/.next/server/app/api/mock-open-status/route_client-reference-manifest.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/mock-open-status/route"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{"317":{"*":{"id":"5207","name":"*","chunks":[],"async":false}},"1020":{"*":{"id":"9136","name":"*","chunks":[],"async":false}},"3053":{"*":{"id":"767","name":"*","chunks":[],"async":false}},"3561":{"*":{"id":"9855","name":"*","chunks":[],"async":false}},"3604":{"*":{"id":"6996","name":"*","chunks":[],"async":false}},"3636":{"*":{"id":"7774","name":"*","chunks":[],"async":false}},"6665":{"*":{"id":"1681","name":"*","chunks":[],"async":false}},"7472":{"*":{"id":"1249","name":"*","chunks":[],"async":false}},"9203":{"*":{"id":"8751","name":"*","chunks":[],"async":false}},"9510":{"*":{"id":"
|
|
1
|
+
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/mock-open-status/route"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{"317":{"*":{"id":"5207","name":"*","chunks":[],"async":false}},"1020":{"*":{"id":"9136","name":"*","chunks":[],"async":false}},"3053":{"*":{"id":"767","name":"*","chunks":[],"async":false}},"3561":{"*":{"id":"9855","name":"*","chunks":[],"async":false}},"3604":{"*":{"id":"6996","name":"*","chunks":[],"async":false}},"3636":{"*":{"id":"7774","name":"*","chunks":[],"async":false}},"6665":{"*":{"id":"1681","name":"*","chunks":[],"async":false}},"7472":{"*":{"id":"1249","name":"*","chunks":[],"async":false}},"9203":{"*":{"id":"8751","name":"*","chunks":[],"async":false}},"9510":{"*":{"id":"8843","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/client-page.js":{"id":3636,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/client-page.js":{"id":3636,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/client-segment.js":{"id":1020,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/client-segment.js":{"id":1020,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/error-boundary.js":{"id":3604,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":3604,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":3053,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":3053,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/layout-router.js":{"id":317,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/layout-router.js":{"id":317,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/metadata/async-metadata.js":{"id":3561,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/metadata/async-metadata.js":{"id":3561,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/metadata/metadata-boundary.js":{"id":9203,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/metadata/metadata-boundary.js":{"id":9203,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/render-from-template-context.js":{"id":6665,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":6665,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.tsx\",\"import\":\"Geist\",\"arguments\":[{\"variable\":\"--font-geist-sans\",\"subsets\":[\"latin\"]}],\"variableName\":\"geistSans\"}":{"id":6521,"name":"*","chunks":["177","static/chunks/app/layout-2c381be4c1bb73ed.js"],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.tsx\",\"import\":\"Geist_Mono\",\"arguments\":[{\"variable\":\"--font-geist-mono\",\"subsets\":[\"latin\"]}],\"variableName\":\"geistMono\"}":{"id":8947,"name":"*","chunks":["177","static/chunks/app/layout-2c381be4c1bb73ed.js"],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/app/globals.css":{"id":141,"name":"*","chunks":["177","static/chunks/app/layout-2c381be4c1bb73ed.js"],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/app/configuration/page.tsx":{"id":9510,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/components/project-initializer.tsx":{"id":7472,"name":"*","chunks":[],"async":false}},"entryCSSFiles":{"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/":[],"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/app/layout":[{"inlined":false,"path":"static/css/b10a602544a179de.css"}],"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/app/page":[],"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/app/api/mock-open-status/route":[]},"rscModuleMapping":{"141":{"*":{"id":"3019","name":"*","chunks":[],"async":false}},"317":{"*":{"id":"7429","name":"*","chunks":[],"async":false}},"1020":{"*":{"id":"9670","name":"*","chunks":[],"async":false}},"3053":{"*":{"id":"5473","name":"*","chunks":[],"async":false}},"3561":{"*":{"id":"8653","name":"*","chunks":[],"async":false}},"3604":{"*":{"id":"1382","name":"*","chunks":[],"async":false}},"3636":{"*":{"id":"4928","name":"*","chunks":[],"async":false}},"6665":{"*":{"id":"9687","name":"*","chunks":[],"async":false}},"7472":{"*":{"id":"9624","name":"*","chunks":[],"async":false}},"9203":{"*":{"id":"8757","name":"*","chunks":[],"async":false}},"9510":{"*":{"id":"4761","name":"*","chunks":[],"async":false}}},"edgeRscModuleMapping":{"317":{"*":{"id":"5207","name":"*","chunks":[],"async":false}},"1020":{"*":{"id":"9136","name":"*","chunks":[],"async":false}},"3053":{"*":{"id":"767","name":"*","chunks":[],"async":false}},"3561":{"*":{"id":"9855","name":"*","chunks":[],"async":false}},"3604":{"*":{"id":"6996","name":"*","chunks":[],"async":false}},"3636":{"*":{"id":"7774","name":"*","chunks":[],"async":false}},"6665":{"*":{"id":"1681","name":"*","chunks":[],"async":false}},"9203":{"*":{"id":"8751","name":"*","chunks":[],"async":false}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var e={};e.id=139,e.ids=[139],e.modules={
|
|
1
|
+
(()=>{var e={};e.id=139,e.ids=[139],e.modules={25:(e,t,r)=>{"use strict";r.r(t),r.d(t,{patchFetch:()=>h,routeModule:()=>m,serverHooks:()=>w,workAsyncStorage:()=>x,workUnitAsyncStorage:()=>g});var s={};r.r(s),r.d(s,{PUT:()=>d});var o=r(9227),i=r(9044),n=r(1131),a=r(7642),c=r(9021),u=r(3873),p=r(2601),l=r(4946);async function d(e){try{let{projectName:t,apiName:r,method:s,currentSite:o}=await e.json();if(!t||!r||!s||!o)return a.NextResponse.json({success:!1,error:"缺少必要参数:projectName, apiName, method, currentSite"},{status:400});if(!(await (0,p.ZR)())[t])return a.NextResponse.json({success:!1,error:`项目 ${t} 不存在`},{status:404});let i=(0,u.join)(l.tu.WORKSPACE_ROOT,t),n=(0,u.join)(i,".mock",r,s.toLowerCase(),"setting.js");try{await c.promises.access(n)}catch{return a.NextResponse.json({success:!1,error:"setting.js文件不存在"},{status:404})}let d=(await c.promises.readFile(n,"utf-8")).match(/module\.exports\s*=\s*({[\s\S]*?});?\s*$/),m={};if(d)try{m=Function("return "+d[1])()}catch(e){console.warn(`解析setting.js失败: ${n}`,e)}m.currentSite=o;let x=`module.exports = ${JSON.stringify(m,null,2).replace(/"([^"]+)":/g,"$1:")};`;return await c.promises.writeFile(n,x,"utf-8"),a.NextResponse.json({success:!0,message:"Mock设置更新成功",data:{projectName:t,apiName:r,method:s.toLowerCase(),currentSite:o,filePath:(0,u.join)(".mock",r,s.toLowerCase(),"setting.js"),updatedAt:new Date().toISOString()}})}catch(t){let e=t instanceof Error?t.message:"更新Mock设置失败";return console.error("更新Mock设置失败:",t),a.NextResponse.json({success:!1,error:e},{status:500})}}let m=new o.AppRouteRouteModule({definition:{kind:i.RouteKind.APP_ROUTE,page:"/api/mock-setting/route",pathname:"/api/mock-setting",filename:"route",bundlePath:"app/api/mock-setting/route"},resolvedPagePath:"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/app/api/mock-setting/route.ts",nextConfigOutput:"",userland:s}),{workAsyncStorage:x,workUnitAsyncStorage:g,serverHooks:w}=m;function h(){return(0,n.patchFetch)({workAsyncStorage:x,workUnitAsyncStorage:g})}},483:()=>{},846:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},1820:e=>{"use strict";e.exports=require("os")},2601:(e,t,r)=>{"use strict";r.d(t,{ZR:()=>i,sF:()=>n});var s=r(9748),o=r(4946);async function i(){try{await (0,s.access)(o.lq,s.constants.F_OK)}catch{return await n({}),{}}try{let e=await (0,s.readFile)(o.lq,"utf-8");if(!e)return{};return JSON.parse(e)}catch(e){throw console.error("读取或解析项目配置文件失败:",e),Error("无法加载项目配置")}}async function n(e){let t=o.lq+".tmp";try{await (0,s.writeFile)(t,JSON.stringify(e,null,2),"utf-8"),await (0,s.rename)(t,o.lq)}catch(e){throw console.error("保存项目配置文件失败:",e),Error("无法保存项目配置")}}},3033:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},3295:e=>{"use strict";e.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3873:e=>{"use strict";e.exports=require("path")},4870:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},4907:()=>{},4946:(e,t,r)=>{"use strict";r.d(t,{Ks:()=>a,lq:()=>n,tu:()=>i});var s=r(1820),o=r(3873);let i={WORKSPACE_ROOT:(0,o.join)((0,s.homedir)(),"Documents","prime-workspace"),GIT_TIMEOUT:3e5,MAX_CONCURRENT_CLONES:Math.max(2,Math.min((0,s.cpus)().length,8)),MAX_RETRY_ATTEMPTS:3},n=(0,o.join)((0,s.homedir)(),".prime-projects.json");var a=function(e){return e.PENDING="pending",e.EXISTING="existing",e.CLONING="cloning",e.SUCCESS="success",e.FAILED="failed",e.RETRYING="retrying",e.INCOMPLETE="incomplete",e}({})},9021:e=>{"use strict";e.exports=require("fs")},9294:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-async-storage.external.js")},9748:e=>{"use strict";e.exports=require("fs/promises")}};var t=require("../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),s=t.X(0,[131,426],()=>r(25));module.exports=s})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/mock-setting/route"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{"317":{"*":{"id":"5207","name":"*","chunks":[],"async":false}},"1020":{"*":{"id":"9136","name":"*","chunks":[],"async":false}},"3053":{"*":{"id":"767","name":"*","chunks":[],"async":false}},"3561":{"*":{"id":"9855","name":"*","chunks":[],"async":false}},"3604":{"*":{"id":"6996","name":"*","chunks":[],"async":false}},"3636":{"*":{"id":"7774","name":"*","chunks":[],"async":false}},"6665":{"*":{"id":"1681","name":"*","chunks":[],"async":false}},"7472":{"*":{"id":"1249","name":"*","chunks":[],"async":false}},"9203":{"*":{"id":"8751","name":"*","chunks":[],"async":false}},"9510":{"*":{"id":"
|
|
1
|
+
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/mock-setting/route"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{"317":{"*":{"id":"5207","name":"*","chunks":[],"async":false}},"1020":{"*":{"id":"9136","name":"*","chunks":[],"async":false}},"3053":{"*":{"id":"767","name":"*","chunks":[],"async":false}},"3561":{"*":{"id":"9855","name":"*","chunks":[],"async":false}},"3604":{"*":{"id":"6996","name":"*","chunks":[],"async":false}},"3636":{"*":{"id":"7774","name":"*","chunks":[],"async":false}},"6665":{"*":{"id":"1681","name":"*","chunks":[],"async":false}},"7472":{"*":{"id":"1249","name":"*","chunks":[],"async":false}},"9203":{"*":{"id":"8751","name":"*","chunks":[],"async":false}},"9510":{"*":{"id":"8843","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/client-page.js":{"id":3636,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/client-page.js":{"id":3636,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/client-segment.js":{"id":1020,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/client-segment.js":{"id":1020,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/error-boundary.js":{"id":3604,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":3604,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":3053,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":3053,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/layout-router.js":{"id":317,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/layout-router.js":{"id":317,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/metadata/async-metadata.js":{"id":3561,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/metadata/async-metadata.js":{"id":3561,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/metadata/metadata-boundary.js":{"id":9203,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/metadata/metadata-boundary.js":{"id":9203,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/client/components/render-from-template-context.js":{"id":6665,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":6665,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.tsx\",\"import\":\"Geist\",\"arguments\":[{\"variable\":\"--font-geist-sans\",\"subsets\":[\"latin\"]}],\"variableName\":\"geistSans\"}":{"id":6521,"name":"*","chunks":["177","static/chunks/app/layout-2c381be4c1bb73ed.js"],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/node_modules/.pnpm/next@15.3.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.tsx\",\"import\":\"Geist_Mono\",\"arguments\":[{\"variable\":\"--font-geist-mono\",\"subsets\":[\"latin\"]}],\"variableName\":\"geistMono\"}":{"id":8947,"name":"*","chunks":["177","static/chunks/app/layout-2c381be4c1bb73ed.js"],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/app/globals.css":{"id":141,"name":"*","chunks":["177","static/chunks/app/layout-2c381be4c1bb73ed.js"],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/app/configuration/page.tsx":{"id":9510,"name":"*","chunks":[],"async":false},"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/components/project-initializer.tsx":{"id":7472,"name":"*","chunks":[],"async":false}},"entryCSSFiles":{"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/":[],"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/app/layout":[{"inlined":false,"path":"static/css/b10a602544a179de.css"}],"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/app/page":[],"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/app/api/mock-setting/route":[]},"rscModuleMapping":{"141":{"*":{"id":"3019","name":"*","chunks":[],"async":false}},"317":{"*":{"id":"7429","name":"*","chunks":[],"async":false}},"1020":{"*":{"id":"9670","name":"*","chunks":[],"async":false}},"3053":{"*":{"id":"5473","name":"*","chunks":[],"async":false}},"3561":{"*":{"id":"8653","name":"*","chunks":[],"async":false}},"3604":{"*":{"id":"1382","name":"*","chunks":[],"async":false}},"3636":{"*":{"id":"4928","name":"*","chunks":[],"async":false}},"6665":{"*":{"id":"9687","name":"*","chunks":[],"async":false}},"7472":{"*":{"id":"9624","name":"*","chunks":[],"async":false}},"9203":{"*":{"id":"8757","name":"*","chunks":[],"async":false}},"9510":{"*":{"id":"4761","name":"*","chunks":[],"async":false}}},"edgeRscModuleMapping":{"317":{"*":{"id":"5207","name":"*","chunks":[],"async":false}},"1020":{"*":{"id":"9136","name":"*","chunks":[],"async":false}},"3053":{"*":{"id":"767","name":"*","chunks":[],"async":false}},"3561":{"*":{"id":"9855","name":"*","chunks":[],"async":false}},"3604":{"*":{"id":"6996","name":"*","chunks":[],"async":false}},"3636":{"*":{"id":"7774","name":"*","chunks":[],"async":false}},"6665":{"*":{"id":"1681","name":"*","chunks":[],"async":false}},"9203":{"*":{"id":"8751","name":"*","chunks":[],"async":false}}}}
|
|
@@ -1 +1,14 @@
|
|
|
1
|
-
(()=>{var e={};e.id=522,e.ids=[522],e.modules={
|
|
1
|
+
(()=>{var e={};e.id=522,e.ids=[522],e.modules={483:()=>{},846:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},1804:(e,s,t)=>{"use strict";t.d(s,{kf:()=>g,YK:()=>l,eR:()=>c,DR:()=>u,x9:()=>m,e_:()=>a});let r=require("child_process");var n=t(9021),i=t(3873),o=t(4946);async function u(e){try{return(0,n.existsSync)(e)||(0,n.mkdirSync)(e,{recursive:!0}),{success:!0}}catch(e){return{success:!1,error:`创建工作空间目录失败: ${e instanceof Error?e.message:String(e)}`}}}async function c(e){let{repoUrl:s,targetDir:t,timeout:n,onProgress:u,onError:c,onLog:a}=e,l=(0,i.basename)(s,".git");return new Promise(e=>{let p=Date.now(),d={projectName:l,status:o.Ks.CLONING,progress:0,message:"开始克隆项目...",startTime:p};u?.(0,"开始克隆项目...");let g=(0,i.join)(t,l),m=["clone","--progress","--verbose",s,g];a?.(l,"stdout",`[开始克隆] 执行命令: git ${m.join(" ")}
|
|
2
|
+
`),a?.(l,"stdout",`[目标目录] ${g}
|
|
3
|
+
`),a?.(l,"stdout",`[仓库地址] ${s}
|
|
4
|
+
`);let f=(0,r.spawn)("git",m,{cwd:t,stdio:["pipe","pipe","pipe"]}),y="",x=0;a?.(l,"stdout",`[进程启动] Git 进程 PID: ${f.pid}
|
|
5
|
+
`);let C=setTimeout(()=>{a?.(l,"stderr",`[超时警告] Git 进程运行超过 ${n/1e3}s,即将终止
|
|
6
|
+
`),f.kill("SIGTERM");let s={...d,status:o.Ks.FAILED,progress:x,message:"克隆操作超时",error:`克隆操作超时 (${n/1e3}s)`,endTime:Date.now()};a?.(l,"stderr",`[进程终止] 克隆操作超时
|
|
7
|
+
`),c?.(`${l}: 克隆操作超时`),e(s)},n);f.stdout?.on("data",e=>{let s=e.toString();a?.(l,"stdout",s),x=Math.min(x+10,80),u?.(x,"正在克隆代码...")}),f.stderr?.on("data",e=>{let s=e.toString();y+=s,s.includes("remote:")||s.includes("Receiving objects")||s.includes("Resolving deltas")||s.includes("Counting objects")||s.includes("Enumerating objects")||s.includes("Compressing objects")||s.includes("upload-pack")||s.includes("POST git-")||s.includes("正克隆到")||s.includes("Cloning into")?a?.(l,"progress",s):a?.(l,"stderr",s),s.includes("Receiving objects")||s.includes("Resolving deltas")?(x=Math.min(x+5,90),u?.(x,"正在接收对象...")):s.includes("Counting objects")?(x=Math.min(x+2,70),u?.(x,"正在计算对象...")):s.includes("Enumerating objects")&&(x=Math.min(x+2,50),u?.(x,"正在枚举对象..."))}),f.on("close",s=>{clearTimeout(C);let t=Date.now(),r=t-p;if(a?.(l,"stdout",`[进程结束] Git 进程退出,代码: ${s},耗时: ${Math.round(r/1e3)}s
|
|
8
|
+
`),0===s){a?.(l,"stdout",`[克隆成功] 项目已成功克隆到: ${g}
|
|
9
|
+
`);let s={...d,status:o.Ks.SUCCESS,progress:100,message:"克隆完成",endTime:t};u?.(100,"克隆完成"),e(s)}else{let r=function(e){let s=e.toLowerCase();return s.includes("authentication failed")||s.includes("access denied")?"身份验证失败,请检查仓库访问权限":s.includes("repository not found")||s.includes("not found")?"仓库不存在或无法访问":s.includes("network")||s.includes("connection")?"网络连接问题,请检查网络设置":s.includes("timeout")?"网络超时,请重试":s.includes("permission denied")?"权限被拒绝,请检查文件系统权限":s.includes("already exists")?"目标目录已存在":e.slice(0,200)+(e.length>200?"...":"")}(y);a?.(l,"stderr",`[克隆失败] 错误信息: ${r}
|
|
10
|
+
`),a?.(l,"stderr",`[完整错误输出]
|
|
11
|
+
${y}
|
|
12
|
+
`);let n={...d,status:o.Ks.FAILED,progress:x,message:"克隆失败",error:r||`Git 进程退出,代码: ${s}`,endTime:t};c?.(`${l}: ${n.error}`),e(n)}}),f.on("error",s=>{clearTimeout(C),a?.(l,"stderr",`[进程错误] Git 进程启动失败: ${s.message}
|
|
13
|
+
`),a?.(l,"stderr",`[错误详情] ${s.stack||"No stack trace"}
|
|
14
|
+
`);let t={...d,status:o.Ks.FAILED,progress:x,message:"进程启动失败",error:`进程启动失败: ${s.message}`,endTime:Date.now()};c?.(`${l}: ${s.message}`),e(t)})})}function a(e){return e.replace(/[^a-zA-Z0-9\-_]/g,"")}async function l(e,s){try{let t=(0,i.join)(e,s);if(!(0,n.existsSync)(t))return{exists:!1,status:"not_exists",needsCleanup:!1};let r=(0,i.join)(t,".git");if(!(0,n.existsSync)(r))return{exists:!0,status:"incomplete",needsCleanup:!0};if(!await d(t))return console.log(`检测到不完整的Git仓库: ${t}`),{exists:!0,status:"incomplete",needsCleanup:!0};return{exists:!0,status:"complete",needsCleanup:!1}}catch(e){return console.error(`检查项目 ${s} 状态时出错:`,e),{exists:!1,status:"not_exists",needsCleanup:!1}}}async function p(e,s){return"complete"===(await l(e,s)).status}async function d(e){try{let s=(0,i.join)(e,".git");for(let e of["HEAD","config","refs"]){let t=(0,i.join)(s,e);if(!(0,n.existsSync)(t))return!1}let t=(await n.promises.readdir(e)).filter(e=>".git"!==e);if(0===t.length)return!1;let r=(0,i.join)(s,"HEAD"),o=await n.promises.readFile(r,"utf-8");if(!o.trim()||o.includes("unborn"))return!1;return!0}catch(e){return console.error("检查Git仓库完整性时出错:",e),!1}}async function g(e,s){let t={},r=s.map(async s=>{let r=await p(e,s);t[s]=r});return await Promise.all(r),t}async function m(e){return new Promise(s=>{if(!(0,n.existsSync)(e))return void s({success:!1,error:`项目路径不存在: ${e}`});let t=(0,r.spawn)("cursor",[e],{stdio:["ignore","pipe","pipe"],detached:!0}),i="",o=setTimeout(()=>{t.kill("SIGTERM"),s({success:!1,error:"Cursor 命令执行超时"})},1e4);t.stderr?.on("data",e=>{i+=e.toString()}),t.on("exit",e=>{clearTimeout(o),0===e?s({success:!0}):s({success:!1,error:`Cursor 退出代码: ${e}${i?`, 错误: ${i}`:""}`})}),t.on("error",e=>{clearTimeout(o),e.message.includes("ENOENT")?s({success:!1,error:"Cursor 命令未找到,请确保 Cursor CLI 已正确安装并在 PATH 中"}):s({success:!1,error:`启动 Cursor 失败: ${e.message}`})}),t.unref()})}},1820:e=>{"use strict";e.exports=require("os")},3033:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},3873:e=>{"use strict";e.exports=require("path")},4870:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},4907:()=>{},4946:(e,s,t)=>{"use strict";t.d(s,{Ks:()=>u,lq:()=>o,tu:()=>i});var r=t(1820),n=t(3873);let i={WORKSPACE_ROOT:(0,n.join)((0,r.homedir)(),"Documents","prime-workspace"),GIT_TIMEOUT:3e5,MAX_CONCURRENT_CLONES:Math.max(2,Math.min((0,r.cpus)().length,8)),MAX_RETRY_ATTEMPTS:3},o=(0,n.join)((0,r.homedir)(),".prime-projects.json");var u=function(e){return e.PENDING="pending",e.EXISTING="existing",e.CLONING="cloning",e.SUCCESS="success",e.FAILED="failed",e.RETRYING="retrying",e.INCOMPLETE="incomplete",e}({})},7144:(e,s,t)=>{"use strict";t.r(s),t.d(s,{patchFetch:()=>f,routeModule:()=>p,serverHooks:()=>m,workAsyncStorage:()=>d,workUnitAsyncStorage:()=>g});var r={};t.r(r),t.d(r,{POST:()=>l});var n=t(9227),i=t(9044),o=t(1131),u=t(4946),c=t(1804),a=t(3873);async function l(e){try{let{projectName:s}=await e.json();if(!s||"string"!=typeof s)return new Response(JSON.stringify({success:!1,error:"项目名称是必需的"}),{status:400,headers:{"Content-Type":"application/json"}});if((0,c.e_)(s)!==s)return new Response(JSON.stringify({success:!1,error:"项目名称包含无效字符"}),{status:400,headers:{"Content-Type":"application/json"}});let t=u.tu.WORKSPACE_ROOT,r=(0,a.join)(t,s),n=await (0,c.x9)(r);if(n.success)return new Response(JSON.stringify({success:!0,message:`项目 ${s} 已在 Cursor 中打开`,projectPath:r}),{status:200,headers:{"Content-Type":"application/json"}});return new Response(JSON.stringify({success:!1,error:n.error,projectName:s,projectPath:r}),{status:500,headers:{"Content-Type":"application/json"}})}catch(s){let e=s instanceof Error?s.message:String(s);return console.error("打开项目失败:",s),new Response(JSON.stringify({success:!1,error:`打开项目失败: ${e}`}),{status:500,headers:{"Content-Type":"application/json"}})}}let p=new n.AppRouteRouteModule({definition:{kind:i.RouteKind.APP_ROUTE,page:"/api/open-project/route",pathname:"/api/open-project",filename:"route",bundlePath:"app/api/open-project/route"},resolvedPagePath:"/Users/edy/Documents/prime-workspace/prime-dev-cli/packages/server/src/app/api/open-project/route.ts",nextConfigOutput:"",userland:r}),{workAsyncStorage:d,workUnitAsyncStorage:g,serverHooks:m}=p;function f(){return(0,o.patchFetch)({workAsyncStorage:d,workUnitAsyncStorage:g})}},9021:e=>{"use strict";e.exports=require("fs")},9227:(e,s,t)=>{"use strict";e.exports=t(4870)},9294:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-async-storage.external.js")}};var s=require("../../../webpack-runtime.js");s.C(e);var t=e=>s(s.s=e),r=s.X(0,[131],()=>t(7144));module.exports=r})();
|