create project

This commit is contained in:
ismailsosic
2022-12-27 12:05:56 +01:00
parent 2a33a2d3de
commit cd2143287c
16035 changed files with 2489703 additions and 0 deletions

View File

@@ -0,0 +1 @@
export default function transformSource(this: any, source: string, sourceMap: any): Promise<any>;

View File

@@ -0,0 +1,34 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = transformSource;
var _constants = require("../../../../shared/lib/constants");
var _warnOnce = require("../../../../shared/lib/utils/warn-once");
var _getPageStaticInfo = require("../../../analysis/get-page-static-info");
var _getModuleBuildInfo = require("../get-module-build-info");
async function transformSource(source, sourceMap) {
var ref;
// Avoid buffer to be consumed
if (typeof source !== "string") {
throw new Error("Expected source to have been transformed to a string.");
}
const callback = this.async();
const buildInfo = (0, _getModuleBuildInfo).getModuleBuildInfo(this._module);
const rscType = (0, _getPageStaticInfo).getRSCModuleType(source);
// Assign the RSC meta information to buildInfo.
// Exclude next internal files which are not marked as client files
buildInfo.rsc = {
type: rscType
};
if (((ref = buildInfo.rsc) == null ? void 0 : ref.type) === _constants.RSC_MODULE_TYPES.client) {
return callback(null, source, sourceMap);
}
if (noopHeadPath === this.resourcePath) {
(0, _warnOnce).warnOnce(`Warning: You're using \`next/head\` inside app directory, please migrate to \`head.js\`. Checkout https://beta.nextjs.org/docs/api-reference/file-conventions/head for details.`);
}
return callback(null, source, sourceMap);
}
const noopHeadPath = require.resolve("next/dist/client/components/noop-head");
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../build/webpack/loaders/next-flight-loader/index.ts"],"names":["transformSource","source","sourceMap","buildInfo","Error","callback","async","getModuleBuildInfo","_module","rscType","getRSCModuleType","rsc","type","RSC_MODULE_TYPES","client","noopHeadPath","resourcePath","warnOnce","require","resolve"],"mappings":"AAAA;;;;kBAO8BA,eAAe;AAPZ,IAAA,UAAkC,WAAlC,kCAAkC,CAAA;AAC1C,IAAA,SAAwC,WAAxC,wCAAwC,CAAA;AAChC,IAAA,kBAAwC,WAAxC,wCAAwC,CAAA;AACtC,IAAA,mBAA0B,WAA1B,0BAA0B,CAAA;AAI9C,eAAeA,eAAe,CAE3CC,MAAc,EACdC,SAAc,EACd;QAcIC,GAAa;IAbjB,8BAA8B;IAC9B,IAAI,OAAOF,MAAM,KAAK,QAAQ,EAAE;QAC9B,MAAM,IAAIG,KAAK,CAAC,uDAAuD,CAAC,CAAA;KACzE;IAED,MAAMC,QAAQ,GAAG,IAAI,CAACC,KAAK,EAAE;IAC7B,MAAMH,SAAS,GAAGI,CAAAA,GAAAA,mBAAkB,AAAc,CAAA,mBAAd,CAAC,IAAI,CAACC,OAAO,CAAC;IAClD,MAAMC,OAAO,GAAGC,CAAAA,GAAAA,kBAAgB,AAAQ,CAAA,iBAAR,CAACT,MAAM,CAAC;IAExC,gDAAgD;IAChD,mEAAmE;IACnEE,SAAS,CAACQ,GAAG,GAAG;QAAEC,IAAI,EAAEH,OAAO;KAAE;IAEjC,IAAIN,CAAAA,CAAAA,GAAa,GAAbA,SAAS,CAACQ,GAAG,SAAM,GAAnBR,KAAAA,CAAmB,GAAnBA,GAAa,CAAES,IAAI,CAAA,KAAKC,UAAgB,iBAAA,CAACC,MAAM,EAAE;QACnD,OAAOT,QAAQ,CAAC,IAAI,EAAEJ,MAAM,EAAEC,SAAS,CAAC,CAAA;KACzC;IAED,IAAIa,YAAY,KAAK,IAAI,CAACC,YAAY,EAAE;QACtCC,CAAAA,GAAAA,SAAQ,AAEP,CAAA,SAFO,CACN,CAAC,+KAA+K,CAAC,CAClL;KACF;IACD,OAAOZ,QAAQ,CAAC,IAAI,EAAEJ,MAAM,EAAEC,SAAS,CAAC,CAAA;CACzC;AA9BD,MAAMa,YAAY,GAAGG,OAAO,CAACC,OAAO,CAAC,uCAAuC,CAAC"}

View File

@@ -0,0 +1,7 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
export declare function createProxy(moduleId: string): object;

View File

