@taskmark/ui 0.2.2 → 0.2.5
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/README.md +23 -7
- package/app/api/taskmark-reload/route.ts +103 -0
- package/app/board/page.tsx +6 -4
- package/app/globals.css +17 -1
- package/app/layout.tsx +2 -0
- package/bin/lib/static-preview.mjs +110 -0
- package/bin/lib/watch-board-markdown.mjs +65 -0
- package/bin/taskmark.js +254 -46
- package/components/board/app-bar.tsx +31 -34
- package/components/board/board-dev-reloader.tsx +49 -0
- package/components/board/epic-list.tsx +2 -4
- package/components/board/markdown-content.tsx +1 -2
- package/components/board/overall-work-items-list.tsx +2 -1
- package/components/board/static-board-app.tsx +0 -1
- package/components/board/story-list.tsx +2 -1
- package/components/board/task-list.tsx +2 -1
- package/components/board/work-item-sheet.tsx +15 -2
- package/components/board/work-items-list.tsx +2 -2
- package/components/setup/setup-wizard.tsx +2 -6
- package/dist/prod-next/BUILD_ID +1 -0
- package/dist/{standalone/.next → prod-next}/app-path-routes-manifest.json +3 -2
- package/dist/{standalone/.next → prod-next}/build-manifest.json +3 -3
- package/dist/prod-next/export-marker.json +6 -0
- package/dist/prod-next/images-manifest.json +68 -0
- package/dist/prod-next/next-minimal-server.js.nft.json +1 -0
- package/dist/prod-next/next-server.js.nft.json +1 -0
- package/dist/{standalone/.next → prod-next}/prerender-manifest.json +3 -3
- package/dist/{standalone/.next → prod-next}/react-loadable-manifest.json +2 -2
- package/dist/prod-next/required-server-files.js +337 -0
- package/dist/{standalone/.next → prod-next}/required-server-files.json +0 -7
- package/dist/{standalone/.next → prod-next}/routes-manifest.json +6 -0
- package/dist/prod-next/server/app/_global-error/page.js +32 -0
- package/dist/prod-next/server/app/_global-error/page.js.nft.json +1 -0
- package/dist/prod-next/server/app/_global-error/page_client-reference-manifest.js +1 -0
- package/dist/{standalone/.next → prod-next}/server/app/_global-error.html +1 -1
- package/dist/{standalone/.next → prod-next}/server/app/_global-error.rsc +1 -1
- package/dist/{standalone/.next → prod-next}/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/{standalone/.next → prod-next}/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/dist/{standalone/.next → prod-next}/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/dist/{standalone/.next → prod-next}/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/{standalone/.next → prod-next}/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/{standalone/.next → prod-next}/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/prod-next/server/app/_not-found/page.js +2 -0
- package/dist/prod-next/server/app/_not-found/page.js.nft.json +1 -0
- package/dist/prod-next/server/app/_not-found/page_client-reference-manifest.js +1 -0
- package/dist/prod-next/server/app/_not-found.html +1 -0
- package/dist/prod-next/server/app/_not-found.rsc +21 -0
- package/dist/prod-next/server/app/_not-found.segments/_full.segment.rsc +21 -0
- package/dist/{standalone/.next → prod-next}/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dist/prod-next/server/app/_not-found.segments/_index.segment.rsc +8 -0
- package/dist/{standalone/.next → prod-next}/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/{standalone/.next → prod-next}/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/{standalone/.next → prod-next}/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/dist/prod-next/server/app/api/taskmark-reload/route.js +1 -0
- package/dist/prod-next/server/app/api/taskmark-reload/route.js.nft.json +1 -0
- package/dist/prod-next/server/app/api/taskmark-reload/route_client-reference-manifest.js +1 -0
- package/dist/prod-next/server/app/board/page.js +50 -0
- package/dist/prod-next/server/app/board/page.js.nft.json +1 -0
- package/dist/prod-next/server/app/board/page_client-reference-manifest.js +1 -0
- package/dist/{standalone/.next → prod-next}/server/app/favicon.ico/route.js +1 -1
- package/dist/prod-next/server/app/favicon.ico/route.js.nft.json +1 -0
- package/dist/prod-next/server/app/page.js +2 -0
- package/dist/prod-next/server/app/page.js.nft.json +1 -0
- package/dist/prod-next/server/app/page_client-reference-manifest.js +1 -0
- package/dist/prod-next/server/app/setup/page.js +2 -0
- package/dist/prod-next/server/app/setup/page.js.nft.json +1 -0
- package/dist/prod-next/server/app/setup/page_client-reference-manifest.js +1 -0
- package/dist/{standalone/.next → prod-next}/server/app-paths-manifest.json +3 -2
- package/dist/{standalone/.next → prod-next}/server/chunks/319.js +1 -1
- package/dist/{standalone/.next → prod-next}/server/chunks/490.js +1 -1
- package/dist/prod-next/server/chunks/57.js +19 -0
- package/dist/prod-next/server/chunks/616.js +1 -0
- package/dist/prod-next/server/chunks/708.js +1 -0
- package/dist/prod-next/server/chunks/724.js +1 -0
- package/dist/{standalone/.next/server/chunks/445.js → prod-next/server/chunks/741.js} +2 -2
- package/dist/prod-next/server/functions-config-manifest.json +6 -0
- package/dist/prod-next/server/interception-route-rewrite-manifest.js +1 -0
- package/dist/{standalone/.next → prod-next}/server/middleware-build-manifest.js +1 -1
- package/dist/prod-next/server/middleware-react-loadable-manifest.js +1 -0
- package/dist/prod-next/server/pages/404.html +1 -0
- package/dist/{standalone/.next → prod-next}/server/pages/500.html +1 -1
- package/dist/prod-next/server/server-reference-manifest.js +1 -0
- package/dist/prod-next/server/server-reference-manifest.json +1 -0
- package/dist/prod-next/static/chunks/51.e9139a9ea6eb36b9.js +1 -0
- package/dist/{standalone/.next/static/chunks/781-f9f201ddc8c8591a.js → prod-next/static/chunks/613-6f794154d28bb75a.js} +1 -1
- package/dist/prod-next/static/chunks/app/_global-error/page-d34451c04262dd7d.js +1 -0
- package/dist/prod-next/static/chunks/app/api/taskmark-reload/route-d34451c04262dd7d.js +1 -0
- package/dist/prod-next/static/chunks/app/board/page-cd1d9be0c0127225.js +1 -0
- package/dist/prod-next/static/chunks/app/layout-856e8a282e69e7d0.js +1 -0
- package/dist/prod-next/static/chunks/app/page-d34451c04262dd7d.js +1 -0
- package/dist/prod-next/static/chunks/app/setup/page-c3003359e8becc84.js +1 -0
- package/dist/prod-next/static/chunks/next/dist/client/components/builtin/app-error-d34451c04262dd7d.js +1 -0
- package/dist/prod-next/static/chunks/next/dist/client/components/builtin/forbidden-d34451c04262dd7d.js +1 -0
- package/dist/prod-next/static/chunks/next/dist/client/components/builtin/not-found-d34451c04262dd7d.js +1 -0
- package/dist/prod-next/static/chunks/next/dist/client/components/builtin/unauthorized-d34451c04262dd7d.js +1 -0
- package/dist/prod-next/static/chunks/webpack-bfe8992962004e2b.js +1 -0
- package/dist/prod-next/static/css/2e6ec4c80894e3c0.css +1 -0
- package/dist/prod-next/static/wbcgYS3Jw87KqhnA9ttOL/_buildManifest.js +1 -0
- package/dist/public/taskmark-snapshot.json +1 -0
- package/lib/display-path.ts +6 -0
- package/lib/taskmark/dev-reload-token.ts +5 -0
- package/lib/taskmark/project-label.ts +3 -2
- package/lib/taskmark/validate.ts +4 -4
- package/next.config.ts +3 -8
- package/package.json +6 -4
- package/public/taskmark-snapshot.json +1 -1
- package/scripts/build-static.mjs +10 -1
- package/scripts/prepare-standalone.mjs +53 -20
- package/dist/standalone/.next/BUILD_ID +0 -1
- package/dist/standalone/.next/server/app/_global-error/page.js +0 -32
- package/dist/standalone/.next/server/app/_global-error/page.js.nft.json +0 -1
- package/dist/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +0 -1
- package/dist/standalone/.next/server/app/_not-found/page.js +0 -2
- package/dist/standalone/.next/server/app/_not-found/page.js.nft.json +0 -1
- package/dist/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +0 -1
- package/dist/standalone/.next/server/app/_not-found.html +0 -1
- package/dist/standalone/.next/server/app/_not-found.rsc +0 -20
- package/dist/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +0 -20
- package/dist/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +0 -7
- package/dist/standalone/.next/server/app/board/page.js +0 -50
- package/dist/standalone/.next/server/app/board/page.js.nft.json +0 -1
- package/dist/standalone/.next/server/app/board/page_client-reference-manifest.js +0 -1
- package/dist/standalone/.next/server/app/favicon.ico/route.js.nft.json +0 -1
- package/dist/standalone/.next/server/app/page.js +0 -2
- package/dist/standalone/.next/server/app/page.js.nft.json +0 -1
- package/dist/standalone/.next/server/app/page_client-reference-manifest.js +0 -1
- package/dist/standalone/.next/server/app/setup/page.js +0 -2
- package/dist/standalone/.next/server/app/setup/page.js.nft.json +0 -1
- package/dist/standalone/.next/server/app/setup/page_client-reference-manifest.js +0 -1
- package/dist/standalone/.next/server/chunks/57.js +0 -19
- package/dist/standalone/.next/server/chunks/570.js +0 -1
- package/dist/standalone/.next/server/chunks/600.js +0 -1
- package/dist/standalone/.next/server/chunks/666.js +0 -1
- package/dist/standalone/.next/server/functions-config-manifest.json +0 -4
- package/dist/standalone/.next/server/middleware-react-loadable-manifest.js +0 -1
- package/dist/standalone/.next/server/pages/404.html +0 -1
- package/dist/standalone/.next/server/server-reference-manifest.js +0 -1
- package/dist/standalone/.next/server/server-reference-manifest.json +0 -1
- package/dist/standalone/.next/static/O83kNzYUmJlkfw7SS-SsU/_buildManifest.js +0 -1
- package/dist/standalone/.next/static/chunks/826.92750d8ed3a55429.js +0 -1
- package/dist/standalone/.next/static/chunks/app/_global-error/page-82d456ade9f47021.js +0 -1
- package/dist/standalone/.next/static/chunks/app/board/page-f609a854d76933c2.js +0 -1
- package/dist/standalone/.next/static/chunks/app/layout-3745e06d87691845.js +0 -1
- package/dist/standalone/.next/static/chunks/app/page-82d456ade9f47021.js +0 -1
- package/dist/standalone/.next/static/chunks/app/setup/page-acaffda2083bf4d0.js +0 -1
- package/dist/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-82d456ade9f47021.js +0 -1
- package/dist/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-82d456ade9f47021.js +0 -1
- package/dist/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-82d456ade9f47021.js +0 -1
- package/dist/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-82d456ade9f47021.js +0 -1
- package/dist/standalone/.next/static/chunks/webpack-f181688592aeb1f6.js +0 -1
- package/dist/standalone/.next/static/css/7af268deac5c5edb.css +0 -1
- package/dist/standalone/node_modules/next/dist/compiled/jest-worker/processChild.js +0 -1
- package/dist/standalone/node_modules/next/dist/compiled/jest-worker/threadChild.js +0 -1
- package/dist/standalone/node_modules/next/dist/server/lib/start-server.js +0 -494
- package/dist/standalone/node_modules/next/dist/server/next-server.js +0 -1429
- package/dist/standalone/node_modules/next/dist/server/next.js +0 -455
- package/dist/standalone/node_modules/next/dist/server/require-hook.js +0 -82
- package/dist/standalone/node_modules/next/dist/server/route-modules/app-page/module.compiled.js +0 -36
- package/dist/standalone/node_modules/next/dist/server/route-modules/pages/module.compiled.js +0 -20
- package/dist/standalone/node_modules/styled-jsx/index.js +0 -1
- package/dist/standalone/node_modules/styled-jsx/package.json +0 -132
- package/dist/standalone/node_modules/styled-jsx/style.js +0 -1
- package/dist/standalone/package.json +0 -76
- package/dist/standalone/public/taskmark-snapshot.json +0 -1
- package/dist/standalone/server.js +0 -44
- /package/dist/{standalone/.next → prod-next}/package.json +0 -0
- /package/dist/{standalone/.next → prod-next}/server/app/_global-error.meta +0 -0
- /package/dist/{standalone/.next → prod-next}/server/app/_not-found.meta +0 -0
- /package/dist/{standalone/.next → prod-next}/server/app/favicon.ico.body +0 -0
- /package/dist/{standalone/.next → prod-next}/server/app/favicon.ico.meta +0 -0
- /package/dist/{standalone/.next → prod-next}/server/chunks/318.js +0 -0
- /package/dist/{standalone/.next → prod-next}/server/middleware-manifest.json +0 -0
- /package/dist/{standalone/.next → prod-next}/server/next-font-manifest.js +0 -0
- /package/dist/{standalone/.next → prod-next}/server/next-font-manifest.json +0 -0
- /package/dist/{standalone/.next → prod-next}/server/pages-manifest.json +0 -0
- /package/dist/{standalone/.next → prod-next}/server/prefetch-hints.json +0 -0
- /package/dist/{standalone/.next → prod-next}/server/webpack-runtime.js +0 -0
- /package/dist/{standalone/.next → prod-next}/static/chunks/4bd1b696-deb4a0a1da1923b0.js +0 -0
- /package/dist/{standalone/.next → prod-next}/static/chunks/669-8103441c67b185da.js +0 -0
- /package/dist/{standalone/.next → prod-next}/static/chunks/701-df3ee5f1cf837b1a.js +0 -0
- /package/dist/{standalone/.next → prod-next}/static/chunks/794-25668765560cb197.js +0 -0
- /package/dist/{standalone/.next → prod-next}/static/chunks/app/_not-found/page-0b3785af737e7968.js +0 -0
- /package/dist/{standalone/.next → prod-next}/static/chunks/framework-b29f9083d3cda3b2.js +0 -0
- /package/dist/{standalone/.next → prod-next}/static/chunks/main-app-bfb36455d24b3e5a.js +0 -0
- /package/dist/{standalone/.next → prod-next}/static/chunks/main-bb33c46a9c25dee8.js +0 -0
- /package/dist/{standalone/.next → prod-next}/static/chunks/next/dist/client/components/builtin/global-error-dc53ab29e0491fe4.js +0 -0
- /package/dist/{standalone/.next → prod-next}/static/chunks/polyfills-42372ed130431b0a.js +0 -0
- /package/dist/{standalone/.next → prod-next}/static/css/c593627ceef17a4b.css +0 -0
- /package/dist/{standalone/.next → prod-next}/static/media/36966cca54120369-s.p.woff2 +0 -0
- /package/dist/{standalone/.next → prod-next}/static/media/982ceffe7b733b3b-s.p.woff2 +0 -0
- /package/dist/{standalone/.next → prod-next}/static/media/b7387a63dd068245-s.woff2 +0 -0
- /package/dist/{standalone/.next → prod-next}/static/media/b8bfb68ab9ab617c-s.woff2 +0 -0
- /package/dist/{standalone/.next → prod-next}/static/media/e1aab0933260df4d-s.woff2 +0 -0
- /package/dist/{standalone/.next/static/O83kNzYUmJlkfw7SS-SsU → prod-next/static/wbcgYS3Jw87KqhnA9ttOL}/_ssgManifest.js +0 -0
- /package/dist/{standalone/public → public}/apple-touch-icon.png +0 -0
- /package/dist/{standalone/public → public}/favicon-96x96.png +0 -0
- /package/dist/{standalone/public → public}/favicon.ico +0 -0
- /package/dist/{standalone/public → public}/favicon.svg +0 -0
- /package/dist/{standalone/public → public}/file.svg +0 -0
- /package/dist/{standalone/public → public}/globe.svg +0 -0
- /package/dist/{standalone/public → public}/next.svg +0 -0
- /package/dist/{standalone/public → public}/og/og-default.png +0 -0
- /package/dist/{standalone/public → public}/site.webmanifest +0 -0
- /package/dist/{standalone/public → public}/tm_dark.png +0 -0
- /package/dist/{standalone/public → public}/tm_light.png +0 -0
- /package/dist/{standalone/public → public}/vercel.svg +0 -0
- /package/dist/{standalone/public → public}/web-app-manifest-192x192.png +0 -0
- /package/dist/{standalone/public → public}/web-app-manifest-512x512.png +0 -0
- /package/dist/{standalone/public → public}/window.svg +0 -0
|
@@ -1,494 +0,0 @@
|
|
|
1
|
-
// Start CPU profile if it wasn't already started.
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
0 && (module.exports = {
|
|
7
|
-
getRequestHandlers: null,
|
|
8
|
-
startServer: null
|
|
9
|
-
});
|
|
10
|
-
function _export(target, all) {
|
|
11
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: all[name]
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
_export(exports, {
|
|
17
|
-
getRequestHandlers: function() {
|
|
18
|
-
return getRequestHandlers;
|
|
19
|
-
},
|
|
20
|
-
startServer: function() {
|
|
21
|
-
return startServer;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
require("./cpu-profile");
|
|
25
|
-
const _getnetworkhost = require("../../lib/get-network-host");
|
|
26
|
-
require("../next");
|
|
27
|
-
require("../require-hook");
|
|
28
|
-
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
|
29
|
-
const _v8 = /*#__PURE__*/ _interop_require_default(require("v8"));
|
|
30
|
-
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
31
|
-
const _http = /*#__PURE__*/ _interop_require_default(require("http"));
|
|
32
|
-
const _https = /*#__PURE__*/ _interop_require_default(require("https"));
|
|
33
|
-
const _os = /*#__PURE__*/ _interop_require_default(require("os"));
|
|
34
|
-
const _child_process = require("child_process");
|
|
35
|
-
const _watchpack = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/watchpack"));
|
|
36
|
-
const _log = /*#__PURE__*/ _interop_require_wildcard(require("../../build/output/log"));
|
|
37
|
-
const _debug = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/debug"));
|
|
38
|
-
const _utils = require("./utils");
|
|
39
|
-
const _formathostname = require("./format-hostname");
|
|
40
|
-
const _routerserver = require("./router-server");
|
|
41
|
-
const _constants = require("../../shared/lib/constants");
|
|
42
|
-
const _appinfolog = require("./app-info-log");
|
|
43
|
-
const _turbopackwarning = require("../../lib/turbopack-warning");
|
|
44
|
-
const _trace = require("../../trace");
|
|
45
|
-
const _isipv6 = require("./is-ipv6");
|
|
46
|
-
const _asynccallbackset = require("./async-callback-set");
|
|
47
|
-
const _durationtostring = require("../../build/duration-to-string");
|
|
48
|
-
function _interop_require_default(obj) {
|
|
49
|
-
return obj && obj.__esModule ? obj : {
|
|
50
|
-
default: obj
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
function _getRequireWildcardCache(nodeInterop) {
|
|
54
|
-
if (typeof WeakMap !== "function") return null;
|
|
55
|
-
var cacheBabelInterop = new WeakMap();
|
|
56
|
-
var cacheNodeInterop = new WeakMap();
|
|
57
|
-
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
58
|
-
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
59
|
-
})(nodeInterop);
|
|
60
|
-
}
|
|
61
|
-
function _interop_require_wildcard(obj, nodeInterop) {
|
|
62
|
-
if (!nodeInterop && obj && obj.__esModule) {
|
|
63
|
-
return obj;
|
|
64
|
-
}
|
|
65
|
-
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
66
|
-
return {
|
|
67
|
-
default: obj
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
var cache = _getRequireWildcardCache(nodeInterop);
|
|
71
|
-
if (cache && cache.has(obj)) {
|
|
72
|
-
return cache.get(obj);
|
|
73
|
-
}
|
|
74
|
-
var newObj = {
|
|
75
|
-
__proto__: null
|
|
76
|
-
};
|
|
77
|
-
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
78
|
-
for(var key in obj){
|
|
79
|
-
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
80
|
-
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
81
|
-
if (desc && (desc.get || desc.set)) {
|
|
82
|
-
Object.defineProperty(newObj, key, desc);
|
|
83
|
-
} else {
|
|
84
|
-
newObj[key] = obj[key];
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
newObj.default = obj;
|
|
89
|
-
if (cache) {
|
|
90
|
-
cache.set(obj, newObj);
|
|
91
|
-
}
|
|
92
|
-
return newObj;
|
|
93
|
-
}
|
|
94
|
-
const debug = (0, _debug.default)('next:start-server');
|
|
95
|
-
let startServerSpan;
|
|
96
|
-
/**
|
|
97
|
-
* Get the process ID (PID) of the process using the specified port
|
|
98
|
-
*/ async function getProcessIdUsingPort(port) {
|
|
99
|
-
const timeoutMs = 250;
|
|
100
|
-
const processLookupController = new AbortController();
|
|
101
|
-
const pidPromise = new Promise((resolve)=>{
|
|
102
|
-
const handleError = (error)=>{
|
|
103
|
-
debug('Failed to get process ID for port', port, error);
|
|
104
|
-
resolve(null);
|
|
105
|
-
};
|
|
106
|
-
try {
|
|
107
|
-
// Use lsof on Unix-like systems (macOS, Linux)
|
|
108
|
-
if (process.platform !== 'win32') {
|
|
109
|
-
(0, _child_process.exec)(`lsof -ti:${port} -sTCP:LISTEN`, {
|
|
110
|
-
signal: processLookupController.signal
|
|
111
|
-
}, (error, stdout)=>{
|
|
112
|
-
if (error) {
|
|
113
|
-
handleError(error);
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
// `-sTCP` will ensure there's only one port, clean up output
|
|
117
|
-
const pid = stdout.trim();
|
|
118
|
-
resolve(pid || null);
|
|
119
|
-
});
|
|
120
|
-
} else {
|
|
121
|
-
// Use netstat on Windows
|
|
122
|
-
(0, _child_process.exec)(`netstat -ano | findstr /C:":${port} " | findstr LISTENING`, {
|
|
123
|
-
signal: processLookupController.signal
|
|
124
|
-
}, (error, stdout)=>{
|
|
125
|
-
if (error) {
|
|
126
|
-
handleError(error);
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
// Clean up output and extract PID
|
|
130
|
-
const cleanOutput = stdout.replace(/\s+/g, ' ').trim();
|
|
131
|
-
if (cleanOutput) {
|
|
132
|
-
const lines = cleanOutput.split('\n');
|
|
133
|
-
const firstLine = lines[0].trim();
|
|
134
|
-
if (firstLine) {
|
|
135
|
-
const parts = firstLine.split(' ');
|
|
136
|
-
const pid = parts[parts.length - 1];
|
|
137
|
-
resolve(pid || null);
|
|
138
|
-
} else {
|
|
139
|
-
resolve(null);
|
|
140
|
-
}
|
|
141
|
-
} else {
|
|
142
|
-
resolve(null);
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
} catch (cause) {
|
|
147
|
-
handleError(Object.defineProperty(new Error('Unexpected error during process lookup', {
|
|
148
|
-
cause
|
|
149
|
-
}), "__NEXT_ERROR_CODE", {
|
|
150
|
-
value: "E713",
|
|
151
|
-
enumerable: false,
|
|
152
|
-
configurable: true
|
|
153
|
-
}));
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
const timeoutId = setTimeout(()=>{
|
|
157
|
-
processLookupController.abort(`PID detection timed out after ${timeoutMs}ms for port ${port}.`);
|
|
158
|
-
}, timeoutMs);
|
|
159
|
-
pidPromise.finally(()=>clearTimeout(timeoutId));
|
|
160
|
-
return pidPromise;
|
|
161
|
-
}
|
|
162
|
-
async function getRequestHandlers({ dir, port, isDev, onDevServerCleanup, server, hostname, minimalMode, keepAliveTimeout, experimentalHttpsServer, serverFastRefresh, quiet }) {
|
|
163
|
-
return (0, _routerserver.initialize)({
|
|
164
|
-
dir,
|
|
165
|
-
port,
|
|
166
|
-
hostname,
|
|
167
|
-
onDevServerCleanup,
|
|
168
|
-
dev: isDev,
|
|
169
|
-
minimalMode,
|
|
170
|
-
server,
|
|
171
|
-
keepAliveTimeout,
|
|
172
|
-
experimentalHttpsServer,
|
|
173
|
-
serverFastRefresh,
|
|
174
|
-
startServerSpan,
|
|
175
|
-
quiet
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
async function startServer(serverOptions) {
|
|
179
|
-
const { dir, isDev, hostname, minimalMode, allowRetry, keepAliveTimeout, selfSignedCertificate, serverFastRefresh } = serverOptions;
|
|
180
|
-
let { port } = serverOptions;
|
|
181
|
-
process.title = `next-server (v${"16.2.10"})`;
|
|
182
|
-
let handlersReady = ()=>{};
|
|
183
|
-
let handlersError = ()=>{};
|
|
184
|
-
let handlersPromise = new Promise((resolve, reject)=>{
|
|
185
|
-
handlersReady = resolve;
|
|
186
|
-
handlersError = reject;
|
|
187
|
-
});
|
|
188
|
-
let requestHandler = async (req, res)=>{
|
|
189
|
-
if (handlersPromise) {
|
|
190
|
-
await handlersPromise;
|
|
191
|
-
return requestHandler(req, res);
|
|
192
|
-
}
|
|
193
|
-
throw Object.defineProperty(new Error('Invariant request handler was not setup'), "__NEXT_ERROR_CODE", {
|
|
194
|
-
value: "E287",
|
|
195
|
-
enumerable: false,
|
|
196
|
-
configurable: true
|
|
197
|
-
});
|
|
198
|
-
};
|
|
199
|
-
let upgradeHandler = async (req, socket, head)=>{
|
|
200
|
-
if (handlersPromise) {
|
|
201
|
-
await handlersPromise;
|
|
202
|
-
return upgradeHandler(req, socket, head);
|
|
203
|
-
}
|
|
204
|
-
throw Object.defineProperty(new Error('Invariant upgrade handler was not setup'), "__NEXT_ERROR_CODE", {
|
|
205
|
-
value: "E290",
|
|
206
|
-
enumerable: false,
|
|
207
|
-
configurable: true
|
|
208
|
-
});
|
|
209
|
-
};
|
|
210
|
-
let nextServer;
|
|
211
|
-
// setup server listener as fast as possible
|
|
212
|
-
if (selfSignedCertificate && !isDev) {
|
|
213
|
-
throw Object.defineProperty(new Error('Using a self signed certificate is only supported with `next dev`.'), "__NEXT_ERROR_CODE", {
|
|
214
|
-
value: "E128",
|
|
215
|
-
enumerable: false,
|
|
216
|
-
configurable: true
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
async function requestListener(req, res) {
|
|
220
|
-
try {
|
|
221
|
-
if (handlersPromise) {
|
|
222
|
-
await handlersPromise;
|
|
223
|
-
handlersPromise = undefined;
|
|
224
|
-
}
|
|
225
|
-
await requestHandler(req, res);
|
|
226
|
-
} catch (err) {
|
|
227
|
-
res.statusCode = 500;
|
|
228
|
-
res.end('Internal Server Error');
|
|
229
|
-
_log.error(`Failed to handle request for ${req.url}`);
|
|
230
|
-
console.error(err);
|
|
231
|
-
} finally{
|
|
232
|
-
if (isDev) {
|
|
233
|
-
if (_v8.default.getHeapStatistics().used_heap_size > 0.8 * _v8.default.getHeapStatistics().heap_size_limit) {
|
|
234
|
-
_log.warn(`Server is approaching the used memory threshold, restarting...`);
|
|
235
|
-
(0, _trace.trace)('server-restart-close-to-memory-threshold', undefined, {
|
|
236
|
-
'memory.heapSizeLimit': String(_v8.default.getHeapStatistics().heap_size_limit),
|
|
237
|
-
'memory.heapUsed': String(_v8.default.getHeapStatistics().used_heap_size)
|
|
238
|
-
}).stop();
|
|
239
|
-
await (0, _trace.flushAllTraces)();
|
|
240
|
-
process.exit(_utils.RESTART_EXIT_CODE);
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
const server = selfSignedCertificate ? _https.default.createServer({
|
|
246
|
-
key: _fs.default.readFileSync(selfSignedCertificate.key),
|
|
247
|
-
cert: _fs.default.readFileSync(selfSignedCertificate.cert)
|
|
248
|
-
}, requestListener) : _http.default.createServer(requestListener);
|
|
249
|
-
if (keepAliveTimeout) {
|
|
250
|
-
server.keepAliveTimeout = keepAliveTimeout;
|
|
251
|
-
}
|
|
252
|
-
server.on('upgrade', async (req, socket, head)=>{
|
|
253
|
-
try {
|
|
254
|
-
await upgradeHandler(req, socket, head);
|
|
255
|
-
} catch (err) {
|
|
256
|
-
socket.destroy();
|
|
257
|
-
_log.error(`Failed to handle request for ${req.url}`);
|
|
258
|
-
console.error(err);
|
|
259
|
-
}
|
|
260
|
-
});
|
|
261
|
-
let portRetryCount = 0;
|
|
262
|
-
const originalPort = port;
|
|
263
|
-
server.on('error', (err)=>{
|
|
264
|
-
if (allowRetry && port && isDev && err.code === 'EADDRINUSE' && portRetryCount < 10) {
|
|
265
|
-
port += 1;
|
|
266
|
-
portRetryCount += 1;
|
|
267
|
-
server.listen(port, hostname);
|
|
268
|
-
} else {
|
|
269
|
-
_log.error(`Failed to start server`);
|
|
270
|
-
console.error(err);
|
|
271
|
-
process.exit(1);
|
|
272
|
-
}
|
|
273
|
-
});
|
|
274
|
-
let cleanupListeners = isDev ? new _asynccallbackset.AsyncCallbackSet() : undefined;
|
|
275
|
-
const distDir = await new Promise((resolve)=>{
|
|
276
|
-
server.on('listening', async ()=>{
|
|
277
|
-
const addr = server.address();
|
|
278
|
-
const actualHostname = (0, _formathostname.formatHostname)(typeof addr === 'object' ? (addr == null ? void 0 : addr.address) || hostname || 'localhost' : addr);
|
|
279
|
-
const formattedHostname = !hostname || actualHostname === '0.0.0.0' ? 'localhost' : actualHostname === '[::]' ? '[::1]' : (0, _formathostname.formatHostname)(hostname);
|
|
280
|
-
port = typeof addr === 'object' ? (addr == null ? void 0 : addr.port) || port : port;
|
|
281
|
-
if (portRetryCount) {
|
|
282
|
-
const pid = await getProcessIdUsingPort(originalPort);
|
|
283
|
-
if (pid) {
|
|
284
|
-
_log.warn(`Port ${originalPort} is in use by process ${pid}, using available port ${port} instead.`);
|
|
285
|
-
} else {
|
|
286
|
-
_log.warn(`Port ${originalPort} is in use by an unknown process, using available port ${port} instead.`);
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
const networkHostname = hostname ?? (0, _getnetworkhost.getNetworkHost)((0, _isipv6.isIPv6)(actualHostname) ? 'IPv6' : 'IPv4');
|
|
290
|
-
const protocol = selfSignedCertificate ? 'https' : 'http';
|
|
291
|
-
const networkUrl = networkHostname ? `${protocol}://${(0, _formathostname.formatHostname)(networkHostname)}:${port}` : null;
|
|
292
|
-
const appUrl = `${protocol}://${formattedHostname}:${port}`;
|
|
293
|
-
// Store the selected port to:
|
|
294
|
-
// - expose it to render workers
|
|
295
|
-
// - re-use it for automatic dev server restarts with a randomly selected port
|
|
296
|
-
process.env.PORT = port + '';
|
|
297
|
-
process.env.__NEXT_PRIVATE_ORIGIN = appUrl;
|
|
298
|
-
// Set experimental HTTPS flag for metadata resolution
|
|
299
|
-
if (selfSignedCertificate) {
|
|
300
|
-
process.env.__NEXT_EXPERIMENTAL_HTTPS = '1';
|
|
301
|
-
}
|
|
302
|
-
// Get env info first (fast, doesn't require config)
|
|
303
|
-
const envInfo = isDev ? (0, _appinfolog.getEnvInfo)(dir) : undefined;
|
|
304
|
-
// Log basic startup info immediately (before loading config)
|
|
305
|
-
(0, _appinfolog.logStartInfo)({
|
|
306
|
-
networkUrl,
|
|
307
|
-
appUrl,
|
|
308
|
-
envInfo,
|
|
309
|
-
logBundler: isDev
|
|
310
|
-
});
|
|
311
|
-
// Calculate and log "Ready in X" before loading config
|
|
312
|
-
// so it reflects actual framework startup time.
|
|
313
|
-
// NEXT_PRIVATE_START_TIME is set by bin/next.ts or cli/next-start.ts.
|
|
314
|
-
const startTime = parseInt(process.env.NEXT_PRIVATE_START_TIME || '0', 10);
|
|
315
|
-
const endTime = Date.now();
|
|
316
|
-
const startServerProcessDurationMs = startTime ? endTime - startTime : 0;
|
|
317
|
-
const formattedStartDuration = (0, _durationtostring.durationToString)(startServerProcessDurationMs / 1000);
|
|
318
|
-
_log.event(`Ready in ${formattedStartDuration}`);
|
|
319
|
-
try {
|
|
320
|
-
let cleanupStarted = false;
|
|
321
|
-
let closeUpgraded = null;
|
|
322
|
-
const cleanup = (signal)=>{
|
|
323
|
-
if (cleanupStarted) {
|
|
324
|
-
// We can get duplicate signals, e.g. when `ctrl+c` is used in an
|
|
325
|
-
// interactive shell (i.e. bash, zsh), the shell will recursively
|
|
326
|
-
// send SIGINT to children. The parent `next-dev` process will also
|
|
327
|
-
// send us SIGINT.
|
|
328
|
-
return;
|
|
329
|
-
}
|
|
330
|
-
cleanupStarted = true;
|
|
331
|
-
(async ()=>{
|
|
332
|
-
debug('start-server process cleanup');
|
|
333
|
-
// first, stop accepting new connections and finish pending requests,
|
|
334
|
-
// because they might affect `nextServer.close()` (e.g. by scheduling an `after`)
|
|
335
|
-
await new Promise((res)=>{
|
|
336
|
-
server.close((err)=>{
|
|
337
|
-
if (err) console.error(err);
|
|
338
|
-
res();
|
|
339
|
-
});
|
|
340
|
-
if (isDev) {
|
|
341
|
-
server.closeAllConnections();
|
|
342
|
-
closeUpgraded == null ? void 0 : closeUpgraded();
|
|
343
|
-
}
|
|
344
|
-
});
|
|
345
|
-
// now that no new requests can come in, clean up the rest
|
|
346
|
-
await Promise.all([
|
|
347
|
-
nextServer == null ? void 0 : nextServer.close().catch(console.error),
|
|
348
|
-
cleanupListeners == null ? void 0 : cleanupListeners.runAll().catch(console.error)
|
|
349
|
-
]);
|
|
350
|
-
// Flush any remaining traces to the trace file on shutdown
|
|
351
|
-
await (0, _trace.flushAllTraces)();
|
|
352
|
-
// Flush telemetry if this is a dev server
|
|
353
|
-
if (isDev) {
|
|
354
|
-
try {
|
|
355
|
-
const { traceGlobals } = require('../../trace/shared');
|
|
356
|
-
const telemetry = traceGlobals.get('telemetry');
|
|
357
|
-
if (telemetry) {
|
|
358
|
-
// Use flushDetached to avoid blocking process exit
|
|
359
|
-
// Each process writes to a unique file (_events_${pid}.json)
|
|
360
|
-
// to avoid race conditions with the parent process
|
|
361
|
-
telemetry.flushDetached('dev', dir);
|
|
362
|
-
}
|
|
363
|
-
} catch (_) {
|
|
364
|
-
// Ignore telemetry errors during cleanup
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
debug('start-server process cleanup finished');
|
|
368
|
-
// Exit with signal-based exit code (128 + signal number) so that
|
|
369
|
-
// Node.js treats this as a signal termination, not a normal exit.
|
|
370
|
-
// This avoids waiting for the debugger to disconnect.
|
|
371
|
-
switch(signal){
|
|
372
|
-
case 'SIGINT':
|
|
373
|
-
process.exit(130);
|
|
374
|
-
break;
|
|
375
|
-
case 'SIGTERM':
|
|
376
|
-
process.exit(143);
|
|
377
|
-
break;
|
|
378
|
-
default:
|
|
379
|
-
// Make sure all handled signals have explicit exit codes.
|
|
380
|
-
// This is just a fallback to guard against unsound types.
|
|
381
|
-
signal;
|
|
382
|
-
process.exit(128);
|
|
383
|
-
}
|
|
384
|
-
})();
|
|
385
|
-
};
|
|
386
|
-
// Make sure commands gracefully respect termination signals (e.g. from Docker)
|
|
387
|
-
// Allow the graceful termination to be manually configurable
|
|
388
|
-
if (!process.env.NEXT_MANUAL_SIG_HANDLE) {
|
|
389
|
-
process.on('SIGINT', cleanup);
|
|
390
|
-
process.on('SIGTERM', cleanup);
|
|
391
|
-
}
|
|
392
|
-
// Now load config via getRequestHandlers (single loadConfig call)
|
|
393
|
-
const initResult = await getRequestHandlers({
|
|
394
|
-
dir,
|
|
395
|
-
port,
|
|
396
|
-
isDev,
|
|
397
|
-
onDevServerCleanup: cleanupListeners ? cleanupListeners.add.bind(cleanupListeners) : undefined,
|
|
398
|
-
server,
|
|
399
|
-
hostname,
|
|
400
|
-
minimalMode,
|
|
401
|
-
keepAliveTimeout,
|
|
402
|
-
experimentalHttpsServer: !!selfSignedCertificate,
|
|
403
|
-
serverFastRefresh
|
|
404
|
-
});
|
|
405
|
-
requestHandler = initResult.requestHandler;
|
|
406
|
-
upgradeHandler = initResult.upgradeHandler;
|
|
407
|
-
nextServer = initResult.server;
|
|
408
|
-
closeUpgraded = initResult.closeUpgraded;
|
|
409
|
-
// Log experimental features after config is loaded
|
|
410
|
-
if (isDev) {
|
|
411
|
-
(0, _appinfolog.logExperimentalInfo)({
|
|
412
|
-
experimentalFeatures: initResult.experimentalFeatures,
|
|
413
|
-
cacheComponents: initResult.cacheComponents
|
|
414
|
-
});
|
|
415
|
-
}
|
|
416
|
-
handlersReady();
|
|
417
|
-
if (process.env.TURBOPACK && isDev) {
|
|
418
|
-
await (0, _turbopackwarning.validateTurboNextConfig)({
|
|
419
|
-
dir: serverOptions.dir,
|
|
420
|
-
configPhase: _constants.PHASE_DEVELOPMENT_SERVER
|
|
421
|
-
});
|
|
422
|
-
}
|
|
423
|
-
resolve(initResult.distDir);
|
|
424
|
-
} catch (err) {
|
|
425
|
-
// fatal error if we can't setup
|
|
426
|
-
handlersError();
|
|
427
|
-
console.error(err);
|
|
428
|
-
process.exit(1);
|
|
429
|
-
}
|
|
430
|
-
});
|
|
431
|
-
server.listen(port, hostname);
|
|
432
|
-
});
|
|
433
|
-
if (isDev) {
|
|
434
|
-
function watchConfigFiles(dirToWatch, onChange) {
|
|
435
|
-
const wp = new _watchpack.default();
|
|
436
|
-
wp.watch({
|
|
437
|
-
files: _constants.CONFIG_FILES.map((file)=>_path.default.join(dirToWatch, file))
|
|
438
|
-
});
|
|
439
|
-
wp.on('change', onChange);
|
|
440
|
-
}
|
|
441
|
-
watchConfigFiles(dir, async (filename)=>{
|
|
442
|
-
if (process.env.__NEXT_DISABLE_MEMORY_WATCHER) {
|
|
443
|
-
_log.info(`Detected change, manual restart required due to '__NEXT_DISABLE_MEMORY_WATCHER' usage`);
|
|
444
|
-
return;
|
|
445
|
-
}
|
|
446
|
-
_log.warn(`Found a change in ${_path.default.basename(filename)}. Restarting the server to apply the changes...`);
|
|
447
|
-
process.exit(_utils.RESTART_EXIT_CODE);
|
|
448
|
-
});
|
|
449
|
-
}
|
|
450
|
-
return {
|
|
451
|
-
distDir
|
|
452
|
-
};
|
|
453
|
-
}
|
|
454
|
-
if (process.env.NEXT_PRIVATE_WORKER && process.send) {
|
|
455
|
-
process.addListener('message', async (msg)=>{
|
|
456
|
-
if (msg && typeof msg === 'object' && msg.nextWorkerOptions && process.send) {
|
|
457
|
-
let enabledFeaturesFromParent = {};
|
|
458
|
-
if (process.env.NEXT_PRIVATE_ENABLED_FEATURES) {
|
|
459
|
-
const parsed = JSON.parse(process.env.NEXT_PRIVATE_ENABLED_FEATURES);
|
|
460
|
-
enabledFeaturesFromParent = Object.fromEntries(Object.entries(parsed).map(([key, value])=>[
|
|
461
|
-
`feature.${key}`,
|
|
462
|
-
value
|
|
463
|
-
]));
|
|
464
|
-
}
|
|
465
|
-
startServerSpan = (0, _trace.trace)('start-dev-server', undefined, {
|
|
466
|
-
cpus: String(_os.default.cpus().length),
|
|
467
|
-
platform: _os.default.platform(),
|
|
468
|
-
'memory.freeMem': String(_os.default.freemem()),
|
|
469
|
-
'memory.totalMem': String(_os.default.totalmem()),
|
|
470
|
-
'memory.heapSizeLimit': String(_v8.default.getHeapStatistics().heap_size_limit),
|
|
471
|
-
...enabledFeaturesFromParent
|
|
472
|
-
});
|
|
473
|
-
(0, _trace.initializeTraceState)({
|
|
474
|
-
...(0, _trace.exportTraceState)(),
|
|
475
|
-
defaultParentSpanId: startServerSpan.getId()
|
|
476
|
-
});
|
|
477
|
-
const result = await startServerSpan.traceAsyncFn(()=>startServer(msg.nextWorkerOptions));
|
|
478
|
-
const memoryUsage = process.memoryUsage();
|
|
479
|
-
startServerSpan.setAttribute('memory.rss', String(memoryUsage.rss));
|
|
480
|
-
startServerSpan.setAttribute('memory.heapTotal', String(memoryUsage.heapTotal));
|
|
481
|
-
startServerSpan.setAttribute('memory.heapUsed', String(memoryUsage.heapUsed));
|
|
482
|
-
process.send({
|
|
483
|
-
nextServerReady: true,
|
|
484
|
-
port: process.env.PORT,
|
|
485
|
-
distDir: result.distDir
|
|
486
|
-
});
|
|
487
|
-
}
|
|
488
|
-
});
|
|
489
|
-
process.send({
|
|
490
|
-
nextWorkerReady: true
|
|
491
|
-
});
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
//# sourceMappingURL=start-server.js.map
|