Initial boiler plate project
This commit is contained in:
20
node_modules/next/dist/build/output/index.d.ts
generated
vendored
Normal file
20
node_modules/next/dist/build/output/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
import type { webpack } from 'next/dist/compiled/webpack/webpack';
|
||||
export declare function startedDevelopmentServer(appUrl: string, bindAddr: string): void;
|
||||
type AmpStatus = {
|
||||
message: string;
|
||||
line: number;
|
||||
col: number;
|
||||
specUrl: string | null;
|
||||
code: string;
|
||||
};
|
||||
export type AmpPageStatus = {
|
||||
[page: string]: {
|
||||
errors: AmpStatus[];
|
||||
warnings: AmpStatus[];
|
||||
};
|
||||
};
|
||||
export declare function formatAmpMessages(amp: AmpPageStatus): string;
|
||||
export declare function ampValidation(page: string, errors: AmpStatus[], warnings: AmpStatus[]): void;
|
||||
export declare function watchCompilers(client: webpack.Compiler, server: webpack.Compiler, edgeServer: webpack.Compiler): void;
|
||||
export declare function reportTrigger(trigger: string, url?: string): void;
|
||||
export {};
|
||||
295
node_modules/next/dist/build/output/index.js
generated
vendored
Normal file
295
node_modules/next/dist/build/output/index.js
generated
vendored
Normal file
@ -0,0 +1,295 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
ampValidation: null,
|
||||
formatAmpMessages: null,
|
||||
reportTrigger: null,
|
||||
startedDevelopmentServer: null,
|
||||
watchCompilers: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
ampValidation: function() {
|
||||
return ampValidation;
|
||||
},
|
||||
formatAmpMessages: function() {
|
||||
return formatAmpMessages;
|
||||
},
|
||||
reportTrigger: function() {
|
||||
return reportTrigger;
|
||||
},
|
||||
startedDevelopmentServer: function() {
|
||||
return startedDevelopmentServer;
|
||||
},
|
||||
watchCompilers: function() {
|
||||
return watchCompilers;
|
||||
}
|
||||
});
|
||||
const _picocolors = require("../../lib/picocolors");
|
||||
const _stripansi = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/strip-ansi"));
|
||||
const _texttable = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/text-table"));
|
||||
const _unistore = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/unistore"));
|
||||
const _formatwebpackmessages = /*#__PURE__*/ _interop_require_default(require("../../client/components/react-dev-overlay/internal/helpers/format-webpack-messages"));
|
||||
const _store = require("./store");
|
||||
const _constants = require("../../shared/lib/constants");
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function startedDevelopmentServer(appUrl, bindAddr) {
|
||||
_store.store.setState({
|
||||
appUrl,
|
||||
bindAddr
|
||||
});
|
||||
}
|
||||
function formatAmpMessages(amp) {
|
||||
let output = (0, _picocolors.bold)("Amp Validation") + "\n\n";
|
||||
let messages = [];
|
||||
const chalkError = (0, _picocolors.red)("error");
|
||||
function ampError(page, error) {
|
||||
messages.push([
|
||||
page,
|
||||
chalkError,
|
||||
error.message,
|
||||
error.specUrl || ""
|
||||
]);
|
||||
}
|
||||
const chalkWarn = (0, _picocolors.yellow)("warn");
|
||||
function ampWarn(page, warn) {
|
||||
messages.push([
|
||||
page,
|
||||
chalkWarn,
|
||||
warn.message,
|
||||
warn.specUrl || ""
|
||||
]);
|
||||
}
|
||||
for(const page in amp){
|
||||
let { errors, warnings } = amp[page];
|
||||
const devOnlyFilter = (err)=>err.code !== "DEV_MODE_ONLY";
|
||||
errors = errors.filter(devOnlyFilter);
|
||||
warnings = warnings.filter(devOnlyFilter);
|
||||
if (!(errors.length || warnings.length)) {
|
||||
continue;
|
||||
}
|
||||
if (errors.length) {
|
||||
ampError(page, errors[0]);
|
||||
for(let index = 1; index < errors.length; ++index){
|
||||
ampError("", errors[index]);
|
||||
}
|
||||
}
|
||||
if (warnings.length) {
|
||||
ampWarn(errors.length ? "" : page, warnings[0]);
|
||||
for(let index = 1; index < warnings.length; ++index){
|
||||
ampWarn("", warnings[index]);
|
||||
}
|
||||
}
|
||||
messages.push([
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
""
|
||||
]);
|
||||
}
|
||||
if (!messages.length) {
|
||||
return "";
|
||||
}
|
||||
output += (0, _texttable.default)(messages, {
|
||||
align: [
|
||||
"l",
|
||||
"l",
|
||||
"l",
|
||||
"l"
|
||||
],
|
||||
stringLength (str) {
|
||||
return (0, _stripansi.default)(str).length;
|
||||
}
|
||||
});
|
||||
return output;
|
||||
}
|
||||
const buildStore = (0, _unistore.default)({
|
||||
// @ts-expect-error initial value
|
||||
client: {},
|
||||
// @ts-expect-error initial value
|
||||
server: {},
|
||||
// @ts-expect-error initial value
|
||||
edgeServer: {}
|
||||
});
|
||||
let buildWasDone = false;
|
||||
let clientWasLoading = true;
|
||||
let serverWasLoading = true;
|
||||
let edgeServerWasLoading = false;
|
||||
buildStore.subscribe((state)=>{
|
||||
const { amp, client, server, edgeServer, trigger, url } = state;
|
||||
const { appUrl } = _store.store.getState();
|
||||
if (client.loading || server.loading || (edgeServer == null ? void 0 : edgeServer.loading)) {
|
||||
_store.store.setState({
|
||||
bootstrap: false,
|
||||
appUrl: appUrl,
|
||||
// If it takes more than 3 seconds to compile, mark it as loading status
|
||||
loading: true,
|
||||
trigger,
|
||||
url
|
||||
}, true);
|
||||
clientWasLoading = !buildWasDone && clientWasLoading || client.loading;
|
||||
serverWasLoading = !buildWasDone && serverWasLoading || server.loading;
|
||||
edgeServerWasLoading = !buildWasDone && edgeServerWasLoading || edgeServer.loading;
|
||||
buildWasDone = false;
|
||||
return;
|
||||
}
|
||||
buildWasDone = true;
|
||||
let partialState = {
|
||||
bootstrap: false,
|
||||
appUrl: appUrl,
|
||||
loading: false,
|
||||
typeChecking: false,
|
||||
totalModulesCount: (clientWasLoading ? client.totalModulesCount : 0) + (serverWasLoading ? server.totalModulesCount : 0) + (edgeServerWasLoading ? (edgeServer == null ? void 0 : edgeServer.totalModulesCount) || 0 : 0),
|
||||
hasEdgeServer: !!edgeServer
|
||||
};
|
||||
if (client.errors && clientWasLoading) {
|
||||
// Show only client errors
|
||||
_store.store.setState({
|
||||
...partialState,
|
||||
errors: client.errors,
|
||||
warnings: null
|
||||
}, true);
|
||||
} else if (server.errors && serverWasLoading) {
|
||||
_store.store.setState({
|
||||
...partialState,
|
||||
errors: server.errors,
|
||||
warnings: null
|
||||
}, true);
|
||||
} else if (edgeServer.errors && edgeServerWasLoading) {
|
||||
_store.store.setState({
|
||||
...partialState,
|
||||
errors: edgeServer.errors,
|
||||
warnings: null
|
||||
}, true);
|
||||
} else {
|
||||
// Show warnings from all of them
|
||||
const warnings = [
|
||||
...client.warnings || [],
|
||||
...server.warnings || [],
|
||||
...edgeServer.warnings || []
|
||||
].concat(formatAmpMessages(amp) || []);
|
||||
_store.store.setState({
|
||||
...partialState,
|
||||
errors: null,
|
||||
warnings: warnings.length === 0 ? null : warnings
|
||||
}, true);
|
||||
}
|
||||
});
|
||||
function ampValidation(page, errors, warnings) {
|
||||
const { amp } = buildStore.getState();
|
||||
if (!(errors.length || warnings.length)) {
|
||||
buildStore.setState({
|
||||
amp: Object.keys(amp).filter((k)=>k !== page).sort()// eslint-disable-next-line no-sequences
|
||||
.reduce((a, c)=>(a[c] = amp[c], a), {})
|
||||
});
|
||||
return;
|
||||
}
|
||||
const newAmp = {
|
||||
...amp,
|
||||
[page]: {
|
||||
errors,
|
||||
warnings
|
||||
}
|
||||
};
|
||||
buildStore.setState({
|
||||
amp: Object.keys(newAmp).sort()// eslint-disable-next-line no-sequences
|
||||
.reduce((a, c)=>(a[c] = newAmp[c], a), {})
|
||||
});
|
||||
}
|
||||
function watchCompilers(client, server, edgeServer) {
|
||||
buildStore.setState({
|
||||
client: {
|
||||
loading: true
|
||||
},
|
||||
server: {
|
||||
loading: true
|
||||
},
|
||||
edgeServer: {
|
||||
loading: true
|
||||
},
|
||||
trigger: "initial",
|
||||
url: undefined
|
||||
});
|
||||
function tapCompiler(key, compiler, onEvent) {
|
||||
compiler.hooks.invalid.tap(`NextJsInvalid-${key}`, ()=>{
|
||||
onEvent({
|
||||
loading: true
|
||||
});
|
||||
});
|
||||
compiler.hooks.done.tap(`NextJsDone-${key}`, (stats)=>{
|
||||
buildStore.setState({
|
||||
amp: {}
|
||||
});
|
||||
const { errors, warnings } = (0, _formatwebpackmessages.default)(stats.toJson({
|
||||
preset: "errors-warnings",
|
||||
moduleTrace: true
|
||||
}));
|
||||
const hasErrors = !!(errors == null ? void 0 : errors.length);
|
||||
const hasWarnings = !!(warnings == null ? void 0 : warnings.length);
|
||||
onEvent({
|
||||
loading: false,
|
||||
totalModulesCount: stats.compilation.modules.size,
|
||||
errors: hasErrors ? errors : null,
|
||||
warnings: hasWarnings ? warnings : null
|
||||
});
|
||||
});
|
||||
}
|
||||
tapCompiler(_constants.COMPILER_NAMES.client, client, (status)=>{
|
||||
if (!status.loading && !buildStore.getState().server.loading && !buildStore.getState().edgeServer.loading && status.totalModulesCount > 0) {
|
||||
buildStore.setState({
|
||||
client: status,
|
||||
trigger: undefined,
|
||||
url: undefined
|
||||
});
|
||||
} else {
|
||||
buildStore.setState({
|
||||
client: status
|
||||
});
|
||||
}
|
||||
});
|
||||
tapCompiler(_constants.COMPILER_NAMES.server, server, (status)=>{
|
||||
if (!status.loading && !buildStore.getState().client.loading && !buildStore.getState().edgeServer.loading && status.totalModulesCount > 0) {
|
||||
buildStore.setState({
|
||||
server: status,
|
||||
trigger: undefined,
|
||||
url: undefined
|
||||
});
|
||||
} else {
|
||||
buildStore.setState({
|
||||
server: status
|
||||
});
|
||||
}
|
||||
});
|
||||
tapCompiler(_constants.COMPILER_NAMES.edgeServer, edgeServer, (status)=>{
|
||||
if (!status.loading && !buildStore.getState().client.loading && !buildStore.getState().server.loading && status.totalModulesCount > 0) {
|
||||
buildStore.setState({
|
||||
edgeServer: status,
|
||||
trigger: undefined,
|
||||
url: undefined
|
||||
});
|
||||
} else {
|
||||
buildStore.setState({
|
||||
edgeServer: status
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function reportTrigger(trigger, url) {
|
||||
buildStore.setState({
|
||||
trigger,
|
||||
url
|
||||
});
|
||||
}
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/next/dist/build/output/index.js.map
generated
vendored
Normal file
1
node_modules/next/dist/build/output/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
18
node_modules/next/dist/build/output/log.d.ts
generated
vendored
Normal file
18
node_modules/next/dist/build/output/log.d.ts
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
export declare const prefixes: {
|
||||
readonly wait: string;
|
||||
readonly error: string;
|
||||
readonly warn: string;
|
||||
readonly ready: "▲";
|
||||
readonly info: string;
|
||||
readonly event: string;
|
||||
readonly trace: string;
|
||||
};
|
||||
export declare function bootstrap(...message: any[]): void;
|
||||
export declare function wait(...message: any[]): void;
|
||||
export declare function error(...message: any[]): void;
|
||||
export declare function warn(...message: any[]): void;
|
||||
export declare function ready(...message: any[]): void;
|
||||
export declare function info(...message: any[]): void;
|
||||
export declare function event(...message: any[]): void;
|
||||
export declare function trace(...message: any[]): void;
|
||||
export declare function warnOnce(...message: any[]): void;
|
||||
115
node_modules/next/dist/build/output/log.js
generated
vendored
Normal file
115
node_modules/next/dist/build/output/log.js
generated
vendored
Normal file
@ -0,0 +1,115 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
bootstrap: null,
|
||||
error: null,
|
||||
event: null,
|
||||
info: null,
|
||||
prefixes: null,
|
||||
ready: null,
|
||||
trace: null,
|
||||
wait: null,
|
||||
warn: null,
|
||||
warnOnce: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
bootstrap: function() {
|
||||
return bootstrap;
|
||||
},
|
||||
error: function() {
|
||||
return error;
|
||||
},
|
||||
event: function() {
|
||||
return event;
|
||||
},
|
||||
info: function() {
|
||||
return info;
|
||||
},
|
||||
prefixes: function() {
|
||||
return prefixes;
|
||||
},
|
||||
ready: function() {
|
||||
return ready;
|
||||
},
|
||||
trace: function() {
|
||||
return trace;
|
||||
},
|
||||
wait: function() {
|
||||
return wait;
|
||||
},
|
||||
warn: function() {
|
||||
return warn;
|
||||
},
|
||||
warnOnce: function() {
|
||||
return warnOnce;
|
||||
}
|
||||
});
|
||||
const _picocolors = require("../../lib/picocolors");
|
||||
const prefixes = {
|
||||
wait: (0, _picocolors.white)((0, _picocolors.bold)("○")),
|
||||
error: (0, _picocolors.red)((0, _picocolors.bold)("⨯")),
|
||||
warn: (0, _picocolors.yellow)((0, _picocolors.bold)("⚠")),
|
||||
ready: "▲",
|
||||
info: (0, _picocolors.white)((0, _picocolors.bold)(" ")),
|
||||
event: (0, _picocolors.green)((0, _picocolors.bold)("✓")),
|
||||
trace: (0, _picocolors.magenta)((0, _picocolors.bold)("\xbb"))
|
||||
};
|
||||
const LOGGING_METHOD = {
|
||||
log: "log",
|
||||
warn: "warn",
|
||||
error: "error"
|
||||
};
|
||||
function prefixedLog(prefixType, ...message) {
|
||||
if ((message[0] === "" || message[0] === undefined) && message.length === 1) {
|
||||
message.shift();
|
||||
}
|
||||
const consoleMethod = prefixType in LOGGING_METHOD ? LOGGING_METHOD[prefixType] : "log";
|
||||
const prefix = prefixes[prefixType];
|
||||
// If there's no message, don't print the prefix but a new line
|
||||
if (message.length === 0) {
|
||||
console[consoleMethod]("");
|
||||
} else {
|
||||
console[consoleMethod](" " + prefix, ...message);
|
||||
}
|
||||
}
|
||||
function bootstrap(...message) {
|
||||
console.log(" ", ...message);
|
||||
}
|
||||
function wait(...message) {
|
||||
prefixedLog("wait", ...message);
|
||||
}
|
||||
function error(...message) {
|
||||
prefixedLog("error", ...message);
|
||||
}
|
||||
function warn(...message) {
|
||||
prefixedLog("warn", ...message);
|
||||
}
|
||||
function ready(...message) {
|
||||
prefixedLog("ready", ...message);
|
||||
}
|
||||
function info(...message) {
|
||||
prefixedLog("info", ...message);
|
||||
}
|
||||
function event(...message) {
|
||||
prefixedLog("event", ...message);
|
||||
}
|
||||
function trace(...message) {
|
||||
prefixedLog("trace", ...message);
|
||||
}
|
||||
const warnOnceMessages = new Set();
|
||||
function warnOnce(...message) {
|
||||
if (!warnOnceMessages.has(message[0])) {
|
||||
warnOnceMessages.add(message.join(" "));
|
||||
warn(...message);
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=log.js.map
|
||||
1
node_modules/next/dist/build/output/log.js.map
generated
vendored
Normal file
1
node_modules/next/dist/build/output/log.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/build/output/log.ts"],"names":["bootstrap","error","event","info","prefixes","ready","trace","wait","warn","warnOnce","white","bold","red","yellow","green","magenta","LOGGING_METHOD","log","prefixedLog","prefixType","message","undefined","length","shift","consoleMethod","prefix","console","warnOnceMessages","Set","has","add","join"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;IAqCgBA,SAAS;eAATA;;IAQAC,KAAK;eAALA;;IAgBAC,KAAK;eAALA;;IAJAC,IAAI;eAAJA;;IAvDHC,QAAQ;eAARA;;IAmDGC,KAAK;eAALA;;IAYAC,KAAK;eAALA;;IAxBAC,IAAI;eAAJA;;IAQAC,IAAI;eAAJA;;IAqBAC,QAAQ;eAARA;;;4BAtEyC;AAElD,MAAML,WAAW;IACtBG,MAAMG,IAAAA,iBAAK,EAACC,IAAAA,gBAAI,EAAC;IACjBV,OAAOW,IAAAA,eAAG,EAACD,IAAAA,gBAAI,EAAC;IAChBH,MAAMK,IAAAA,kBAAM,EAACF,IAAAA,gBAAI,EAAC;IAClBN,OAAO;IACPF,MAAMO,IAAAA,iBAAK,EAACC,IAAAA,gBAAI,EAAC;IACjBT,OAAOY,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QACrCO,iBAAiBG,GAAG,CAACV,QAAQW,IAAI,CAAC;QAElCvB,QAAQY;IACV;AACF"}
|
||||
22
node_modules/next/dist/build/output/store.d.ts
generated
vendored
Normal file
22
node_modules/next/dist/build/output/store.d.ts
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
export type OutputState = {
|
||||
bootstrap: true;
|
||||
appUrl: string | null;
|
||||
bindAddr: string | null;
|
||||
} | ({
|
||||
bootstrap: false;
|
||||
appUrl: string | null;
|
||||
bindAddr: string | null;
|
||||
} & ({
|
||||
loading: true;
|
||||
trigger: string | undefined;
|
||||
url: string | undefined;
|
||||
} | {
|
||||
loading: false;
|
||||
typeChecking: boolean;
|
||||
totalModulesCount: number;
|
||||
errors: string[] | null;
|
||||
warnings: string[] | null;
|
||||
hasEdgeServer: boolean;
|
||||
}));
|
||||
export declare function formatTrigger(trigger: string): string;
|
||||
export declare const store: import("unistore").Store<OutputState>;
|
||||
214
node_modules/next/dist/build/output/store.js
generated
vendored
Normal file
214
node_modules/next/dist/build/output/store.js
generated
vendored
Normal file
@ -0,0 +1,214 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
formatTrigger: null,
|
||||
store: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
formatTrigger: function() {
|
||||
return formatTrigger;
|
||||
},
|
||||
store: function() {
|
||||
return store;
|
||||
}
|
||||
});
|
||||
const _unistore = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/unistore"));
|
||||
const _stripansi = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/strip-ansi"));
|
||||
const _trace = require("../../trace");
|
||||
const _swc = require("../swc");
|
||||
const _log = /*#__PURE__*/ _interop_require_wildcard(require("./log"));
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function _getRequireWildcardCache(nodeInterop) {
|
||||
if (typeof WeakMap !== "function") return null;
|
||||
var cacheBabelInterop = new WeakMap();
|
||||
var cacheNodeInterop = new WeakMap();
|
||||
return (_getRequireWildcardCache = function(nodeInterop) {
|
||||
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
||||
})(nodeInterop);
|
||||
}
|
||||
function _interop_require_wildcard(obj, nodeInterop) {
|
||||
if (!nodeInterop && obj && obj.__esModule) {
|
||||
return obj;
|
||||
}
|
||||
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
||||
return {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
var cache = _getRequireWildcardCache(nodeInterop);
|
||||
if (cache && cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
}
|
||||
var newObj = {
|
||||
__proto__: null
|
||||
};
|
||||
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
||||
for(var key in obj){
|
||||
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
||||
if (desc && (desc.get || desc.set)) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
if (cache) {
|
||||
cache.set(obj, newObj);
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
const MAX_LOG_SKIP_DURATION = 500 // 500ms
|
||||
;
|
||||
const internalSegments = [
|
||||
"[[...__metadata_id__]]",
|
||||
"[__metadata_id__]"
|
||||
];
|
||||
function formatTrigger(trigger) {
|
||||
for (const segment of internalSegments){
|
||||
if (trigger.includes(segment)) {
|
||||
trigger = trigger.replace(segment, "");
|
||||
}
|
||||
}
|
||||
if (trigger.length > 1 && trigger.endsWith("/")) {
|
||||
trigger = trigger.slice(0, -1);
|
||||
}
|
||||
return trigger;
|
||||
}
|
||||
const store = (0, _unistore.default)({
|
||||
appUrl: null,
|
||||
bindAddr: null,
|
||||
bootstrap: true
|
||||
});
|
||||
let lastStore = {
|
||||
appUrl: null,
|
||||
bindAddr: null,
|
||||
bootstrap: true
|
||||
};
|
||||
function hasStoreChanged(nextStore) {
|
||||
if ([
|
||||
...new Set([
|
||||
...Object.keys(lastStore),
|
||||
...Object.keys(nextStore)
|
||||
])
|
||||
].every((key)=>Object.is(lastStore[key], nextStore[key]))) {
|
||||
return false;
|
||||
}
|
||||
lastStore = nextStore;
|
||||
return true;
|
||||
}
|
||||
let startTime = 0;
|
||||
let trigger = "" // default, use empty string for trigger
|
||||
;
|
||||
let triggerUrl = undefined;
|
||||
let loadingLogTimer = null;
|
||||
let traceSpan = null;
|
||||
store.subscribe((state)=>{
|
||||
if (!hasStoreChanged(state)) {
|
||||
return;
|
||||
}
|
||||
if (state.bootstrap) {
|
||||
return;
|
||||
}
|
||||
if (state.loading) {
|
||||
if (state.trigger) {
|
||||
trigger = formatTrigger(state.trigger);
|
||||
triggerUrl = state.url;
|
||||
if (trigger !== "initial") {
|
||||
traceSpan = (0, _trace.trace)("compile-path", undefined, {
|
||||
trigger: trigger
|
||||
});
|
||||
if (!loadingLogTimer) {
|
||||
// Only log compiling if compiled is not finished in 3 seconds
|
||||
loadingLogTimer = setTimeout(()=>{
|
||||
if (triggerUrl && triggerUrl !== trigger && process.env.NEXT_TRIGGER_URL) {
|
||||
_log.wait(`Compiling ${trigger} (${triggerUrl}) ...`);
|
||||
} else {
|
||||
_log.wait(`Compiling ${trigger} ...`);
|
||||
}
|
||||
}, MAX_LOG_SKIP_DURATION);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (startTime === 0) {
|
||||
startTime = Date.now();
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (state.errors) {
|
||||
// Log compilation errors
|
||||
_log.error(state.errors[0]);
|
||||
const cleanError = (0, _stripansi.default)(state.errors[0]);
|
||||
if (cleanError.indexOf("SyntaxError") > -1) {
|
||||
const matches = cleanError.match(/\[.*\]=/);
|
||||
if (matches) {
|
||||
for (const match of matches){
|
||||
const prop = (match.split("]").shift() || "").slice(1);
|
||||
console.log(`AMP bind syntax [${prop}]='' is not supported in JSX, use 'data-amp-bind-${prop}' instead. https://nextjs.org/docs/messages/amp-bind-jsx-alt`);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
startTime = 0;
|
||||
// Ensure traces are flushed after each compile in development mode
|
||||
(0, _trace.flushAllTraces)();
|
||||
(0, _swc.teardownTraceSubscriber)();
|
||||
(0, _swc.teardownHeapProfiler)();
|
||||
return;
|
||||
}
|
||||
let timeMessage = "";
|
||||
if (startTime) {
|
||||
const time = Date.now() - startTime;
|
||||
startTime = 0;
|
||||
timeMessage = " " + (time > 2000 ? `in ${Math.round(time / 100) / 10}s` : `in ${time}ms`);
|
||||
}
|
||||
let modulesMessage = "";
|
||||
if (state.totalModulesCount) {
|
||||
modulesMessage = ` (${state.totalModulesCount} modules)`;
|
||||
}
|
||||
if (state.warnings) {
|
||||
_log.warn(state.warnings.join("\n\n"));
|
||||
// Ensure traces are flushed after each compile in development mode
|
||||
(0, _trace.flushAllTraces)();
|
||||
(0, _swc.teardownTraceSubscriber)();
|
||||
(0, _swc.teardownHeapProfiler)();
|
||||
return;
|
||||
}
|
||||
if (state.typeChecking) {
|
||||
_log.info(`bundled ${trigger}${timeMessage}${modulesMessage}, type checking...`);
|
||||
return;
|
||||
}
|
||||
if (trigger === "initial") {
|
||||
trigger = "";
|
||||
} else {
|
||||
if (loadingLogTimer) {
|
||||
clearTimeout(loadingLogTimer);
|
||||
loadingLogTimer = null;
|
||||
}
|
||||
if (traceSpan) {
|
||||
traceSpan.stop();
|
||||
traceSpan = null;
|
||||
}
|
||||
_log.event(`Compiled${trigger ? " " + trigger : ""}${timeMessage}${modulesMessage}`);
|
||||
trigger = "";
|
||||
}
|
||||
// Ensure traces are flushed after each compile in development mode
|
||||
(0, _trace.flushAllTraces)();
|
||||
(0, _swc.teardownTraceSubscriber)();
|
||||
(0, _swc.teardownHeapProfiler)();
|
||||
});
|
||||
|
||||
//# sourceMappingURL=store.js.map
|
||||
1
node_modules/next/dist/build/output/store.js.map
generated
vendored
Normal file
1
node_modules/next/dist/build/output/store.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/build/output/store.ts"],"names":["formatTrigger","store","MAX_LOG_SKIP_DURATION","internalSegments","trigger","segment","includes","replace","length","endsWith","slice","createStore","appUrl","bindAddr","bootstrap","lastStore","hasStoreChanged","nextStore","Set","Object","keys","every","key","is","startTime","triggerUrl","undefined","loadingLogTimer","traceSpan","subscribe","state","loading","url","trace","setTimeout","process","env","NEXT_TRIGGER_URL","Log","wait","Date","now","errors","error","cleanError","stripAnsi","indexOf","matches","match","prop","split","shift","console","log","flushAllTraces","teardownTraceSubscriber","teardownHeapProfiler","timeMessage","time","Math","round","modulesMessage","totalModulesCount","warnings","warn","join","typeChecking","info","clearTimeout","stop","event"],"mappings":";;;;;;;;;;;;;;;IA2BgBA,aAAa;eAAbA;;IAYHC,KAAK;eAALA;;;iEAvCW;kEACF;uBAC2B;qBACa;6DACzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAErB,MAAMC,wBAAwB,IAAI,QAAQ;;AAoB1C,MAAMC,mBAAmB;IAAC;IAA0B;CAAoB;AACjE,SAASH,cAAcI,OAAe;IAC3C,KAAK,MAAMC,WAAWF,iBAAkB;QACtC,IAAIC,QAAQE,QAAQ,CAACD,UAAU;YAC7BD,UAAUA,QAAQG,OAAO,CAACF,SAAS;QACrC;IACF;IACA,IAAID,QAAQI,MAAM,GAAG,KAAKJ,QAAQK,QAAQ,CAAC,MAAM;QAC/CL,UAAUA,QAAQM,KAAK,CAAC,GAAG,CAAC;IAC9B;IACA,OAAON;AACT;AAEO,MAAMH,QAAQU,IAAAA,iBAAW,EAAc;IAC5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