@@ -0,0 +1,99 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createProxy = createProxy;
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/ // Modified from https://github.com/facebook/react/blob/main/packages/react-server-dom-webpack/src/ReactFlightWebpackNodeRegister.js
const MODULE_REFERENCE = Symbol.for("react.module.reference");
const PROMISE_PROTOTYPE = Promise.prototype;
const proxyHandlers = {
get: function(target, name, _receiver) {
switch(name){
// These names are read by the Flight runtime if you end up using the exports object.
case "$$typeof":
// These names are a little too common. We should probably have a way to
// have the Flight runtime extract the inner target instead.
return target.$$typeof;
case "filepath":
return target.filepath;
case "name":
return target.name;
case "async":
return target.async;
// We need to special case this because createElement reads it if we pass this
// reference.
case "defaultProps":
return undefined;
case "__esModule":
// Something is conditionally checking which export to use. We'll pretend to be
// an ESM compat module but then we'll check again on the client.
target.default = {
$$typeof: MODULE_REFERENCE,
filepath: target.filepath,
// This a placeholder value that tells the client to conditionally use the
// whole object or just the default export.
name: "",
async: target.async
};
return true;
case "then":
if (!target.async) {
// If this module is expected to return a Promise (such as an AsyncModule) then
// we should resolve that with a client reference that unwraps the Promise on
// the client.
const then = function then(resolve, _reject) {
const moduleReference = {
$$typeof: MODULE_REFERENCE,
filepath: target.filepath,
name: "*",
async: true
};
return Promise.resolve(resolve(new Proxy(moduleReference, proxyHandlers)));
};
// If this is not used as a Promise but is treated as a reference to a `.then`
// export then we should treat it as a reference to that name.
then.$$typeof = MODULE_REFERENCE;
then.filepath = target.filepath;
// then.name is conveniently already "then" which is the export name we need.
// This will break if it's minified though.
return then;
}
break;
default:
break;
}
let cachedReference = target[name];
if (!cachedReference) {
cachedReference = target[name] = {
$$typeof: MODULE_REFERENCE,
filepath: target.filepath,
name: name,
async: target.async
};
}
return cachedReference;
},
getPrototypeOf (_target) {
// Pretend to be a Promise in case anyone asks.
return PROMISE_PROTOTYPE;
},
set: function() {
throw new Error("Cannot assign to a client module from a server module.");
}
};
function createProxy(moduleId) {
const moduleReference = {
$$typeof: MODULE_REFERENCE,
filepath: moduleId,
name: "*",
async: false
};
return new Proxy(moduleReference, proxyHandlers);
}
//# sourceMappingURL=module-proxy.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../build/webpack/loaders/next-flight-loader/module-proxy.ts"],"names":["createProxy","MODULE_REFERENCE","Symbol","for","PROMISE_PROTOTYPE","Promise","prototype","proxyHandlers","get","target","name","_receiver","$$typeof","filepath","async","undefined","default","then","resolve","_reject","moduleReference","Proxy","cachedReference","getPrototypeOf","_target","set","Error","moduleId"],"mappings":"AASA;;;;QAoFgBA,WAAW,GAAXA,WAAW;AA7F3B;;;;;GAKG,CAEH,oIAAoI;AAEpI,MAAMC,gBAAgB,GAAGC,MAAM,CAACC,GAAG,CAAC,wBAAwB,CAAC;AAC7D,MAAMC,iBAAiB,GAAGC,OAAO,CAACC,SAAS;AAE3C,MAAMC,aAAa,GAAyB;IAC1CC,GAAG,EAAE,SAAUC,MAAW,EAAEC,IAAY,EAAEC,SAAc,EAAE;QACxD,OAAQD,IAAI;YACV,qFAAqF;YACrF,KAAK,UAAU;gBACb,wEAAwE;gBACxE,4DAA4D;gBAC5D,OAAOD,MAAM,CAACG,QAAQ,CAAA;YACxB,KAAK,UAAU;gBACb,OAAOH,MAAM,CAACI,QAAQ,CAAA;YACxB,KAAK,MAAM;gBACT,OAAOJ,MAAM,CAACC,IAAI,CAAA;YACpB,KAAK,OAAO;gBACV,OAAOD,MAAM,CAACK,KAAK,CAAA;YACrB,8EAA8E;YAC9E,aAAa;YACb,KAAK,cAAc;gBACjB,OAAOC,SAAS,CAAA;YAClB,KAAK,YAAY;gBACf,+EAA+E;gBAC/E,iEAAiE;gBACjEN,MAAM,CAACO,OAAO,GAAG;oBACfJ,QAAQ,EAAEX,gBAAgB;oBAC1BY,QAAQ,EAAEJ,MAAM,CAACI,QAAQ;oBACzB,0EAA0E;oBAC1E,2CAA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