vike 0.4.195-commit-486b49a → 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/client/client-routing-runtime/installClientRouter.js +2 -4
- package/dist/esm/client/client-routing-runtime/navigate.js +3 -1
- package/dist/esm/client/client-routing-runtime/renderPageClientSide.d.ts +2 -0
- package/dist/esm/client/client-routing-runtime/renderPageClientSide.js +14 -2
- package/dist/esm/client/client-routing-runtime/skipLink.js +1 -1
- package/dist/esm/client/client-routing-runtime/utils.d.ts +1 -0
- package/dist/esm/client/client-routing-runtime/utils.js +1 -0
- 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/genPromise.d.ts +1 -1
- 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.compareString =
|
|
3
|
+
exports.compareString = compareString;
|
|
4
4
|
function compareString(str1, str2) {
|
|
5
5
|
if (str1.toLowerCase() < str2.toLowerCase())
|
|
6
6
|
return -1;
|
|
@@ -8,4 +8,3 @@ function compareString(str1, str2) {
|
|
|
8
8
|
return 1;
|
|
9
9
|
return 0;
|
|
10
10
|
}
|
|
11
|
-
exports.compareString = compareString;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createErrorWithCleanStackTrace =
|
|
3
|
+
exports.createErrorWithCleanStackTrace = createErrorWithCleanStackTrace;
|
|
4
4
|
const isNodeJS_js_1 = require("./isNodeJS.js");
|
|
5
5
|
function createErrorWithCleanStackTrace(errorMessage, numberOfStackTraceLinesToRemove) {
|
|
6
6
|
const err = new Error(errorMessage);
|
|
@@ -9,7 +9,6 @@ function createErrorWithCleanStackTrace(errorMessage, numberOfStackTraceLinesToR
|
|
|
9
9
|
}
|
|
10
10
|
return err;
|
|
11
11
|
}
|
|
12
|
-
exports.createErrorWithCleanStackTrace = createErrorWithCleanStackTrace;
|
|
13
12
|
function clean(errStack, numberOfStackTraceLinesToRemove) {
|
|
14
13
|
if (!errStack) {
|
|
15
14
|
return errStack;
|
package/dist/cjs/utils/debug.js
CHANGED
|
@@ -3,7 +3,8 @@ 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.
|
|
6
|
+
exports.createDebugger = createDebugger;
|
|
7
|
+
exports.isDebugActivated = isDebugActivated;
|
|
7
8
|
const isBrowser_js_1 = require("./isBrowser.js");
|
|
8
9
|
const isCallable_js_1 = require("./isCallable.js");
|
|
9
10
|
const objectAssign_js_1 = require("./objectAssign.js");
|
|
@@ -45,7 +46,6 @@ function createDebugger(flag, optionsGlobal) {
|
|
|
45
46
|
(0, objectAssign_js_1.objectAssign)(debug, { options: debugWithOptions, isActivated: isDebugActivated(flag) });
|
|
46
47
|
return debug;
|
|
47
48
|
}
|
|
48
|
-
exports.createDebugger = createDebugger;
|
|
49
49
|
function debug_(flag, options, ...msgs) {
|
|
50
50
|
if (!isDebugActivated(flag))
|
|
51
51
|
return;
|
|
@@ -79,7 +79,6 @@ function isDebugActivated(flag) {
|
|
|
79
79
|
const isActivated = DEBUG?.includes(flag) ?? false;
|
|
80
80
|
return isActivated;
|
|
81
81
|
}
|
|
82
|
-
exports.isDebugActivated = isDebugActivated;
|
|
83
82
|
function formatMsg(info, options, padding, position) {
|
|
84
83
|
if (info === undefined) {
|
|
85
84
|
return undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deepEqual =
|
|
3
|
+
exports.deepEqual = deepEqual;
|
|
4
4
|
// https://stackoverflow.com/questions/201183/how-to-determine-equality-for-two-javascript-objects/32922084#32922084
|
|
5
5
|
function deepEqual(x, y) {
|
|
6
6
|
const ok = Object.keys, tx = typeof x, ty = typeof y;
|
|
@@ -8,4 +8,3 @@ function deepEqual(x, y) {
|
|
|
8
8
|
? ok(x).length === ok(y).length && ok(x).every((key) => deepEqual(x[key], y[key]))
|
|
9
9
|
: x === y;
|
|
10
10
|
}
|
|
11
|
-
exports.deepEqual = deepEqual;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.escapeHtml =
|
|
3
|
+
exports.escapeHtml = escapeHtml;
|
|
4
4
|
// Copied from https://stackoverflow.com/questions/6234773/can-i-escape-html-special-chars-in-javascript/6234804#6234804
|
|
5
5
|
function escapeHtml(unsafeString) {
|
|
6
6
|
const safe = unsafeString
|
|
@@ -11,4 +11,3 @@ function escapeHtml(unsafeString) {
|
|
|
11
11
|
.replace(/'/g, ''');
|
|
12
12
|
return safe;
|
|
13
13
|
}
|
|
14
|
-
exports.escapeHtml = escapeHtml;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.escapeRegex =
|
|
3
|
+
exports.escapeRegex = escapeRegex;
|
|
4
4
|
function escapeRegex(str) {
|
|
5
5
|
// https://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript/3561711#3561711
|
|
6
6
|
return str.replace(/[/\-\\^$*+?.()|[\]{}]/g, '\\$&');
|
|
7
7
|
}
|
|
8
|
-
exports.escapeRegex = escapeRegex;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.toPosixPath = toPosixPath;
|
|
4
|
+
exports.assertPosixPath = assertPosixPath;
|
|
4
5
|
const assert_js_1 = require("./assert.js");
|
|
5
6
|
function toPosixPath(path) {
|
|
6
7
|
const pathPosix = path.split('\\').join('/');
|
|
7
8
|
assertPosixPath(pathPosix);
|
|
8
9
|
return pathPosix;
|
|
9
10
|
}
|
|
10
|
-
exports.toPosixPath = toPosixPath;
|
|
11
11
|
function assertPosixPath(path) {
|
|
12
12
|
const errMsg = (msg) => `Not a posix path: ${msg}`;
|
|
13
13
|
(0, assert_js_1.assert)(path !== null, errMsg('null'));
|
|
@@ -16,4 +16,3 @@ function assertPosixPath(path) {
|
|
|
16
16
|
(0, assert_js_1.assert)(path);
|
|
17
17
|
(0, assert_js_1.assert)(!path.includes('\\'), errMsg(path));
|
|
18
18
|
}
|
|
19
|
-
exports.assertPosixPath = assertPosixPath;
|
|
@@ -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.findFile =
|
|
6
|
+
exports.findFile = findFile;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
8
|
const fs_1 = __importDefault(require("fs"));
|
|
9
9
|
const isArray_js_1 = require("./isArray.js");
|
|
@@ -27,4 +27,3 @@ function findFile(arg, cwd) {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
exports.findFile = findFile;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.findPackageJson =
|
|
3
|
+
exports.findPackageJson = findPackageJson;
|
|
4
4
|
const findFile_js_1 = require("./findFile.js");
|
|
5
5
|
const module_1 = require("module");
|
|
6
6
|
// @ts-ignore Shimmed by dist-cjs-fixup.js for CJS build.
|
|
@@ -16,4 +16,3 @@ function findPackageJson(cwd) {
|
|
|
16
16
|
packageJsonPath
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
exports.findPackageJson = findPackageJson;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.formatHintLog =
|
|
3
|
+
exports.formatHintLog = formatHintLog;
|
|
4
4
|
const assert_js_1 = require("./assert.js");
|
|
5
5
|
const stripAnsi_js_1 = require("./stripAnsi.js");
|
|
6
6
|
function formatHintLog(msg) {
|
|
@@ -15,4 +15,3 @@ function formatHintLog(msg) {
|
|
|
15
15
|
`└─${sep}─┘`
|
|
16
16
|
].join('\n');
|
|
17
17
|
}
|
|
18
|
-
exports.formatHintLog = formatHintLog;
|
|
@@ -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.freezePartial =
|
|
6
|
+
exports.freezePartial = freezePartial;
|
|
7
7
|
const picocolors_1 = __importDefault(require("@brillout/picocolors"));
|
|
8
8
|
// Unit tests at ./freezePartial.spec.ts
|
|
9
9
|
const assertIsNotBrowser_js_1 = require("./assertIsNotBrowser.js");
|
|
@@ -33,4 +33,3 @@ function freezePartial(obj, allowList) {
|
|
|
33
33
|
});
|
|
34
34
|
Object.preventExtensions(obj);
|
|
35
35
|
}
|
|
36
|
-
exports.freezePartial = freezePartial;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.genPromise =
|
|
3
|
+
exports.genPromise = genPromise;
|
|
4
4
|
function genPromise() {
|
|
5
5
|
let resolve;
|
|
6
6
|
const promise = new Promise((r) => (resolve = r));
|
|
7
7
|
return { promise, resolve };
|
|
8
8
|
}
|
|
9
|
-
exports.genPromise = genPromise;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getCurrentUrl =
|
|
3
|
+
exports.getCurrentUrl = getCurrentUrl;
|
|
4
4
|
const parseUrl_js_1 = require("./parseUrl.js");
|
|
5
5
|
const assert_js_1 = require("./assert.js");
|
|
6
6
|
function getCurrentUrl(options) {
|
|
@@ -16,4 +16,3 @@ function getCurrentUrl(options) {
|
|
|
16
16
|
(0, assert_js_1.assert)(urlCurrent.startsWith('/'));
|
|
17
17
|
return urlCurrent;
|
|
18
18
|
}
|
|
19
|
-
exports.getCurrentUrl = getCurrentUrl;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getFileExtension =
|
|
3
|
+
exports.getFileExtension = getFileExtension;
|
|
4
4
|
const slice_js_1 = require("./slice.js");
|
|
5
5
|
function getFileExtension(id) {
|
|
6
6
|
id = id.split('?')[0];
|
|
@@ -14,4 +14,3 @@ function getFileExtension(id) {
|
|
|
14
14
|
}
|
|
15
15
|
return fileExtension;
|
|
16
16
|
}
|
|
17
|
-
exports.getFileExtension = getFileExtension;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getGlobalObject = getGlobalObject;
|
|
4
|
+
exports.assertIsSingleModuleInstance = assertIsSingleModuleInstance;
|
|
4
5
|
const assert_js_1 = require("./assert.js");
|
|
5
6
|
const projectInfo_js_1 = require("./projectInfo.js");
|
|
6
7
|
const projectKey = `_${projectInfo_js_1.projectInfo.projectName.toLowerCase()}`;
|
|
@@ -12,7 +13,6 @@ key, defaultValue) {
|
|
|
12
13
|
const globalObject = (globalObjects[key] = globalObjects[key] || defaultValue);
|
|
13
14
|
return globalObject;
|
|
14
15
|
}
|
|
15
|
-
exports.getGlobalObject = getGlobalObject;
|
|
16
16
|
/** Assert that the module is instantiated only once. */
|
|
17
17
|
function assertIsSingleModuleInstance(
|
|
18
18
|
// We use the filename (or file path) as key.
|
|
@@ -20,7 +20,6 @@ key) {
|
|
|
20
20
|
const globalObjects = getGlobalObjects();
|
|
21
21
|
(0, assert_js_1.assert)(!(key in globalObjects));
|
|
22
22
|
}
|
|
23
|
-
exports.assertIsSingleModuleInstance = assertIsSingleModuleInstance;
|
|
24
23
|
function getGlobalObjects() {
|
|
25
24
|
// @ts-ignore
|
|
26
25
|
const globalObjects = (globalThis[projectKey] = globalThis[projectKey] || {});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getMostSimilar =
|
|
3
|
+
exports.getMostSimilar = getMostSimilar;
|
|
4
4
|
const assert_js_1 = require("./assert.js");
|
|
5
5
|
const sorter_js_1 = require("./sorter.js");
|
|
6
6
|
const assertIsNotBrowser_js_1 = require("./assertIsNotBrowser.js");
|
|
@@ -28,7 +28,6 @@ function getMostSimilar(word, words) {
|
|
|
28
28
|
return null;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
exports.getMostSimilar = getMostSimilar;
|
|
32
31
|
// https://stackoverflow.com/questions/10473745/compare-strings-javascript-return-of-likely/36566052#36566052
|
|
33
32
|
function getSimilarity(s1, s2) {
|
|
34
33
|
var longer = s1;
|
|
@@ -3,7 +3,8 @@ 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.
|
|
6
|
+
exports.getOutDirs = getOutDirs;
|
|
7
|
+
exports.resolveOutDir = resolveOutDir;
|
|
7
8
|
const viteIsSSR_js_1 = require("./viteIsSSR.js");
|
|
8
9
|
const assert_js_1 = require("./assert.js");
|
|
9
10
|
const path_shim_js_1 = require("./path-shim.js");
|
|
@@ -31,7 +32,6 @@ function getOutDirs(config) {
|
|
|
31
32
|
debug('outDirs', outDirs);
|
|
32
33
|
return outDirs;
|
|
33
34
|
}
|
|
34
|
-
exports.getOutDirs = getOutDirs;
|
|
35
35
|
/** Appends `client/` or `server/` to `config.build.outDir` */
|
|
36
36
|
function resolveOutDir(config) {
|
|
37
37
|
debug('resolveOutDir()', new Error().stack);
|
|
@@ -54,7 +54,6 @@ function resolveOutDir(config) {
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
exports.resolveOutDir = resolveOutDir;
|
|
58
57
|
function determineOutDirs(outDirRoot) {
|
|
59
58
|
(0, filesystemPathHandling_js_1.assertPosixPath)(outDirRoot);
|
|
60
59
|
(0, assert_js_1.assert)(!outDirRoot.endsWith('/'));
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getPropAccessNotation =
|
|
3
|
+
exports.getPropAccessNotation = getPropAccessNotation;
|
|
4
4
|
function getPropAccessNotation(key) {
|
|
5
5
|
return typeof key === 'string' && isKeyDotNotationCompatible(key) ? `.${key}` : `[${JSON.stringify(key)}]`;
|
|
6
6
|
}
|
|
7
|
-
exports.getPropAccessNotation = getPropAccessNotation;
|
|
8
7
|
function isKeyDotNotationCompatible(key) {
|
|
9
8
|
return /^[a-z0-9\$_]+$/i.test(key);
|
|
10
9
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getRandomId =
|
|
3
|
+
exports.getRandomId = getRandomId;
|
|
4
4
|
const assert_js_1 = require("./assert.js");
|
|
5
5
|
// https://stackoverflow.com/questions/1349404/generate-random-string-characters-in-javascript
|
|
6
6
|
function getRandomId(length) {
|
|
@@ -12,4 +12,3 @@ function getRandomId(length) {
|
|
|
12
12
|
(0, assert_js_1.assert)(/^[a-z0-9]+$/.test(randomId) && randomId.length === length);
|
|
13
13
|
return randomId;
|
|
14
14
|
}
|
|
15
|
-
exports.getRandomId = getRandomId;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTerminalWidth =
|
|
3
|
+
exports.getTerminalWidth = getTerminalWidth;
|
|
4
4
|
function getTerminalWidth() {
|
|
5
5
|
// https://stackoverflow.com/questions/30335637/get-width-of-terminal-in-node-js/30335724#30335724
|
|
6
6
|
return ((typeof process !== 'undefined' && typeof process.stdout !== 'undefined' && process.stdout.columns) || undefined);
|
|
7
7
|
}
|
|
8
|
-
exports.getTerminalWidth = getTerminalWidth;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getValuePrintable =
|
|
3
|
+
exports.getValuePrintable = getValuePrintable;
|
|
4
4
|
function getValuePrintable(value) {
|
|
5
5
|
if ([null, undefined].includes(value))
|
|
6
6
|
return String(value);
|
|
@@ -8,4 +8,3 @@ function getValuePrintable(value) {
|
|
|
8
8
|
return JSON.stringify(value);
|
|
9
9
|
return null;
|
|
10
10
|
}
|
|
11
|
-
exports.getValuePrintable = getValuePrintable;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.hasProp =
|
|
3
|
+
exports.hasProp = hasProp;
|
|
4
4
|
const isCallable_js_1 = require("./isCallable.js");
|
|
5
5
|
const isObject_js_1 = require("./isObject.js");
|
|
6
6
|
const isArrayOfStrings_js_1 = require("./isArrayOfStrings.js");
|
|
@@ -48,4 +48,3 @@ function hasProp(obj, prop, type) {
|
|
|
48
48
|
}
|
|
49
49
|
return typeof propValue === type;
|
|
50
50
|
}
|
|
51
|
-
exports.hasProp = hasProp;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.humanizeTime =
|
|
3
|
+
exports.humanizeTime = humanizeTime;
|
|
4
4
|
function humanizeTime(milliseconds) {
|
|
5
5
|
const seconds = milliseconds / 1000;
|
|
6
6
|
if (seconds < 120) {
|
|
@@ -13,7 +13,6 @@ function humanizeTime(milliseconds) {
|
|
|
13
13
|
return `${n} minute${plural(n)}`;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
exports.humanizeTime = humanizeTime;
|
|
17
16
|
function round(n) {
|
|
18
17
|
let rounded = n.toFixed(1);
|
|
19
18
|
if (rounded.endsWith('.0'))
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.includes =
|
|
3
|
+
exports.includes = includes;
|
|
4
4
|
// https://stackoverflow.com/questions/56565528/typescript-const-assertions-how-to-use-array-prototype-includes/74213179#74213179
|
|
5
5
|
/** Same as Array.prototype.includes() but with type inference */
|
|
6
6
|
function includes(values, x) {
|
|
7
7
|
return values.includes(x);
|
|
8
8
|
}
|
|
9
|
-
exports.includes = includes;
|
|
10
9
|
/*
|
|
11
10
|
export function includes<Arr extends any[] | readonly any[]>(arr: Arr, el: unknown): el is Arr[number] {
|
|
12
11
|
return arr.includes(el as any)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.injectRollupInputs = injectRollupInputs;
|
|
4
|
+
exports.normalizeRollupInput = normalizeRollupInput;
|
|
4
5
|
const assert_js_1 = require("./assert.js");
|
|
5
6
|
const isObject_js_1 = require("./isObject.js");
|
|
6
7
|
const isArray_js_1 = require("./isArray.js");
|
|
@@ -12,7 +13,6 @@ function injectRollupInputs(inputsNew, config) {
|
|
|
12
13
|
};
|
|
13
14
|
return input;
|
|
14
15
|
}
|
|
15
|
-
exports.injectRollupInputs = injectRollupInputs;
|
|
16
16
|
function normalizeRollupInput(input) {
|
|
17
17
|
if (!input) {
|
|
18
18
|
return {};
|
|
@@ -27,4 +27,3 @@ function normalizeRollupInput(input) {
|
|
|
27
27
|
(0, assert_js_1.assert)((0, isObject_js_1.isObject)(input));
|
|
28
28
|
return input;
|
|
29
29
|
}
|
|
30
|
-
exports.normalizeRollupInput = normalizeRollupInput;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isArray =
|
|
3
|
+
exports.isArray = isArray;
|
|
4
4
|
// Same as Array.isArray() but typesafe: asserts unknown[] instead of any[]
|
|
5
5
|
function isArray(value) {
|
|
6
6
|
return Array.isArray(value);
|
|
7
7
|
}
|
|
8
|
-
exports.isArray = isArray;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isArrayOfStrings =
|
|
3
|
+
exports.isArrayOfStrings = isArrayOfStrings;
|
|
4
4
|
const isArray_js_1 = require("./isArray.js");
|
|
5
5
|
function isArrayOfStrings(val) {
|
|
6
6
|
return (0, isArray_js_1.isArray)(val) && val.every((v) => typeof v === 'string');
|
|
7
7
|
}
|
|
8
|
-
exports.isArrayOfStrings = isArrayOfStrings;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isBrowser =
|
|
3
|
+
exports.isBrowser = isBrowser;
|
|
4
4
|
function isBrowser() {
|
|
5
5
|
// Using `typeof window !== 'undefined'` alone is not enough because some users use https://www.npmjs.com/package/ssr-window
|
|
6
6
|
return typeof window !== 'undefined' && typeof window.scrollY === 'number';
|
|
7
7
|
// Alternatively, test whether environment is a *real* browser: https://github.com/brillout/picocolors/blob/d59a33a0fd52a8a33e4158884069192a89ce0113/picocolors.js#L87-L89
|
|
8
8
|
}
|
|
9
|
-
exports.isBrowser = isBrowser;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isCallable =
|
|
3
|
+
exports.isCallable = isCallable;
|
|
4
4
|
function isCallable(thing) {
|
|
5
5
|
return thing instanceof Function || typeof thing === 'function';
|
|
6
6
|
}
|
|
7
|
-
exports.isCallable = isCallable;
|
package/dist/cjs/utils/isDev.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.isDev2 = isDev2;
|
|
4
|
+
exports.isDev3 = isDev3;
|
|
4
5
|
const assert_js_1 = require("./assert.js");
|
|
5
6
|
function isDev3(configEnv) {
|
|
6
7
|
const { isPreview, command } = configEnv;
|
|
@@ -13,7 +14,6 @@ function isDev3(configEnv) {
|
|
|
13
14
|
(0, assert_js_1.assert)(typeof isPreview === 'boolean');
|
|
14
15
|
return !isPreview;
|
|
15
16
|
}
|
|
16
|
-
exports.isDev3 = isDev3;
|
|
17
17
|
function isDev2(config) {
|
|
18
18
|
const isDev = config.command === 'serve' &&
|
|
19
19
|
// Mode is 'development' by default: https://github.com/vitejs/vite/blob/bf9c49f521b7a6730231c35754d5e1f9c3a6a16e/packages/vite/src/node/config.ts#L383
|
|
@@ -21,4 +21,3 @@ function isDev2(config) {
|
|
|
21
21
|
config.mode === 'development';
|
|
22
22
|
return isDev;
|
|
23
23
|
}
|
|
24
|
-
exports.isDev2 = isDev2;
|
|
@@ -3,7 +3,8 @@ 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.
|
|
6
|
+
exports.assertFilePathAbsoluteFilesystem = assertFilePathAbsoluteFilesystem;
|
|
7
|
+
exports.isFilePathAbsolute = isFilePathAbsolute;
|
|
7
8
|
const path_1 = __importDefault(require("path"));
|
|
8
9
|
const assert_js_1 = require("./assert.js");
|
|
9
10
|
const filesystemPathHandling_js_1 = require("./filesystemPathHandling.js");
|
|
@@ -20,7 +21,6 @@ function assertFilePathAbsoluteFilesystem(filePath) {
|
|
|
20
21
|
(0, assert_js_1.assert)(isFilePathAbsoluteFilesystem(filePath));
|
|
21
22
|
(0, filesystemPathHandling_js_1.assertPosixPath)(filePath);
|
|
22
23
|
}
|
|
23
|
-
exports.assertFilePathAbsoluteFilesystem = assertFilePathAbsoluteFilesystem;
|
|
24
24
|
/**
|
|
25
25
|
* Whether `filePath` is an absolute file path starting from the filesystem root.
|
|
26
26
|
*
|
|
@@ -57,4 +57,3 @@ function isFilePathAbsolute(filePath) {
|
|
|
57
57
|
// Seems to be reliable: https://nodejs.org/api/path.html#pathisabsolutepath
|
|
58
58
|
return path_1.default.isAbsolute(filePath);
|
|
59
59
|
}
|
|
60
|
-
exports.isFilePathAbsolute = isFilePathAbsolute;
|
package/dist/cjs/utils/isHtml.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Unit tests at ./isHtml.spec.ts
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.isHtml =
|
|
4
|
+
exports.isHtml = isHtml;
|
|
5
5
|
function isHtml(str) {
|
|
6
6
|
// Copied and adapted from https://stackoverflow.com/questions/15458876/check-if-a-string-is-html-or-not/51325984#51325984
|
|
7
7
|
const re = /(<\/[^<]+>)|(<[^<]+\/>)/;
|
|
8
8
|
return re.test(str);
|
|
9
9
|
}
|
|
10
|
-
exports.isHtml = isHtml;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isNodeJS =
|
|
3
|
+
exports.isNodeJS = isNodeJS;
|
|
4
4
|
function isNodeJS() {
|
|
5
5
|
if (typeof process === 'undefined')
|
|
6
6
|
return false;
|
|
@@ -14,4 +14,3 @@ function isNodeJS() {
|
|
|
14
14
|
return false;
|
|
15
15
|
return true;
|
|
16
16
|
}
|
|
17
|
-
exports.isNodeJS = isNodeJS;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.isNpmPackageImport = isNpmPackageImport;
|
|
4
|
+
exports.assertIsNpmPackageImport = assertIsNpmPackageImport;
|
|
5
|
+
exports.isValidPathAlias = isValidPathAlias;
|
|
6
|
+
exports.parse = parse;
|
|
7
|
+
exports.isDistinguishable = isDistinguishable;
|
|
4
8
|
const assert_js_1 = require("./assert.js");
|
|
5
9
|
const assertIsNotBrowser_js_1 = require("./assertIsNotBrowser.js");
|
|
6
10
|
(0, assertIsNotBrowser_js_1.assertIsNotBrowser)();
|
|
@@ -10,14 +14,12 @@ function isNpmPackageImport(str, { cannotBePathAlias }) {
|
|
|
10
14
|
const res = parse(str);
|
|
11
15
|
return res !== null;
|
|
12
16
|
}
|
|
13
|
-
exports.isNpmPackageImport = isNpmPackageImport;
|
|
14
17
|
function assertIsNpmPackageImport(str) {
|
|
15
18
|
(0, assert_js_1.assert)(isNpmPackageImport(str, {
|
|
16
19
|
// If `str` is a path alias that looks like an npm package => assertIsNpmPackageImport() is erroneous but that's okay because the assertion will eventually fail for some other user using a disambiguated path alias.
|
|
17
20
|
cannotBePathAlias: true
|
|
18
21
|
}), str);
|
|
19
22
|
}
|
|
20
|
-
exports.assertIsNpmPackageImport = assertIsNpmPackageImport;
|
|
21
23
|
function isNpmPackageName(str) {
|
|
22
24
|
const res = parse(str);
|
|
23
25
|
return res !== null && res.importPath === null;
|
|
@@ -49,7 +51,6 @@ function isValidPathAlias(alias) {
|
|
|
49
51
|
return false;
|
|
50
52
|
return true;
|
|
51
53
|
}
|
|
52
|
-
exports.isValidPathAlias = isValidPathAlias;
|
|
53
54
|
function isDistinguishable(alias) {
|
|
54
55
|
return (parse(alias) === null &&
|
|
55
56
|
parse(`${alias}fake-path`) === null &&
|
|
@@ -62,7 +63,6 @@ function isDistinguishable(alias) {
|
|
|
62
63
|
// ```
|
|
63
64
|
!alias.startsWith('-'));
|
|
64
65
|
}
|
|
65
|
-
exports.isDistinguishable = isDistinguishable;
|
|
66
66
|
// The logic down below is wrong, for example:
|
|
67
67
|
// - https://www.npmjs.com/package/-
|
|
68
68
|
// The correct logic is complex, see https://github.com/npm/validate-npm-package-name
|
|
@@ -91,7 +91,6 @@ function parse(str) {
|
|
|
91
91
|
importPath
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
|
-
exports.parse = parse;
|
|
95
94
|
function invalid(s) {
|
|
96
95
|
const firstLetter = s[0];
|
|
97
96
|
if (!firstLetter || !/[a-z0-9]/.test(firstLetter))
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isObjectOfStrings =
|
|
3
|
+
exports.isObjectOfStrings = isObjectOfStrings;
|
|
4
4
|
const isObject_js_1 = require("./isObject.js");
|
|
5
5
|
function isObjectOfStrings(val) {
|
|
6
6
|
return (0, isObject_js_1.isObject)(val) && Object.values(val).every((v) => typeof v === 'string');
|
|
7
7
|
}
|
|
8
|
-
exports.isObjectOfStrings = isObjectOfStrings;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isObjectWithKeys =
|
|
3
|
+
exports.isObjectWithKeys = isObjectWithKeys;
|
|
4
4
|
const isPlainObject_js_1 = require("./isPlainObject.js");
|
|
5
5
|
function isObjectWithKeys(obj, keys) {
|
|
6
6
|
if (!(0, isPlainObject_js_1.isPlainObject)(obj)) {
|
|
@@ -13,4 +13,3 @@ function isObjectWithKeys(obj, keys) {
|
|
|
13
13
|
}
|
|
14
14
|
return true;
|
|
15
15
|
}
|
|
16
|
-
exports.isObjectWithKeys = isObjectWithKeys;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isPlainObject =
|
|
3
|
+
exports.isPlainObject = isPlainObject;
|
|
4
4
|
function isPlainObject(value) {
|
|
5
5
|
// Is object?
|
|
6
6
|
if (typeof value !== 'object' || value === null) {
|
|
@@ -17,4 +17,3 @@ function isPlainObject(value) {
|
|
|
17
17
|
*/
|
|
18
18
|
value.constructor.name === 'Object');
|
|
19
19
|
}
|
|
20
|
-
exports.isPlainObject = isPlainObject;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isPromise =
|
|
3
|
+
exports.isPromise = isPromise;
|
|
4
4
|
const isCallable_js_1 = require("./isCallable.js");
|
|
5
5
|
function isPromise(val) {
|
|
6
6
|
return typeof val === 'object' && val !== null && 'then' in val && (0, isCallable_js_1.isCallable)(val.then);
|
|
7
7
|
}
|
|
8
|
-
exports.isPromise = isPromise;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isPropertyGetter =
|
|
3
|
+
exports.isPropertyGetter = isPropertyGetter;
|
|
4
4
|
function isPropertyGetter(obj, prop) {
|
|
5
5
|
const descriptor = Object.getOwnPropertyDescriptor(obj, prop);
|
|
6
6
|
return !!descriptor && !('value' in descriptor) && !!descriptor.get;
|
|
7
7
|
}
|
|
8
|
-
exports.isPropertyGetter = isPropertyGetter;
|