vike 0.4.195-commit-3f77496 → 0.4.195-commit-f7e91ba
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/dist/cjs/__internal/index.js +3 -4
- package/dist/cjs/node/cli/onLoad.js +1 -2
- package/dist/cjs/node/createPageRenderer.js +1 -2
- package/dist/cjs/node/plugin/index.js +3 -3
- package/dist/cjs/node/plugin/onLoad.js +1 -2
- package/dist/cjs/node/plugin/plugins/autoFullBuild.js +1 -2
- package/dist/cjs/node/plugin/plugins/baseUrls.js +1 -2
- package/dist/cjs/node/plugin/plugins/buildConfig/fixServerAssets.js +2 -3
- package/dist/cjs/node/plugin/plugins/buildConfig.js +4 -4
- package/dist/cjs/node/plugin/plugins/commonConfig/assertResolveAlias.js +1 -2
- package/dist/cjs/node/plugin/plugins/commonConfig.js +1 -2
- package/dist/cjs/node/plugin/plugins/config/assertVikeConfig.js +1 -2
- package/dist/cjs/node/plugin/plugins/config/index.js +1 -2
- package/dist/cjs/node/plugin/plugins/config/pickFirst.js +1 -2
- package/dist/cjs/node/plugin/plugins/config/resolveBase.js +2 -3
- package/dist/cjs/node/plugin/plugins/devConfig/determineFsAllowList.js +1 -2
- package/dist/cjs/node/plugin/plugins/devConfig/determineOptimizeDeps.js +1 -2
- package/dist/cjs/node/plugin/plugins/devConfig/index.js +1 -2
- package/dist/cjs/node/plugin/plugins/distFileNames.js +1 -2
- package/dist/cjs/node/plugin/plugins/envVars.js +1 -2
- package/dist/cjs/node/plugin/plugins/extractAssetsPlugin.js +2 -2
- package/dist/cjs/node/plugin/plugins/extractExportNamesPlugin.js +3 -3
- package/dist/cjs/node/plugin/plugins/fileEnv.js +109 -88
- package/dist/cjs/node/plugin/plugins/importBuild/getVikeManifest.js +1 -2
- package/dist/cjs/node/plugin/plugins/importBuild/index.js +2 -3
- package/dist/cjs/node/plugin/plugins/importUserCode/addImportStatement.js +1 -2
- package/dist/cjs/node/plugin/plugins/importUserCode/getVirtualFileImportUserCode.js +1 -3
- package/dist/cjs/node/plugin/plugins/importUserCode/index.js +1 -2
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/assertExtensions.js +2 -3
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getConfigFileExport.js +1 -2
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/crawlPlusFiles.js +1 -2
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/filesystemRouting.js +8 -9
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/loadFileAtConfigTime.js +3 -4
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/resolvePointerImport.js +3 -4
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/transformFileImports.js +3 -4
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/transpileAndExecuteFile.js +4 -5
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +6 -6
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVirtualFilePageConfigValuesAll.js +1 -2
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVirtualFilePageConfigs.js +1 -2
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/isRuntimeEnvMatch.js +1 -2
- package/dist/cjs/node/plugin/plugins/packageJsonFile.js +1 -2
- package/dist/cjs/node/plugin/plugins/previewConfig.js +1 -2
- package/dist/cjs/node/plugin/plugins/removeRequireHookPlugin.js +1 -2
- package/dist/cjs/node/plugin/plugins/setGlobalContext.js +1 -2
- package/dist/cjs/node/plugin/plugins/suppressRollupWarning.js +1 -2
- package/dist/cjs/node/plugin/plugins/workaroundCssModuleHmr.js +1 -2
- package/dist/cjs/node/plugin/resolveClientEntriesDev.js +1 -2
- package/dist/cjs/node/plugin/shared/addSsrMiddleware.js +1 -2
- package/dist/cjs/node/plugin/shared/findPageFiles.js +1 -2
- package/dist/cjs/node/plugin/shared/getAssetsDir.js +1 -2
- package/dist/cjs/node/plugin/shared/getFilePath.js +8 -9
- package/dist/cjs/node/plugin/shared/getHttpRequestAsyncStore.js +2 -3
- package/dist/cjs/node/plugin/shared/isAsset.js +1 -2
- package/dist/cjs/node/plugin/shared/isViteCliCall.js +2 -3
- package/dist/cjs/node/plugin/shared/loggerNotProd/errorWithCodeSnippet.js +4 -5
- package/dist/cjs/node/plugin/shared/loggerNotProd/log.js +4 -5
- package/dist/cjs/node/plugin/shared/loggerNotProd.js +6 -7
- package/dist/cjs/node/plugin/shared/loggerVite/removeSuperfluousViteLog.js +3 -4
- package/dist/cjs/node/plugin/shared/loggerVite.js +1 -2
- package/dist/cjs/node/plugin/shared/parseEsModule.js +2 -3
- package/dist/cjs/node/plugin/shared/rollupIsEsm.js +1 -2
- package/dist/cjs/node/plugin/shared/rollupSourceMap.js +2 -3
- package/dist/cjs/node/prerender/runPrerender.js +4 -5
- package/dist/cjs/node/runtime/globalContext/loadImportBuild.js +2 -3
- package/dist/cjs/node/runtime/globalContext.js +13 -14
- package/dist/cjs/node/runtime/html/injectAssets/getHtmlTags.js +1 -2
- package/dist/cjs/node/runtime/html/injectAssets/getViteDevScript.js +1 -2
- package/dist/cjs/node/runtime/html/injectAssets/inferHtmlTags.js +4 -4
- package/dist/cjs/node/runtime/html/injectAssets/injectAssets__public.js +1 -2
- package/dist/cjs/node/runtime/html/injectAssets/injectHtmlTags.js +6 -7
- package/dist/cjs/node/runtime/html/injectAssets/mergeScriptTags.js +1 -2
- package/dist/cjs/node/runtime/html/injectAssets/sanitizeJson.js +1 -2
- package/dist/cjs/node/runtime/html/injectAssets.js +2 -3
- package/dist/cjs/node/runtime/html/renderHtml.js +5 -6
- package/dist/cjs/node/runtime/html/serializePageContextClientSide.js +2 -3
- package/dist/cjs/node/runtime/html/stream/react-streaming.js +3 -4
- package/dist/cjs/node/runtime/html/stream.js +21 -22
- package/dist/cjs/node/runtime/onLoad.js +1 -2
- package/dist/cjs/node/runtime/page-files/getPageFilesExports.js +1 -2
- package/dist/cjs/node/runtime/renderPage/analyzePage.js +1 -2
- package/dist/cjs/node/runtime/renderPage/assertArguments.js +1 -2
- package/dist/cjs/node/runtime/renderPage/createHttpResponse/assertNoInfiniteHttpRedirect.js +1 -2
- package/dist/cjs/node/runtime/renderPage/createHttpResponse/getCacheControl.js +1 -2
- package/dist/cjs/node/runtime/renderPage/createHttpResponse.js +5 -6
- package/dist/cjs/node/runtime/renderPage/debugPageFiles.js +1 -2
- package/dist/cjs/node/runtime/renderPage/executeOnBeforeRenderAndDataHooks.js +1 -2
- package/dist/cjs/node/runtime/renderPage/executeOnRenderHtmlHook.js +1 -2
- package/dist/cjs/node/runtime/renderPage/getEarlyHints.js +1 -2
- package/dist/cjs/node/runtime/renderPage/getHttpResponseBody.js +2 -3
- package/dist/cjs/node/runtime/renderPage/getPageAssets/getManifestEntry.js +1 -2
- package/dist/cjs/node/runtime/renderPage/getPageAssets/retrieveAssetsDev.js +1 -2
- package/dist/cjs/node/runtime/renderPage/getPageAssets/retrieveAssetsProd.js +1 -2
- package/dist/cjs/node/runtime/renderPage/getPageAssets/sortPageAssetsForEarlyHintsHeader.js +1 -2
- package/dist/cjs/node/runtime/renderPage/getPageAssets.js +2 -3
- package/dist/cjs/node/runtime/renderPage/handleErrorWithoutErrorPage.js +1 -2
- package/dist/cjs/node/runtime/renderPage/handlePageContextRequestUrl.js +1 -2
- package/dist/cjs/node/runtime/renderPage/inferMediaType.js +1 -2
- package/dist/cjs/node/runtime/renderPage/isNewError.js +2 -3
- package/dist/cjs/node/runtime/renderPage/loadUserFilesServerSide.js +1 -2
- package/dist/cjs/node/runtime/renderPage/log404/index.js +2 -3
- package/dist/cjs/node/runtime/renderPage/logErrorHint.js +2 -3
- package/dist/cjs/node/runtime/renderPage/loggerProd.js +2 -3
- package/dist/cjs/node/runtime/renderPage/loggerRuntime.js +2 -2
- package/dist/cjs/node/runtime/renderPage/preparePageContextForUserConsumptionServerSide.js +1 -2
- package/dist/cjs/node/runtime/renderPage/renderPageAlreadyRouted.js +5 -6
- package/dist/cjs/node/runtime/renderPage/resolveRedirects.js +2 -3
- package/dist/cjs/node/runtime/renderPage.js +2 -2
- package/dist/cjs/node/shared/assertPluginManifest.js +1 -2
- package/dist/cjs/node/shared/assertRuntimeManifest.js +1 -2
- package/dist/cjs/node/shared/assertV1Design.js +1 -2
- package/dist/cjs/node/shared/extractAssetsQuery.js +2 -3
- package/dist/cjs/node/shared/getConfigVike.js +1 -2
- package/dist/cjs/node/shared/isErrorDebug.js +1 -2
- package/dist/cjs/node/shared/prependEntriesDir.js +1 -2
- package/dist/cjs/node/shared/virtual-files/virtualFileImportUserCode.js +2 -2
- package/dist/cjs/node/shared/virtual-files/virtualFilePageConfigValuesAll.js +2 -3
- package/dist/cjs/shared/addIs404ToPageProps.js +1 -2
- package/dist/cjs/shared/assertHookReturnedObject.js +1 -2
- package/dist/cjs/shared/assertOnBeforeRenderHookReturn.js +1 -2
- package/dist/cjs/shared/assertPageContextProvidedByUser.js +1 -2
- package/dist/cjs/shared/assertPageFilePath.js +1 -2
- package/dist/cjs/shared/determinePageIdOld.js +1 -2
- package/dist/cjs/shared/error-page.js +3 -4
- package/dist/cjs/shared/getPageContextRequestUrl.js +2 -2
- package/dist/cjs/shared/getPageContextUrlComputed.js +2 -3
- package/dist/cjs/shared/getPageFiles/analyzeClientSide.js +1 -2
- package/dist/cjs/shared/getPageFiles/analyzePageClientSide/analyzeExports.js +1 -2
- package/dist/cjs/shared/getPageFiles/analyzePageClientSide/determineClientEntry.js +2 -3
- package/dist/cjs/shared/getPageFiles/analyzePageClientSide/getExportNames.js +1 -2
- package/dist/cjs/shared/getPageFiles/analyzePageClientSide.js +2 -3
- package/dist/cjs/shared/getPageFiles/analyzePageServerSide.js +1 -2
- package/dist/cjs/shared/getPageFiles/assert_exports_old_design.js +3 -3
- package/dist/cjs/shared/getPageFiles/fileTypes.js +3 -3
- package/dist/cjs/shared/getPageFiles/getAllPageIdFiles.js +2 -3
- package/dist/cjs/shared/getPageFiles/getExports.js +1 -2
- package/dist/cjs/shared/getPageFiles/getPageFileObject.js +1 -2
- package/dist/cjs/shared/getPageFiles/parseGlobResults.js +1 -2
- package/dist/cjs/shared/getPageFiles/setPageFiles.js +3 -4
- package/dist/cjs/shared/hooks/executeHook.js +4 -5
- package/dist/cjs/shared/hooks/getHook.js +6 -7
- package/dist/cjs/shared/modifyUrl.js +1 -2
- package/dist/cjs/shared/page-configs/assertPlusFileExport.js +1 -2
- package/dist/cjs/shared/page-configs/findPageConfig.js +1 -2
- package/dist/cjs/shared/page-configs/getConfigDefinedAt.js +3 -4
- package/dist/cjs/shared/page-configs/getConfigValue.js +2 -3
- package/dist/cjs/shared/page-configs/getConfigValueBuildTime.js +1 -2
- package/dist/cjs/shared/page-configs/getExportPath.js +1 -2
- package/dist/cjs/shared/page-configs/helpers.js +3 -4
- package/dist/cjs/shared/page-configs/loadConfigValues.js +1 -2
- package/dist/cjs/shared/page-configs/serialize/parsePageConfigs.js +2 -3
- package/dist/cjs/shared/page-configs/serialize/serializeConfigValues.js +1 -2
- package/dist/cjs/shared/route/abort.js +9 -10
- package/dist/cjs/shared/route/debug.js +1 -2
- package/dist/cjs/shared/route/deduceRouteStringFromFilesystemPath.js +1 -2
- package/dist/cjs/shared/route/executeGuardHook.js +1 -2
- package/dist/cjs/shared/route/executeOnBeforeRouteHook.js +1 -2
- package/dist/cjs/shared/route/index.js +1 -2
- package/dist/cjs/shared/route/loadPageRoutes.js +1 -2
- package/dist/cjs/shared/route/resolvePrecedence.js +1 -2
- package/dist/cjs/shared/route/resolveRoute.js +1 -2
- package/dist/cjs/shared/route/resolveRouteFunction.js +4 -5
- package/dist/cjs/shared/route/resolveRouteString.js +6 -7
- package/dist/cjs/shared/route/resolveUrlPathname.js +1 -2
- package/dist/cjs/shared/sortPageContext.js +1 -2
- package/dist/cjs/types/defineConfig.js +1 -2
- package/dist/cjs/utils/PROJECT_VERSION.js +1 -1
- package/dist/cjs/utils/assert.js +10 -11
- package/dist/cjs/utils/assertIsBrowser.js +1 -2
- package/dist/cjs/utils/assertIsNotBrowser.js +1 -2
- package/dist/cjs/utils/assertIsNotProductionRuntime.js +6 -6
- package/dist/cjs/utils/assertKeys.js +1 -2
- package/dist/cjs/utils/assertNodeEnv.js +5 -6
- package/dist/cjs/utils/assertNodeVersion.js +1 -2
- package/dist/cjs/utils/assertRoutingType.js +3 -4
- package/dist/cjs/utils/assertSingleInstance.js +3 -4
- package/dist/cjs/utils/assertVersion.js +2 -3
- package/dist/cjs/utils/augmentType.js +1 -2
- package/dist/cjs/utils/capitalizeFirstLetter.js +1 -2
- package/dist/cjs/utils/cast.js +2 -3
- package/dist/cjs/utils/changeEnumerable.js +1 -2
- package/dist/cjs/utils/checkType.js +2 -3
- package/dist/cjs/utils/compareString.js +1 -2
- package/dist/cjs/utils/createErrorWithCleanStackTrace.js +1 -2
- package/dist/cjs/utils/debug.js +2 -3
- package/dist/cjs/utils/deepEqual.js +1 -2
- package/dist/cjs/utils/escapeHtml.js +1 -2
- package/dist/cjs/utils/escapeRegex.js +1 -2
- package/dist/cjs/utils/filesystemPathHandling.js +2 -3
- package/dist/cjs/utils/findFile.js +1 -2
- package/dist/cjs/utils/findPackageJson.js +1 -2
- package/dist/cjs/utils/formatHintLog.js +1 -2
- package/dist/cjs/utils/freezePartial.js +1 -2
- package/dist/cjs/utils/genPromise.js +1 -2
- package/dist/cjs/utils/getCurrentUrl.js +1 -2
- package/dist/cjs/utils/getFileExtension.js +1 -2
- package/dist/cjs/utils/getGlobalObject.js +2 -3
- package/dist/cjs/utils/getMostSimilar.js +1 -2
- package/dist/cjs/utils/getOutDirs.js +2 -3
- package/dist/cjs/utils/getPropAccessNotation.js +1 -2
- package/dist/cjs/utils/getRandomId.js +1 -2
- package/dist/cjs/utils/getTerminWidth.js +1 -2
- package/dist/cjs/utils/getValuePrintable.js +1 -2
- package/dist/cjs/utils/hasProp.js +1 -2
- package/dist/cjs/utils/humanizeTime.js +1 -2
- package/dist/cjs/utils/includes.js +1 -2
- package/dist/cjs/utils/injectRollupInputs.js +2 -3
- package/dist/cjs/utils/isArray.js +1 -2
- package/dist/cjs/utils/isArrayOfStrings.js +1 -2
- package/dist/cjs/utils/isBrowser.js +1 -2
- package/dist/cjs/utils/isCallable.js +1 -2
- package/dist/cjs/utils/isDev.js +2 -3
- package/dist/cjs/utils/isFilePathAbsoluteFilesystem.js +2 -3
- package/dist/cjs/utils/isHtml.js +1 -2
- package/dist/cjs/utils/isNodeJS.js +1 -2
- package/dist/cjs/utils/isNpmPackage.js +5 -6
- package/dist/cjs/utils/isObject.js +1 -2
- package/dist/cjs/utils/isObjectOfStrings.js +1 -2
- package/dist/cjs/utils/isObjectWithKeys.js +1 -2
- package/dist/cjs/utils/isPlainObject.js +1 -2
- package/dist/cjs/utils/isPromise.js +1 -2
- package/dist/cjs/utils/isPropertyGetter.js +1 -2
- package/dist/cjs/utils/isReact.js +1 -2
- package/dist/cjs/utils/isSameErrorMessage.js +1 -2
- package/dist/cjs/utils/isScriptFile.js +4 -4
- package/dist/cjs/utils/isVikeReactApp.js +1 -2
- package/dist/cjs/utils/isVitest.js +1 -2
- package/dist/cjs/utils/joinEnglish.js +1 -2
- package/dist/cjs/utils/normalizeHeaders.js +1 -2
- package/dist/cjs/utils/objectAssign.js +1 -2
- package/dist/cjs/utils/objectDefineProperty.js +1 -2
- package/dist/cjs/utils/objectEntries.js +1 -2
- package/dist/cjs/utils/objectEntriesForEach.js +1 -2
- package/dist/cjs/utils/objectFromEntries.js +1 -2
- package/dist/cjs/utils/objectKeys.js +1 -2
- package/dist/cjs/utils/onPageVisibilityChange.js +2 -3
- package/dist/cjs/utils/pLimit.js +1 -2
- package/dist/cjs/utils/parseUrl-extras.js +8 -9
- package/dist/cjs/utils/parseUrl.js +11 -12
- package/dist/cjs/utils/path-shim.js +1 -2
- package/dist/cjs/utils/redirectHard.js +1 -2
- package/dist/cjs/utils/removeEmptyLines.js +1 -2
- package/dist/cjs/utils/removeFileExtention.js +1 -2
- package/dist/cjs/utils/requireResolve.js +1 -2
- package/dist/cjs/utils/sleep.js +1 -2
- package/dist/cjs/utils/slice.js +1 -2
- package/dist/cjs/utils/sorter.js +5 -6
- package/dist/cjs/utils/stringifyStringArray.js +1 -2
- package/dist/cjs/utils/stripAnsi.js +1 -2
- package/dist/cjs/utils/throttle.js +1 -2
- package/dist/cjs/utils/trimWithAnsi.js +2 -3
- package/dist/cjs/utils/truncateString.js +1 -2
- package/dist/cjs/utils/unique.js +1 -2
- package/dist/cjs/utils/urlToFile.js +2 -2
- package/dist/cjs/utils/virtual-files.js +3 -4
- package/dist/cjs/utils/viteIsSSR.js +2 -3
- package/dist/cjs/utils/warnIfErrorIsNotObject.js +1 -2
- package/dist/esm/node/plugin/plugins/fileEnv.js +109 -87
- package/dist/esm/node/plugin/plugins/importUserCode/getVirtualFileImportUserCode.js +0 -1
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/debug.d.ts +2 -2
- package/dist/esm/node/runtime/html/stream.d.ts +0 -1
- package/dist/esm/node/runtime/index-deprecated.d.ts +1 -1
- package/dist/esm/node/runtime/renderPage/getHttpResponseBody.d.ts +0 -1
- package/dist/esm/node/runtime/renderPage/renderPageAlreadyRouted.d.ts +6 -6
- package/dist/esm/utils/PROJECT_VERSION.d.ts +1 -1
- package/dist/esm/utils/PROJECT_VERSION.js +1 -1
- package/dist/esm/utils/debugGlob.d.ts +2 -2
- package/dist/esm/utils/projectInfo.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isReact =
|
|
3
|
+
exports.isReact = isReact;
|
|
4
4
|
// There doesn't seem to be a reliable way to detect React:
|
|
5
5
|
// - https://stackoverflow.com/questions/73156433/detect-with-javascript-whether-the-website-is-using-react
|
|
6
6
|
function isReact() {
|
|
@@ -21,4 +21,3 @@ function isReact() {
|
|
|
21
21
|
// console.log({ isReact1, isReact2, isReact3 })
|
|
22
22
|
return isReact1 || isReact2 || isReact3;
|
|
23
23
|
}
|
|
24
|
-
exports.isReact = isReact;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isSameErrorMessage =
|
|
3
|
+
exports.isSameErrorMessage = isSameErrorMessage;
|
|
4
4
|
const isObject_js_1 = require("./isObject.js");
|
|
5
5
|
function isSameErrorMessage(err1, err2) {
|
|
6
6
|
if (!(0, isObject_js_1.isObject)(err1) || !(0, isObject_js_1.isObject)(err2))
|
|
7
7
|
return false;
|
|
8
8
|
return err1.message === err2.message;
|
|
9
9
|
}
|
|
10
|
-
exports.isSameErrorMessage = isSameErrorMessage;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.scriptFileExtensionList = exports.scriptFileExtensions =
|
|
3
|
+
exports.scriptFileExtensionList = exports.scriptFileExtensions = void 0;
|
|
4
|
+
exports.isScriptFile = isScriptFile;
|
|
5
|
+
exports.isJavaScriptFile = isJavaScriptFile;
|
|
6
|
+
exports.isTemplateFile = isTemplateFile;
|
|
4
7
|
const assert_js_1 = require("./assert.js");
|
|
5
8
|
// We can't use a RegExp:
|
|
6
9
|
// - Needs to work with Micromatch: https://github.com/micromatch/micromatch because:
|
|
@@ -50,15 +53,12 @@ function isScriptFile(filePath) {
|
|
|
50
53
|
(0, assert_js_1.assert)(yes);
|
|
51
54
|
return yes;
|
|
52
55
|
}
|
|
53
|
-
exports.isScriptFile = isScriptFile;
|
|
54
56
|
function isJavaScriptFile(filePath) {
|
|
55
57
|
const yes1 = /\.(c|m)?(j|t)s$/.test(filePath);
|
|
56
58
|
const yes2 = extJavaScript.some((ext) => filePath.endsWith('.' + ext));
|
|
57
59
|
(0, assert_js_1.assert)(yes1 === yes2);
|
|
58
60
|
return yes1;
|
|
59
61
|
}
|
|
60
|
-
exports.isJavaScriptFile = isJavaScriptFile;
|
|
61
62
|
function isTemplateFile(filePath) {
|
|
62
63
|
return extTemplates.some((ext) => filePath.endsWith('.' + ext));
|
|
63
64
|
}
|
|
64
|
-
exports.isTemplateFile = isTemplateFile;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isVikeReactApp =
|
|
3
|
+
exports.isVikeReactApp = isVikeReactApp;
|
|
4
4
|
function isVikeReactApp() {
|
|
5
5
|
const g = globalThis;
|
|
6
6
|
// Set by vike-react https://github.com/vikejs/vike-react/blob/23e92434424f10e7e742b6bf587edee5aa8832df/packages/vike-react/src/renderer/onRenderHtml.tsx#L75
|
|
7
7
|
return !!g._isVikeReactApp;
|
|
8
8
|
}
|
|
9
|
-
exports.isVikeReactApp = isVikeReactApp;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isVitest =
|
|
3
|
+
exports.isVitest = isVitest;
|
|
4
4
|
function isVitest() {
|
|
5
5
|
return typeof process !== 'undefined' && typeof process.env !== 'undefined' && 'VITEST' in process.env;
|
|
6
6
|
}
|
|
7
|
-
exports.isVitest = isVitest;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.joinEnglish =
|
|
3
|
+
exports.joinEnglish = joinEnglish;
|
|
4
4
|
const assert_js_1 = require("./assert.js");
|
|
5
5
|
// https://stackoverflow.com/questions/53879088/join-an-array-by-commas-and-and/53879103#53879103
|
|
6
6
|
function joinEnglish(arr, conjunction, colorizer = (s) => s) {
|
|
@@ -11,4 +11,3 @@ function joinEnglish(arr, conjunction, colorizer = (s) => s) {
|
|
|
11
11
|
const last = arr[arr.length - 1];
|
|
12
12
|
return firsts.map(colorizer).join(', ') + `, ${conjunction} ` + colorizer(last);
|
|
13
13
|
}
|
|
14
|
-
exports.joinEnglish = joinEnglish;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.normalizeHeaders =
|
|
3
|
+
exports.normalizeHeaders = normalizeHeaders;
|
|
4
4
|
const isObject_js_1 = require("./isObject.js");
|
|
5
5
|
function normalizeHeaders(
|
|
6
6
|
/* This type is precise, too precise which can be annoying: e.g. cannot pass a string[][] argument because it doesn't match the more precise [string,string][] type.
|
|
@@ -15,4 +15,3 @@ headersOriginal) {
|
|
|
15
15
|
const headers = Object.fromEntries(headersStandard.entries());
|
|
16
16
|
return headers;
|
|
17
17
|
}
|
|
18
|
-
exports.normalizeHeaders = normalizeHeaders;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.objectAssign =
|
|
3
|
+
exports.objectAssign = objectAssign;
|
|
4
4
|
const assert_js_1 = require("./assert.js");
|
|
5
5
|
// Same as Object.assign() but:
|
|
6
6
|
// - With type inference
|
|
@@ -11,4 +11,3 @@ function objectAssign(obj, objAddendum) {
|
|
|
11
11
|
Object.defineProperties(obj, Object.getOwnPropertyDescriptors(objAddendum));
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
exports.objectAssign = objectAssign;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.objectDefineProperty =
|
|
3
|
+
exports.objectDefineProperty = objectDefineProperty;
|
|
4
4
|
/** Like Object.defineProperty() but with type inference */
|
|
5
5
|
function objectDefineProperty(obj, prop, { get, ...args }) {
|
|
6
6
|
Object.defineProperty(obj, prop, { ...args, get });
|
|
7
7
|
}
|
|
8
|
-
exports.objectDefineProperty = objectDefineProperty;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.objectEntries =
|
|
3
|
+
exports.objectEntries = objectEntries;
|
|
4
4
|
// https://stackoverflow.com/questions/60141960/typescript-key-value-relation-preserving-object-entries-type/75337277#75337277
|
|
5
5
|
/** Same as Object.entries() but with type inference */
|
|
6
6
|
function objectEntries(obj) {
|
|
7
7
|
return Object.entries(obj);
|
|
8
8
|
}
|
|
9
|
-
exports.objectEntries = objectEntries;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.objectEntriesForEach =
|
|
3
|
+
exports.objectEntriesForEach = objectEntriesForEach;
|
|
4
4
|
/** Same as Object.entries().forEach() but with type inference */
|
|
5
5
|
function objectEntriesForEach(obj, iterator) {
|
|
6
6
|
Object.entries(obj).forEach(([key, val]) => iterator(key, val));
|
|
7
7
|
}
|
|
8
|
-
exports.objectEntriesForEach = objectEntriesForEach;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.objectFromEntries =
|
|
3
|
+
exports.objectFromEntries = objectFromEntries;
|
|
4
4
|
/** Same as Object.fromEntries() but with type inference */
|
|
5
5
|
function objectFromEntries(arr) {
|
|
6
6
|
return Object.fromEntries(arr);
|
|
7
7
|
}
|
|
8
|
-
exports.objectFromEntries = objectFromEntries;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.objectKeys =
|
|
3
|
+
exports.objectKeys = objectKeys;
|
|
4
4
|
// https://stackoverflow.com/questions/52856496/typescript-object-keys-return-string
|
|
5
5
|
// https://github.com/sindresorhus/ts-extras/blob/main/source/object-keys.ts
|
|
6
6
|
/** Same as Object.keys() but with type inference */
|
|
7
7
|
function objectKeys(obj) {
|
|
8
8
|
return Object.keys(obj);
|
|
9
9
|
}
|
|
10
|
-
exports.objectKeys = objectKeys;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.onPageHide = onPageHide;
|
|
4
|
+
exports.onPageShow = onPageShow;
|
|
4
5
|
function onPageHide(listener) {
|
|
5
6
|
window.addEventListener('visibilitychange', () => {
|
|
6
7
|
if (document.visibilityState === 'hidden') {
|
|
@@ -8,7 +9,6 @@ function onPageHide(listener) {
|
|
|
8
9
|
}
|
|
9
10
|
});
|
|
10
11
|
}
|
|
11
|
-
exports.onPageHide = onPageHide;
|
|
12
12
|
function onPageShow(listener) {
|
|
13
13
|
window.addEventListener('visibilitychange', () => {
|
|
14
14
|
if (document.visibilityState === 'visible') {
|
|
@@ -16,4 +16,3 @@ function onPageShow(listener) {
|
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
|
-
exports.onPageShow = onPageShow;
|
package/dist/cjs/utils/pLimit.js
CHANGED
|
@@ -13,7 +13,7 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
|
|
|
13
13
|
};
|
|
14
14
|
var _Queue_head, _Queue_tail, _Queue_size;
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.pLimit =
|
|
16
|
+
exports.pLimit = pLimit;
|
|
17
17
|
function pLimit(concurrency) {
|
|
18
18
|
if (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {
|
|
19
19
|
throw new TypeError('Expected concurrency to be a number from 1 and up');
|
|
@@ -71,7 +71,6 @@ function pLimit(concurrency) {
|
|
|
71
71
|
// @ts-ignore
|
|
72
72
|
return generator;
|
|
73
73
|
}
|
|
74
|
-
exports.pLimit = pLimit;
|
|
75
74
|
/*
|
|
76
75
|
How it works:
|
|
77
76
|
`this.#head` is an instance of `Node` which keeps track of its current value and nests another instance of `Node` that keeps the value that comes after it. When a value is provided to `.enqueue()`, the code needs to iterate through `this.#head`, going deeper and deeper to find the last value. However, iterating through every single item is slow. This problem is solved by saving a reference to the last value as `this.#tail` so that it can reference it to add a new value.
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.prependBase = prependBase;
|
|
4
|
+
exports.isBaseAssets = isBaseAssets;
|
|
5
|
+
exports.normalizeUrlPathname = normalizeUrlPathname;
|
|
6
|
+
exports.removeBaseServer = removeBaseServer;
|
|
7
|
+
exports.modifyUrlPathname = modifyUrlPathname;
|
|
8
|
+
exports.removeUrlOrigin = removeUrlOrigin;
|
|
9
|
+
exports.addUrlOrigin = addUrlOrigin;
|
|
10
|
+
exports.getUrlPretty = getUrlPretty;
|
|
4
11
|
const parseUrl_js_1 = require("./parseUrl.js");
|
|
5
12
|
const assert_js_1 = require("./assert.js");
|
|
6
13
|
const slice_js_1 = require("./slice.js");
|
|
@@ -22,7 +29,6 @@ function prependBase(url, baseServer) {
|
|
|
22
29
|
(0, assert_js_1.assert)(url.startsWith('/'));
|
|
23
30
|
return `${baseServerNormalized}${url}`;
|
|
24
31
|
}
|
|
25
|
-
exports.prependBase = prependBase;
|
|
26
32
|
function removeBaseServer(url, baseServer) {
|
|
27
33
|
const { hasBaseServer, origin, pathname, pathnameOriginal, searchOriginal, hashOriginal } = (0, parseUrl_js_1.parseUrl)(url, baseServer);
|
|
28
34
|
(0, assert_js_1.assert)(hasBaseServer);
|
|
@@ -30,7 +36,6 @@ function removeBaseServer(url, baseServer) {
|
|
|
30
36
|
const urlWithoutBase = (0, parseUrl_js_1.createUrlFromComponents)(origin, pathname, searchOriginal, hashOriginal);
|
|
31
37
|
return urlWithoutBase;
|
|
32
38
|
}
|
|
33
|
-
exports.removeBaseServer = removeBaseServer;
|
|
34
39
|
function normalizeBaseAssets(baseAssets) {
|
|
35
40
|
let baseAssetsNormalized = baseAssets;
|
|
36
41
|
if (baseAssetsNormalized.endsWith('/')) {
|
|
@@ -51,7 +56,6 @@ function normalizeBaseServer(baseServer) {
|
|
|
51
56
|
function isBaseAssets(base) {
|
|
52
57
|
return base.startsWith('/') || base.startsWith('http://') || base.startsWith('https://');
|
|
53
58
|
}
|
|
54
|
-
exports.isBaseAssets = isBaseAssets;
|
|
55
59
|
function normalizeUrlPathname(urlOriginal, trailingSlash, baseServer) {
|
|
56
60
|
const urlNormalized = modifyUrlPathname(urlOriginal, (urlPathname) => {
|
|
57
61
|
(0, assert_js_1.assert)(urlPathname.startsWith('/'));
|
|
@@ -73,7 +77,6 @@ function normalizeUrlPathname(urlOriginal, trailingSlash, baseServer) {
|
|
|
73
77
|
return null;
|
|
74
78
|
return urlNormalized;
|
|
75
79
|
}
|
|
76
|
-
exports.normalizeUrlPathname = normalizeUrlPathname;
|
|
77
80
|
function normalize(urlPathname) {
|
|
78
81
|
(0, assert_js_1.assert)(urlPathname.startsWith('/'));
|
|
79
82
|
return '/' + urlPathname.split('/').filter(Boolean).join('/');
|
|
@@ -88,13 +91,11 @@ function modifyUrlPathname(url, modifier) {
|
|
|
88
91
|
(0, assert_js_1.assert)((pathnameOriginal === pathnameModified) === (url === urlModified));
|
|
89
92
|
return urlModified;
|
|
90
93
|
}
|
|
91
|
-
exports.modifyUrlPathname = modifyUrlPathname;
|
|
92
94
|
function removeUrlOrigin(url) {
|
|
93
95
|
const { origin, pathnameOriginal, searchOriginal, hashOriginal } = (0, parseUrl_js_1.parseUrl)(url, '/');
|
|
94
96
|
const urlModified = (0, parseUrl_js_1.createUrlFromComponents)(null, pathnameOriginal, searchOriginal, hashOriginal);
|
|
95
97
|
return { urlModified, origin };
|
|
96
98
|
}
|
|
97
|
-
exports.removeUrlOrigin = removeUrlOrigin;
|
|
98
99
|
function addUrlOrigin(url, origin) {
|
|
99
100
|
const { origin: originCurrent, pathnameOriginal, searchOriginal, hashOriginal } = (0, parseUrl_js_1.parseUrl)(url, '/');
|
|
100
101
|
(0, assert_js_1.assert)(originCurrent === null);
|
|
@@ -102,9 +103,7 @@ function addUrlOrigin(url, origin) {
|
|
|
102
103
|
const urlModified = (0, parseUrl_js_1.createUrlFromComponents)(origin, pathnameOriginal, searchOriginal, hashOriginal);
|
|
103
104
|
return urlModified;
|
|
104
105
|
}
|
|
105
|
-
exports.addUrlOrigin = addUrlOrigin;
|
|
106
106
|
function getUrlPretty(url) {
|
|
107
107
|
const { urlModified } = removeUrlOrigin(url);
|
|
108
108
|
return urlModified;
|
|
109
109
|
}
|
|
110
|
-
exports.getUrlPretty = getUrlPretty;
|
|
@@ -6,7 +6,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
6
6
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.
|
|
9
|
+
exports.parseUrl = parseUrl;
|
|
10
|
+
exports.assertUsageUrlPathname = assertUsageUrlPathname;
|
|
11
|
+
exports.assertUsageUrlPathnameAbsolute = assertUsageUrlPathnameAbsolute;
|
|
12
|
+
exports.assertUsageUrlRedirectTarget = assertUsageUrlRedirectTarget;
|
|
13
|
+
exports.isUrl = isUrl;
|
|
14
|
+
exports.isUri = isUri;
|
|
15
|
+
exports.isUrlRedirectTarget = isUrlRedirectTarget;
|
|
16
|
+
exports.isUrlExternal = isUrlExternal;
|
|
17
|
+
exports.isBaseServer = isBaseServer;
|
|
18
|
+
exports.assertUrlComponents = assertUrlComponents;
|
|
19
|
+
exports.createUrlFromComponents = createUrlFromComponents;
|
|
10
20
|
const slice_js_1 = require("./slice.js");
|
|
11
21
|
const assert_js_1 = require("./assert.js");
|
|
12
22
|
const picocolors_1 = __importDefault(require("@brillout/picocolors"));
|
|
@@ -60,7 +70,6 @@ function parseUrl(url, baseServer) {
|
|
|
60
70
|
hashOriginal
|
|
61
71
|
};
|
|
62
72
|
}
|
|
63
|
-
exports.parseUrl = parseUrl;
|
|
64
73
|
function decodeSafe(urlComponent) {
|
|
65
74
|
try {
|
|
66
75
|
return decodeURIComponent(urlComponent);
|
|
@@ -232,33 +241,27 @@ function removeBaseServer(pathnameAbsoluteWithBase, baseServer) {
|
|
|
232
241
|
function isBaseServer(baseServer) {
|
|
233
242
|
return baseServer.startsWith('/');
|
|
234
243
|
}
|
|
235
|
-
exports.isBaseServer = isBaseServer;
|
|
236
244
|
function assertUrlComponents(url, origin, pathnameOriginal, searchOriginal, hashOriginal) {
|
|
237
245
|
const urlRecreated = createUrlFromComponents(origin, pathnameOriginal, searchOriginal, hashOriginal);
|
|
238
246
|
(0, assert_js_1.assert)(url === urlRecreated);
|
|
239
247
|
}
|
|
240
|
-
exports.assertUrlComponents = assertUrlComponents;
|
|
241
248
|
function createUrlFromComponents(origin, pathname, search, hash) {
|
|
242
249
|
const urlRecreated = `${origin || ''}${pathname}${search || ''}${hash || ''}`;
|
|
243
250
|
return urlRecreated;
|
|
244
251
|
}
|
|
245
|
-
exports.createUrlFromComponents = createUrlFromComponents;
|
|
246
252
|
function isUrl(url) {
|
|
247
253
|
// parseUrl() works with these URLs
|
|
248
254
|
return isUrlWithProtocol(url) || url.startsWith('/') || isUrlPathnameRelative(url);
|
|
249
255
|
}
|
|
250
|
-
exports.isUrl = isUrl;
|
|
251
256
|
function isUrlRedirectTarget(url) {
|
|
252
257
|
return url.startsWith('/') || isUri(url) || isUrlWithProtocol(url);
|
|
253
258
|
}
|
|
254
|
-
exports.isUrlRedirectTarget = isUrlRedirectTarget;
|
|
255
259
|
function isUrlPathnameRelative(url) {
|
|
256
260
|
return ['.', '?', '#'].some((c) => url.startsWith(c)) || url === '';
|
|
257
261
|
}
|
|
258
262
|
function isUrlExternal(url) {
|
|
259
263
|
return !url.startsWith('/') && !isUrlPathnameRelative(url);
|
|
260
264
|
}
|
|
261
|
-
exports.isUrlExternal = isUrlExternal;
|
|
262
265
|
/*
|
|
263
266
|
URL with protocol.
|
|
264
267
|
|
|
@@ -294,19 +297,15 @@ function isUri(uri) {
|
|
|
294
297
|
const { protocol } = parseProtocol(uri);
|
|
295
298
|
return !!protocol && !isUrlProtocol(uri);
|
|
296
299
|
}
|
|
297
|
-
exports.isUri = isUri;
|
|
298
300
|
function assertUsageUrlPathname(url, errPrefix) {
|
|
299
301
|
assertUsageUrl(url, errPrefix, { allowRelative: true });
|
|
300
302
|
}
|
|
301
|
-
exports.assertUsageUrlPathname = assertUsageUrlPathname;
|
|
302
303
|
function assertUsageUrlPathnameAbsolute(url, errPrefix) {
|
|
303
304
|
assertUsageUrl(url, errPrefix);
|
|
304
305
|
}
|
|
305
|
-
exports.assertUsageUrlPathnameAbsolute = assertUsageUrlPathnameAbsolute;
|
|
306
306
|
function assertUsageUrlRedirectTarget(url, errPrefix, isUnresolved) {
|
|
307
307
|
assertUsageUrl(url, errPrefix, { isRedirectTarget: isUnresolved ? 'unresolved' : true });
|
|
308
308
|
}
|
|
309
|
-
exports.assertUsageUrlRedirectTarget = assertUsageUrlRedirectTarget;
|
|
310
309
|
function assertUsageUrl(url, errPrefix, { allowRelative, isRedirectTarget } = {}) {
|
|
311
310
|
if (url.startsWith('/'))
|
|
312
311
|
return;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pathJoin =
|
|
3
|
+
exports.pathJoin = pathJoin;
|
|
4
4
|
// Simple shim for `import * from "node:path"` used by the server runtime.
|
|
5
5
|
// Robust alternative: https://github.com/unjs/pathe
|
|
6
6
|
const assert_js_1 = require("./assert.js");
|
|
@@ -12,4 +12,3 @@ function pathJoin(path1, path2) {
|
|
|
12
12
|
joined = '/' + joined;
|
|
13
13
|
return joined;
|
|
14
14
|
}
|
|
15
|
-
exports.pathJoin = pathJoin;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.removeEmptyLines =
|
|
3
|
+
exports.removeEmptyLines = removeEmptyLines;
|
|
4
4
|
function removeEmptyLines(msg) {
|
|
5
5
|
return msg
|
|
6
6
|
.split('\n')
|
|
7
7
|
.filter((line) => line.trim() !== '')
|
|
8
8
|
.join('\n');
|
|
9
9
|
}
|
|
10
|
-
exports.removeEmptyLines = removeEmptyLines;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.removeFileExtention =
|
|
3
|
+
exports.removeFileExtention = removeFileExtention;
|
|
4
4
|
function removeFileExtention(filePath) {
|
|
5
5
|
return filePath.split('.').slice(0, -1).join('.');
|
|
6
6
|
}
|
|
7
|
-
exports.removeFileExtention = removeFileExtention;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.requireResolve =
|
|
3
|
+
exports.requireResolve = requireResolve;
|
|
4
4
|
const assert_js_1 = require("./assert.js");
|
|
5
5
|
const assertIsNotBrowser_js_1 = require("./assertIsNotBrowser.js");
|
|
6
6
|
const assertIsNotProductionRuntime_js_1 = require("./assertIsNotProductionRuntime.js");
|
|
@@ -31,7 +31,6 @@ function requireResolve(importPath, cwd) {
|
|
|
31
31
|
}
|
|
32
32
|
return importedFile;
|
|
33
33
|
}
|
|
34
|
-
exports.requireResolve = requireResolve;
|
|
35
34
|
function removeFileExtention(importPath) {
|
|
36
35
|
for (const ext of isScriptFile_js_1.scriptFileExtensionList) {
|
|
37
36
|
const suffix = `.${ext}`;
|
package/dist/cjs/utils/sleep.js
CHANGED
package/dist/cjs/utils/slice.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.slice =
|
|
3
|
+
exports.slice = slice;
|
|
4
4
|
const assert_js_1 = require("./assert.js");
|
|
5
5
|
function slice(thing, from, to) {
|
|
6
6
|
if (typeof thing === 'string') {
|
|
@@ -10,7 +10,6 @@ function slice(thing, from, to) {
|
|
|
10
10
|
return sliceArray(thing, from, to);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
exports.slice = slice;
|
|
14
13
|
function sliceArray(list, from, to) {
|
|
15
14
|
const listSlice = [];
|
|
16
15
|
let start = from >= 0 ? from : list.length + from;
|
package/dist/cjs/utils/sorter.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.higherFirst = higherFirst;
|
|
4
|
+
exports.lowerFirst = lowerFirst;
|
|
5
|
+
exports.makeFirst = makeFirst;
|
|
6
|
+
exports.makeLast = makeLast;
|
|
7
|
+
exports.reverse = reverse;
|
|
4
8
|
const assert_js_1 = require("./assert.js");
|
|
5
9
|
// -1 => element1 first (i.e. `indexOf(element1) < indexOf(element2)`)
|
|
6
10
|
// +1 => element2 first (i.e. `indexOf(element2) < indexOf(element1)`)
|
|
@@ -30,7 +34,6 @@ function higherFirst(getValue) {
|
|
|
30
34
|
return val1 > val2 ? -1 : 1;
|
|
31
35
|
};
|
|
32
36
|
}
|
|
33
|
-
exports.higherFirst = higherFirst;
|
|
34
37
|
/**
|
|
35
38
|
* ```js
|
|
36
39
|
* let arr = [
|
|
@@ -56,7 +59,6 @@ function lowerFirst(getValue) {
|
|
|
56
59
|
return val1 < val2 ? -1 : 1;
|
|
57
60
|
};
|
|
58
61
|
}
|
|
59
|
-
exports.lowerFirst = lowerFirst;
|
|
60
62
|
/**
|
|
61
63
|
* ```js
|
|
62
64
|
* let arr = [
|
|
@@ -88,7 +90,6 @@ function makeFirst(getValue) {
|
|
|
88
90
|
(0, assert_js_1.assert)(false);
|
|
89
91
|
};
|
|
90
92
|
}
|
|
91
|
-
exports.makeFirst = makeFirst;
|
|
92
93
|
/**
|
|
93
94
|
* ```js
|
|
94
95
|
* let arr = [
|
|
@@ -113,9 +114,7 @@ function makeLast(getValue) {
|
|
|
113
114
|
}
|
|
114
115
|
});
|
|
115
116
|
}
|
|
116
|
-
exports.makeLast = makeLast;
|
|
117
117
|
/** Reverse order result. */
|
|
118
118
|
function reverse(sortKey) {
|
|
119
119
|
return (-1 * sortKey);
|
|
120
120
|
}
|
|
121
|
-
exports.reverse = reverse;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.stringifyStringArray =
|
|
3
|
+
exports.stringifyStringArray = stringifyStringArray;
|
|
4
4
|
function stringifyStringArray(stringList) {
|
|
5
5
|
return '[' + stringList.map((str) => "'" + str + "'").join(', ') + ']';
|
|
6
6
|
}
|
|
7
|
-
exports.stringifyStringArray = stringifyStringArray;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.stripAnsi =
|
|
3
|
+
exports.stripAnsi = stripAnsi;
|
|
4
4
|
const assertIsNotBrowser_js_1 = require("./assertIsNotBrowser.js");
|
|
5
5
|
(0, assertIsNotBrowser_js_1.assertIsNotBrowser)();
|
|
6
6
|
const ansiRegex = getAnsiRegex();
|
|
@@ -11,7 +11,6 @@ function stripAnsi(string) {
|
|
|
11
11
|
// and doing it manually has a performance penalty.
|
|
12
12
|
return string.replace(ansiRegex, '');
|
|
13
13
|
}
|
|
14
|
-
exports.stripAnsi = stripAnsi;
|
|
15
14
|
// Copied from https://github.com/chalk/ansi-regex/blob/02fa893d619d3da85411acc8fd4e2eea0e95a9d9/index.js
|
|
16
15
|
function getAnsiRegex() {
|
|
17
16
|
const pattern = [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.throttle =
|
|
3
|
+
exports.throttle = throttle;
|
|
4
4
|
function throttle(func, waitTime) {
|
|
5
5
|
let isQueued = false;
|
|
6
6
|
return () => {
|
|
@@ -13,4 +13,3 @@ function throttle(func, waitTime) {
|
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
exports.throttle = throttle;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.trimWithAnsi = trimWithAnsi;
|
|
4
|
+
exports.trimWithAnsiTrailOnly = trimWithAnsiTrailOnly;
|
|
4
5
|
const assert_js_1 = require("./assert.js");
|
|
5
6
|
const stripAnsi_js_1 = require("./stripAnsi.js");
|
|
6
7
|
const whitespaceRegex = /(\s+)/; // Capturing parathesis so that split preserves seperator
|
|
@@ -10,14 +11,12 @@ function trimWithAnsi(str) {
|
|
|
10
11
|
str = trimWithAnsiTrailOnly(str);
|
|
11
12
|
return str;
|
|
12
13
|
}
|
|
13
|
-
exports.trimWithAnsi = trimWithAnsi;
|
|
14
14
|
function trimWithAnsiHead(str) {
|
|
15
15
|
return trim(str, false);
|
|
16
16
|
}
|
|
17
17
|
function trimWithAnsiTrailOnly(str) {
|
|
18
18
|
return trim(str, true);
|
|
19
19
|
}
|
|
20
|
-
exports.trimWithAnsiTrailOnly = trimWithAnsiTrailOnly;
|
|
21
20
|
function trim(str, trail) {
|
|
22
21
|
let parts = str.split(whitespaceRegex);
|
|
23
22
|
if (trail)
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.truncateString =
|
|
6
|
+
exports.truncateString = truncateString;
|
|
7
7
|
const picocolors_1 = __importDefault(require("@brillout/picocolors"));
|
|
8
8
|
const assert_js_1 = require("./assert.js");
|
|
9
9
|
function truncateString(str, lenMax) {
|
|
@@ -21,4 +21,3 @@ function truncateString(str, lenMax) {
|
|
|
21
21
|
return str;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
exports.truncateString = truncateString;
|
package/dist/cjs/utils/unique.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.baseServer =
|
|
3
|
+
exports.baseServer = void 0;
|
|
4
|
+
exports.urlToFile = urlToFile;
|
|
4
5
|
const assert_js_1 = require("./assert.js");
|
|
5
6
|
const parseUrl_js_1 = require("./parseUrl.js");
|
|
6
7
|
const slice_js_1 = require("./slice.js");
|
|
@@ -33,4 +34,3 @@ function urlToFile(url, fileExtension, doNotCreateExtraDirectory) {
|
|
|
33
34
|
const fileUrl = `${pathnameModified}${searchOriginal || ''}${hashOriginal || ''}`;
|
|
34
35
|
return fileUrl;
|
|
35
36
|
}
|
|
36
|
-
exports.urlToFile = urlToFile;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.isVirtualFileId = isVirtualFileId;
|
|
4
|
+
exports.getVirtualFileId = getVirtualFileId;
|
|
5
|
+
exports.resolveVirtualFileId = resolveVirtualFileId;
|
|
4
6
|
const assert_js_1 = require("./assert.js");
|
|
5
7
|
const idBase = 'virtual:vike:';
|
|
6
8
|
// https://vitejs.dev/guide/api-plugin.html#virtual-modules-convention
|
|
@@ -13,7 +15,6 @@ function isVirtualFileId(id) {
|
|
|
13
15
|
(0, assert_js_1.assert)(!id.includes(idBase));
|
|
14
16
|
return false;
|
|
15
17
|
}
|
|
16
|
-
exports.isVirtualFileId = isVirtualFileId;
|
|
17
18
|
function getVirtualFileId(id) {
|
|
18
19
|
if (id.startsWith(tag)) {
|
|
19
20
|
id = id.slice(tag.length);
|
|
@@ -21,7 +22,6 @@ function getVirtualFileId(id) {
|
|
|
21
22
|
(0, assert_js_1.assert)(!id.startsWith(tag));
|
|
22
23
|
return id;
|
|
23
24
|
}
|
|
24
|
-
exports.getVirtualFileId = getVirtualFileId;
|
|
25
25
|
function resolveVirtualFileId(id) {
|
|
26
26
|
(0, assert_js_1.assert)(isVirtualFileId(id));
|
|
27
27
|
if (!id.startsWith(tag)) {
|
|
@@ -30,4 +30,3 @@ function resolveVirtualFileId(id) {
|
|
|
30
30
|
(0, assert_js_1.assert)(id.startsWith(tag));
|
|
31
31
|
return id;
|
|
32
32
|
}
|
|
33
|
-
exports.resolveVirtualFileId = resolveVirtualFileId;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.viteIsSSR = viteIsSSR;
|
|
4
|
+
exports.viteIsSSR_options = viteIsSSR_options;
|
|
4
5
|
const assert_js_1 = require("./assert.js");
|
|
5
6
|
const isObject_js_1 = require("./isObject.js");
|
|
6
7
|
function viteIsSSR(config) {
|
|
7
8
|
return !!config?.build?.ssr;
|
|
8
9
|
}
|
|
9
|
-
exports.viteIsSSR = viteIsSSR;
|
|
10
10
|
// https://github.com/vitejs/vite/discussions/5109#discussioncomment-1450726
|
|
11
11
|
function viteIsSSR_options(options) {
|
|
12
12
|
if (options === undefined) {
|
|
@@ -20,4 +20,3 @@ function viteIsSSR_options(options) {
|
|
|
20
20
|
}
|
|
21
21
|
(0, assert_js_1.assert)(false);
|
|
22
22
|
}
|
|
23
|
-
exports.viteIsSSR_options = viteIsSSR_options;
|