@ohos-ports/yext-pages 0.0.0-stage → 1.3.4-beta.0
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/LICENSE +32 -0
- package/README.md +125 -2
- package/THIRD-PARTY-NOTICES +1203 -0
- package/dist/bin/loader.js +9 -0
- package/dist/bin/pages.js +26 -0
- package/dist/bin/spawn.js +30 -0
- package/dist/build/build.js +33 -0
- package/dist/bundler.js +53 -0
- package/dist/common/src/artifacts/internal/types.js +0 -0
- package/dist/common/src/assets/getAssetsFilepath.js +12 -0
- package/dist/common/src/assets/getPublicFilepath.js +12 -0
- package/dist/common/src/assets/import.js +14 -0
- package/dist/common/src/ci/ci.js +0 -0
- package/dist/common/src/config/types.js +0 -0
- package/dist/common/src/feature/features.js +53 -0
- package/dist/common/src/feature/stream.js +106 -0
- package/dist/common/src/function/internal/functionMetadataParser.js +72 -0
- package/dist/common/src/function/internal/getFunctionFilepaths.js +18 -0
- package/dist/common/src/function/internal/loader.js +48 -0
- package/dist/common/src/function/internal/types.js +44 -0
- package/dist/common/src/function/internal/validateFunctionModule.js +8 -0
- package/dist/common/src/function/types.js +0 -0
- package/dist/common/src/loader/vite.js +65 -0
- package/dist/common/src/module/hydration.js +36 -0
- package/dist/common/src/module/internal/_client.js +9 -0
- package/dist/common/src/module/internal/_client17.js +9 -0
- package/dist/common/src/module/internal/_server.js +19 -0
- package/dist/common/src/module/internal/getModuleConfig.js +10 -0
- package/dist/common/src/module/internal/getModuleFilepaths.js +58 -0
- package/dist/common/src/module/internal/logger.js +25 -0
- package/dist/common/src/module/internal/types.js +27 -0
- package/dist/common/src/module/internal/validateModuleInternal.js +10 -0
- package/dist/common/src/module/types.js +0 -0
- package/dist/common/src/parsers/puckConfigParser.js +31 -0
- package/dist/common/src/parsers/sourceFileParser.js +269 -0
- package/dist/common/src/parsers/tailwindConfigParser.js +77 -0
- package/dist/common/src/parsers/templateParser.js +52 -0
- package/dist/common/src/project/path.js +16 -0
- package/dist/common/src/project/structure.js +197 -0
- package/dist/common/src/redirect/internal/getRedirectFilepaths.js +27 -0
- package/dist/common/src/redirect/internal/types.js +32 -0
- package/dist/common/src/redirect/internal/validateRedirectModuleInternal.js +29 -0
- package/dist/common/src/redirect/loader/loader.js +34 -0
- package/dist/common/src/redirect/types.js +0 -0
- package/dist/common/src/template/client.js +28 -0
- package/dist/common/src/template/head.js +50 -0
- package/dist/common/src/template/hydration.js +127 -0
- package/dist/common/src/template/internal/_client.js +12 -0
- package/dist/common/src/template/internal/_client17.js +12 -0
- package/dist/common/src/template/internal/_server.js +23 -0
- package/dist/common/src/template/internal/getTemplateFilepaths.js +67 -0
- package/dist/common/src/template/internal/resolveTemplateName.js +36 -0
- package/dist/common/src/template/internal/types.js +62 -0
- package/dist/common/src/template/internal/util.js +11 -0
- package/dist/common/src/template/internal/validateGetPathValue.js +10 -0
- package/dist/common/src/template/internal/validateTemplateModuleInternal.js +29 -0
- package/dist/common/src/template/loader/loader.js +54 -0
- package/dist/common/src/template/paths.js +13 -0
- package/dist/common/src/template/types.js +0 -0
- package/dist/dev/dev.js +53 -0
- package/dist/dev/server/autoInit.js +119 -0
- package/dist/dev/server/middleware/constants.js +53 -0
- package/dist/dev/server/middleware/errorMiddleware.js +37 -0
- package/dist/dev/server/middleware/finalSlashRedirect.js +12 -0
- package/dist/dev/server/middleware/getContentType.js +9 -0
- package/dist/dev/server/middleware/ignoreFavicon.js +10 -0
- package/dist/dev/server/middleware/indexPage.js +352 -0
- package/dist/dev/server/middleware/send404.js +9 -0
- package/dist/dev/server/middleware/sendAppHTML.js +71 -0
- package/dist/dev/server/middleware/serveHttpFunction.js +49 -0
- package/dist/dev/server/middleware/serveModule.js +40 -0
- package/dist/dev/server/middleware/serverRenderModule.js +19 -0
- package/dist/dev/server/middleware/serverRenderRoute.js +146 -0
- package/dist/dev/server/middleware/serverRenderSlugRoute.js +113 -0
- package/dist/dev/server/public/404.js +4 -0
- package/dist/dev/server/public/500.js +4 -0
- package/dist/dev/server/public/favicon.ico +0 -0
- package/dist/dev/server/public/index.js +4 -0
- package/dist/dev/server/public/public.d.js +0 -0
- package/dist/dev/server/server.js +218 -0
- package/dist/dev/server/ssr/constants.js +16 -0
- package/dist/dev/server/ssr/findMatchingModule.js +65 -0
- package/dist/dev/server/ssr/findMatchingStaticTemplate.js +87 -0
- package/dist/dev/server/ssr/findTemplateModuleInternal.js +43 -0
- package/dist/dev/server/ssr/generateTestData.js +232 -0
- package/dist/dev/server/ssr/getLocalData.js +194 -0
- package/dist/dev/server/ssr/getPluginFileMap.js +24 -0
- package/dist/dev/server/ssr/inPlatformPageSets.js +91 -0
- package/dist/dev/server/ssr/loadViteModule.js +7 -0
- package/dist/dev/server/ssr/moduleImports.js +9 -0
- package/dist/dev/server/ssr/parseNonProdUrl.js +22 -0
- package/dist/dev/server/ssr/propsLoader.js +29 -0
- package/dist/dev/server/ssr/types.js +0 -0
- package/dist/generate/artifacts/artifacts.js +21 -0
- package/dist/generate/artifacts/createArtifactsJson.js +100 -0
- package/dist/generate/ci/ci.js +140 -0
- package/dist/generate/features/features.js +17 -0
- package/dist/generate/generate.js +16 -0
- package/dist/generate/templates/createTemplatesJson.js +160 -0
- package/dist/generate/templates/templates.js +18 -0
- package/dist/index.js +11 -0
- package/dist/plugin/manifest.ts +135 -0
- package/dist/plugin/mod.ts +29 -0
- package/dist/plugins/index.js +4 -0
- package/dist/plugins/onUrlChange/urlWriteback.js +24 -0
- package/dist/plugins/onUrlChange/yext.js +33 -0
- package/dist/prod/prod.js +17 -0
- package/dist/scaffold/modules/generate.js +128 -0
- package/dist/scaffold/modules/modules.js +21 -0
- package/dist/scaffold/modules/templates.js +92 -0
- package/dist/scaffold/scaffold.js +17 -0
- package/dist/scaffold/template/generate.js +224 -0
- package/dist/scaffold/template/sampleTemplates.js +608 -0
- package/dist/scaffold/template/template.js +21 -0
- package/dist/types/src/bin/loader.d.ts +1 -0
- package/dist/types/src/bin/pages.d.ts +1 -0
- package/dist/types/src/bin/spawn.d.ts +2 -0
- package/dist/types/src/build/build.d.ts +12 -0
- package/dist/types/src/common/src/artifacts/internal/types.d.ts +53 -0
- package/dist/types/src/common/src/assets/getAssetsFilepath.d.ts +7 -0
- package/dist/types/src/common/src/assets/getAssetsFilepath.test.d.ts +1 -0
- package/dist/types/src/common/src/assets/getPublicFilepath.d.ts +6 -0
- package/dist/types/src/common/src/assets/getPublicFilepath.test.d.ts +1 -0
- package/dist/types/src/common/src/assets/import.d.ts +8 -0
- package/dist/types/src/common/src/assets/import.test.d.ts +1 -0
- package/dist/types/src/common/src/ci/ci.d.ts +86 -0
- package/dist/types/src/common/src/config/types.d.ts +65 -0
- package/dist/types/src/common/src/feature/features.d.ts +60 -0
- package/dist/types/src/common/src/feature/features.test.d.ts +1 -0
- package/dist/types/src/common/src/feature/stream.d.ts +88 -0
- package/dist/types/src/common/src/feature/stream.test.d.ts +1 -0
- package/dist/types/src/common/src/function/internal/functionMetadataParser.d.ts +20 -0
- package/dist/types/src/common/src/function/internal/getFunctionFilepaths.d.ts +7 -0
- package/dist/types/src/common/src/function/internal/getFunctionFilepaths.test.d.ts +1 -0
- package/dist/types/src/common/src/function/internal/loader.d.ts +22 -0
- package/dist/types/src/common/src/function/internal/loader.test.d.ts +1 -0
- package/dist/types/src/common/src/function/internal/types.d.ts +43 -0
- package/dist/types/src/common/src/function/internal/types.test.d.ts +1 -0
- package/dist/types/src/common/src/function/internal/validateFunctionModule.d.ts +2 -0
- package/dist/types/src/common/src/function/internal/validateFunctionModule.test.d.ts +1 -0
- package/dist/types/src/common/src/function/types.d.ts +148 -0
- package/dist/types/src/common/src/loader/vite.d.ts +15 -0
- package/dist/types/src/common/src/module/hydration.d.ts +9 -0
- package/dist/types/src/common/src/module/internal/_client.d.ts +3 -0
- package/dist/types/src/common/src/module/internal/_client17.d.ts +3 -0
- package/dist/types/src/common/src/module/internal/_server.d.ts +4 -0
- package/dist/types/src/common/src/module/internal/getModuleConfig.d.ts +5 -0
- package/dist/types/src/common/src/module/internal/getModuleFilepaths.d.ts +16 -0
- package/dist/types/src/common/src/module/internal/logger.d.ts +6 -0
- package/dist/types/src/common/src/module/internal/types.d.ts +29 -0
- package/dist/types/src/common/src/module/internal/validateModuleInternal.d.ts +2 -0
- package/dist/types/src/common/src/module/types.d.ts +82 -0
- package/dist/types/src/common/src/parsers/puckConfigParser.d.ts +7 -0
- package/dist/types/src/common/src/parsers/puckConfigParser.test.d.ts +1 -0
- package/dist/types/src/common/src/parsers/sourceFileParser.d.ts +82 -0
- package/dist/types/src/common/src/parsers/sourceFileParser.test.d.ts +1 -0
- package/dist/types/src/common/src/parsers/tailwindConfigParser.d.ts +5 -0
- package/dist/types/src/common/src/parsers/tailwindConfigParser.test.d.ts +1 -0
- package/dist/types/src/common/src/parsers/templateParser.d.ts +29 -0
- package/dist/types/src/common/src/parsers/templateParser.test.d.ts +1 -0
- package/dist/types/src/common/src/project/path.d.ts +11 -0
- package/dist/types/src/common/src/project/structure.d.ts +190 -0
- package/dist/types/src/common/src/project/structure.test.d.ts +1 -0
- package/dist/types/src/common/src/redirect/internal/getRedirectFilepaths.d.ts +14 -0
- package/dist/types/src/common/src/redirect/internal/types.d.ts +37 -0
- package/dist/types/src/common/src/redirect/internal/validateRedirectModuleInternal.d.ts +3 -0
- package/dist/types/src/common/src/redirect/loader/loader.d.ts +13 -0
- package/dist/types/src/common/src/redirect/types.d.ts +54 -0
- package/dist/types/src/common/src/template/client.d.ts +5 -0
- package/dist/types/src/common/src/template/head.d.ts +71 -0
- package/dist/types/src/common/src/template/head.test.d.ts +1 -0
- package/dist/types/src/common/src/template/hydration.d.ts +70 -0
- package/dist/types/src/common/src/template/internal/_client.d.ts +3 -0
- package/dist/types/src/common/src/template/internal/_client17.d.ts +3 -0
- package/dist/types/src/common/src/template/internal/_server.d.ts +4 -0
- package/dist/types/src/common/src/template/internal/getTemplateFilepaths.d.ts +26 -0
- package/dist/types/src/common/src/template/internal/getTemplateFilepaths.test.d.ts +1 -0
- package/dist/types/src/common/src/template/internal/resolveTemplateName.d.ts +3 -0
- package/dist/types/src/common/src/template/internal/resolveTemplateName.test.d.ts +1 -0
- package/dist/types/src/common/src/template/internal/types.d.ts +111 -0
- package/dist/types/src/common/src/template/internal/types.test.d.ts +1 -0
- package/dist/types/src/common/src/template/internal/util.d.ts +3 -0
- package/dist/types/src/common/src/template/internal/validateGetPathValue.d.ts +1 -0
- package/dist/types/src/common/src/template/internal/validateTemplateModuleInternal.d.ts +3 -0
- package/dist/types/src/common/src/template/internal/validateTemplateModuleInternal.test.d.ts +1 -0
- package/dist/types/src/common/src/template/loader/loader.d.ts +18 -0
- package/dist/types/src/common/src/template/loader/loader.test.d.ts +1 -0
- package/dist/types/src/common/src/template/paths.d.ts +14 -0
- package/dist/types/src/common/src/template/paths.test.d.ts +1 -0
- package/dist/types/src/common/src/template/types.d.ts +299 -0
- package/dist/types/src/dev/dev.d.ts +21 -0
- package/dist/types/src/dev/server/autoInit.d.ts +1 -0
- package/dist/types/src/dev/server/middleware/constants.d.ts +8 -0
- package/dist/types/src/dev/server/middleware/errorMiddleware.d.ts +3 -0
- package/dist/types/src/dev/server/middleware/finalSlashRedirect.d.ts +4 -0
- package/dist/types/src/dev/server/middleware/finalSlashRedirect.test.d.ts +1 -0
- package/dist/types/src/dev/server/middleware/getContentType.d.ts +6 -0
- package/dist/types/src/dev/server/middleware/ignoreFavicon.d.ts +1 -0
- package/dist/types/src/dev/server/middleware/indexPage.d.ts +14 -0
- package/dist/types/src/dev/server/middleware/send404.d.ts +2 -0
- package/dist/types/src/dev/server/middleware/sendAppHTML.d.ts +10 -0
- package/dist/types/src/dev/server/middleware/serveHttpFunction.d.ts +5 -0
- package/dist/types/src/dev/server/middleware/serveModule.d.ts +7 -0
- package/dist/types/src/dev/server/middleware/serverRenderModule.d.ts +8 -0
- package/dist/types/src/dev/server/middleware/serverRenderRoute.d.ts +13 -0
- package/dist/types/src/dev/server/middleware/serverRenderSlugRoute.d.ts +13 -0
- package/dist/types/src/dev/server/server.d.ts +5 -0
- package/dist/types/src/dev/server/ssr/constants.d.ts +7 -0
- package/dist/types/src/dev/server/ssr/findMatchingModule.d.ts +19 -0
- package/dist/types/src/dev/server/ssr/findMatchingStaticTemplate.d.ts +20 -0
- package/dist/types/src/dev/server/ssr/findTemplateModuleInternal.d.ts +4 -0
- package/dist/types/src/dev/server/ssr/generateTestData.d.ts +13 -0
- package/dist/types/src/dev/server/ssr/generateTestData.test.d.ts +1 -0
- package/dist/types/src/dev/server/ssr/getLocalData.d.ts +46 -0
- package/dist/types/src/dev/server/ssr/getPluginFileMap.d.ts +25 -0
- package/dist/types/src/dev/server/ssr/inPlatformPageSets.d.ts +21 -0
- package/dist/types/src/dev/server/ssr/inPlatformPageSets.test.d.ts +1 -0
- package/dist/types/src/dev/server/ssr/loadViteModule.d.ts +2 -0
- package/dist/types/src/dev/server/ssr/moduleImports.d.ts +10 -0
- package/dist/types/src/dev/server/ssr/moduleImports.test.d.ts +1 -0
- package/dist/types/src/dev/server/ssr/parseNonProdUrl.d.ts +8 -0
- package/dist/types/src/dev/server/ssr/propsLoader.d.ts +8 -0
- package/dist/types/src/dev/server/ssr/types.d.ts +18 -0
- package/dist/types/src/generate/artifacts/artifacts.d.ts +5 -0
- package/dist/types/src/generate/artifacts/createArtifactsJson.d.ts +15 -0
- package/dist/types/src/generate/artifacts/createArtifactsJson.test.d.ts +1 -0
- package/dist/types/src/generate/ci/ci.d.ts +18 -0
- package/dist/types/src/generate/ci/ci.test.d.ts +1 -0
- package/dist/types/src/generate/features/features.d.ts +2 -0
- package/dist/types/src/generate/generate.d.ts +2 -0
- package/dist/types/src/generate/templates/createTemplatesJson.d.ts +29 -0
- package/dist/types/src/generate/templates/createTemplatesJson.test.d.ts +1 -0
- package/dist/types/src/generate/templates/templates.d.ts +5 -0
- package/dist/types/src/index.d.ts +8 -0
- package/dist/types/src/plugins/index.d.ts +1 -0
- package/dist/types/src/plugins/onUrlChange/urlWriteback.d.ts +24 -0
- package/dist/types/src/plugins/onUrlChange/urlWriteback.test.d.ts +1 -0
- package/dist/types/src/plugins/onUrlChange/yext.d.ts +24 -0
- package/dist/types/src/prod/prod.d.ts +2 -0
- package/dist/types/src/scaffold/modules/generate.d.ts +8 -0
- package/dist/types/src/scaffold/modules/generate.test.d.ts +1 -0
- package/dist/types/src/scaffold/modules/modules.d.ts +2 -0
- package/dist/types/src/scaffold/modules/templates.d.ts +6 -0
- package/dist/types/src/scaffold/modules/templates.test.d.ts +1 -0
- package/dist/types/src/scaffold/scaffold.d.ts +2 -0
- package/dist/types/src/scaffold/template/generate.d.ts +2 -0
- package/dist/types/src/scaffold/template/sampleTemplates.d.ts +9 -0
- package/dist/types/src/scaffold/template/sampleTemplates.test.d.ts +1 -0
- package/dist/types/src/scaffold/template/template.d.ts +2 -0
- package/dist/types/src/upgrade/migrateConfig.d.ts +16 -0
- package/dist/types/src/upgrade/migrateConfig.test.d.ts +1 -0
- package/dist/types/src/upgrade/pagesUpdater.d.ts +97 -0
- package/dist/types/src/upgrade/pagesUpdater.test.d.ts +1 -0
- package/dist/types/src/upgrade/upgrade.d.ts +2 -0
- package/dist/types/src/util/applyReverseProxy.d.ts +41 -0
- package/dist/types/src/util/applyReverseProxy.test.d.ts +1 -0
- package/dist/types/src/util/checkInstalled.d.ts +2 -0
- package/dist/types/src/util/checkInstalled.test.d.ts +1 -0
- package/dist/types/src/util/config.d.ts +1 -0
- package/dist/types/src/util/createTestSourceFile.d.ts +12 -0
- package/dist/types/src/util/dynamic.d.ts +52 -0
- package/dist/types/src/util/editConfigYaml.d.ts +14 -0
- package/dist/types/src/util/env.d.ts +12 -0
- package/dist/types/src/util/env.test.d.ts +1 -0
- package/dist/types/src/util/fileContentHash.d.ts +4 -0
- package/dist/types/src/util/fileContentHash.test.d.ts +1 -0
- package/dist/types/src/util/index.d.ts +4 -0
- package/dist/types/src/util/logError.d.ts +10 -0
- package/dist/types/src/util/partition.d.ts +9 -0
- package/dist/types/src/util/partition.test.d.ts +1 -0
- package/dist/types/src/util/processEnvVariables.d.ts +8 -0
- package/dist/types/src/util/processEnvVariables.test.d.ts +1 -0
- package/dist/types/src/util/resolveApiBase.d.ts +10 -0
- package/dist/types/src/util/runSubprocess.d.ts +8 -0
- package/dist/types/src/util/runSubprocess.test.d.ts +1 -0
- package/dist/types/src/util/runtime.d.ts +26 -0
- package/dist/types/src/util/runtime.test.d.ts +8 -0
- package/dist/types/src/util/url.d.ts +11 -0
- package/dist/types/src/util/url.test.d.ts +1 -0
- package/dist/types/src/util/useDocument.d.ts +8 -0
- package/dist/types/src/util/yextrcContents.d.ts +12 -0
- package/dist/types/src/util/yextrcContents.test.d.ts +1 -0
- package/dist/types/src/vite-plugin/build/build.d.ts +8 -0
- package/dist/types/src/vite-plugin/build/buildStart/buildStart.d.ts +21 -0
- package/dist/types/src/vite-plugin/build/buildStart/rendering/redirectUtils.d.ts +19 -0
- package/dist/types/src/vite-plugin/build/buildStart/rendering/renderer.d.ts +15 -0
- package/dist/types/src/vite-plugin/build/buildStart/rendering/templateUtils.d.ts +37 -0
- package/dist/types/src/vite-plugin/build/buildStart/rendering/templateUtils.test.d.ts +1 -0
- package/dist/types/src/vite-plugin/build/buildStart/rendering/wrapper.d.ts +15 -0
- package/dist/types/src/vite-plugin/build/closeBundle/bundleValidator.d.ts +8 -0
- package/dist/types/src/vite-plugin/build/closeBundle/bundleValidator.test.d.ts +1 -0
- package/dist/types/src/vite-plugin/build/closeBundle/bundleValidatorHelper.d.ts +3 -0
- package/dist/types/src/vite-plugin/build/closeBundle/closeBundle.d.ts +6 -0
- package/dist/types/src/vite-plugin/build/closeBundle/functionMetadata.d.ts +5 -0
- package/dist/types/src/vite-plugin/build/closeBundle/manifest.d.ts +9 -0
- package/dist/types/src/vite-plugin/clientHydration.d.ts +2 -0
- package/dist/types/src/vite-plugin/clientHydration.test.d.ts +1 -0
- package/dist/types/src/vite-plugin/index.d.ts +1 -0
- package/dist/types/src/vite-plugin/log.d.ts +12 -0
- package/dist/types/src/vite-plugin/modules/plugin.d.ts +4 -0
- package/dist/types/src/vite-plugin/plugin.d.ts +4 -0
- package/dist/types/src/vite-plugin/serverless-functions/plugin.d.ts +3 -0
- package/dist/types/src/vite-plugin/timing.d.ts +8 -0
- package/dist/types/tests/fixtures/cli_boilerplate.d.ts +4 -0
- package/dist/types/tests/fixtures/cli_stream_data.d.ts +214 -0
- package/dist/types/tests/fixtures/feature_config.d.ts +3 -0
- package/dist/upgrade/migrateConfig.js +200 -0
- package/dist/upgrade/pagesUpdater.js +496 -0
- package/dist/upgrade/upgrade.js +47 -0
- package/dist/util/applyReverseProxy.js +321 -0
- package/dist/util/checkInstalled.js +16 -0
- package/dist/util/config.js +11 -0
- package/dist/util/createTestSourceFile.js +20 -0
- package/dist/util/dynamic.js +35 -0
- package/dist/util/editConfigYaml.js +29 -0
- package/dist/util/env.js +9 -0
- package/dist/util/fileContentHash.js +9 -0
- package/dist/util/index.js +11 -0
- package/dist/util/logError.js +16 -0
- package/dist/util/partition.js +13 -0
- package/dist/util/processEnvVariables.js +32 -0
- package/dist/util/resolveApiBase.js +32 -0
- package/dist/util/runSubprocess.js +26 -0
- package/dist/util/runtime.js +42 -0
- package/dist/util/url.js +43 -0
- package/dist/util/useDocument.js +19 -0
- package/dist/util/yextrcContents.js +24 -0
- package/dist/vite-plugin/build/build.js +71 -0
- package/dist/vite-plugin/build/buildStart/buildStart.js +138 -0
- package/dist/vite-plugin/build/buildStart/rendering/redirectUtils.js +35 -0
- package/dist/vite-plugin/build/buildStart/rendering/renderer.js +48 -0
- package/dist/vite-plugin/build/buildStart/rendering/templateUtils.js +103 -0
- package/dist/vite-plugin/build/buildStart/rendering/wrapper.js +75 -0
- package/dist/vite-plugin/build/closeBundle/bundleValidator.js +24 -0
- package/dist/vite-plugin/build/closeBundle/bundleValidatorHelper.js +16 -0
- package/dist/vite-plugin/build/closeBundle/closeBundle.js +218 -0
- package/dist/vite-plugin/build/closeBundle/functionMetadata.js +66 -0
- package/dist/vite-plugin/build/closeBundle/manifest.js +71 -0
- package/dist/vite-plugin/clientHydration.js +24 -0
- package/dist/vite-plugin/index.js +4 -0
- package/dist/vite-plugin/log.js +20 -0
- package/dist/vite-plugin/modules/plugin.js +226 -0
- package/dist/vite-plugin/plugin.js +52 -0
- package/dist/vite-plugin/serverless-functions/plugin.js +111 -0
- package/dist/vite-plugin/timing.js +13 -0
- package/package.json +116 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
The Pages files listed in this repository are licensed under the below license. All other features and products are subject to separate agreements
|
|
2
|
+
and certain functionality requires paid subscriptions to Yext products.
|
|
3
|
+
|
|
4
|
+
BSD 3-Clause License
|
|
5
|
+
|
|
6
|
+
Copyright (c) 2022, Yext
|
|
7
|
+
All rights reserved.
|
|
8
|
+
|
|
9
|
+
Redistribution and use in source and binary forms, with or without
|
|
10
|
+
modification, are permitted provided that the following conditions are met:
|
|
11
|
+
|
|
12
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
13
|
+
list of conditions and the following disclaimer.
|
|
14
|
+
|
|
15
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
16
|
+
this list of conditions and the following disclaimer in the documentation
|
|
17
|
+
and/or other materials provided with the distribution.
|
|
18
|
+
|
|
19
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
20
|
+
contributors may be used to endorse or promote products derived from
|
|
21
|
+
this software without specific prior written permission.
|
|
22
|
+
|
|
23
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
24
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
25
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
26
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
27
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
28
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
29
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
30
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
31
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
32
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,126 @@
|
|
|
1
|
-
#
|
|
1
|
+
# pages
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`pages` is the main package that exports different subpackages, all designed to make it easy to develop on the Yext Pages platform using JavaScript.
|
|
4
|
+
|
|
5
|
+
## Subpackages
|
|
6
|
+
|
|
7
|
+
All folders below live at `packages/pages/src`.
|
|
8
|
+
|
|
9
|
+
### bin
|
|
10
|
+
|
|
11
|
+
The main binary exported as `pages`. The two important commands are:
|
|
12
|
+
|
|
13
|
+
- `pages init`
|
|
14
|
+
- Clones the [starter repo](https://github.com/yext/pages-starter-react-locations), runs `npm install`, and performs the first build, all in one simple command. The actual init functionality lives in [`/init`](#init).
|
|
15
|
+
- `pages dev`
|
|
16
|
+
- Runs a custom local development server that is backed by [Vite](https://vitejs.dev/). The actual dev server functionality lives in [`/dev`](#dev).
|
|
17
|
+
|
|
18
|
+
### common
|
|
19
|
+
|
|
20
|
+
Contains any code shared between the other subpackages. It also contains public types and internal domain types.
|
|
21
|
+
|
|
22
|
+
### dev
|
|
23
|
+
|
|
24
|
+
All of the code related to the custom local dev server lives here. The server itself is an Express server that's backed by [Vite](https://vitejs.dev/), giving us ultra fast HMR (hot module replacement) out of the box.
|
|
25
|
+
|
|
26
|
+
In general, local dev was set up to be similar to how NextJS works. Every unique page is a separate file in your own repository's `src/templates` folder. The default export in each file represents the template entrypoint.
|
|
27
|
+
|
|
28
|
+
### init
|
|
29
|
+
|
|
30
|
+
The actual code relating to the `pages init` function.
|
|
31
|
+
|
|
32
|
+
### util
|
|
33
|
+
|
|
34
|
+
Contains helper utility functions that could be useful to someone using PagesJS. For instance, we have a custom `fetch` function that allows it to work across different runtime environments (Node vs. Deno vs. Browser).
|
|
35
|
+
|
|
36
|
+
### vite-plugin
|
|
37
|
+
|
|
38
|
+
This is a plugin to be used with Vite specifically. It provides an opinioned but easy-to-use way to bundle your code for production. Where [`/dev`](#dev) builds for local development, `/vite-plugin` builds for production.
|
|
39
|
+
|
|
40
|
+
## Development
|
|
41
|
+
|
|
42
|
+
`pages` has a number of scripts to assist with development. Since the tool is meant to be
|
|
43
|
+
used alongside a repository set up for Yext Pages, it is recommended that any changes are tested
|
|
44
|
+
against a starter repository. One such starter repo is [yext/pages-starter-react-locations](https://github.com/yext/pages-starter-react-locations).
|
|
45
|
+
|
|
46
|
+
By default, the starter repository references a non-local version of `@yext/pages`. To point
|
|
47
|
+
the starter at this local repository, first run `pnpm pack` in `./packages/pages`, then update the starter's `package.json`'s `@yext/pages`
|
|
48
|
+
dependency to `file:../path/to/the/pack.tgz`.
|
|
49
|
+
|
|
50
|
+
Also see the [Contributing Guide](https://github.com/yext/pages/blob/main/CONTRIBUTING.md#repo-setup).
|
|
51
|
+
|
|
52
|
+
#
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
pnpm build
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
This command uses esbuild to transpile assets and puts them into `dist`. Since this package's `bin`
|
|
59
|
+
specifies an entry-point in the `dist` directory you'll need to run this command whenever you make
|
|
60
|
+
changes in source so that they're picked up in any test repositories you're working on.
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
pnpm build:release
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Similar to `pnpm build` but also runs types.
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
pnpm watch
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
This command does the same this as `build` except it does it in watchmode anytime a source file is
|
|
73
|
+
updated the build will be automatically re-run.
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
pnpm types
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
This command runs `tsc` to generate type declaration files and outputs them in `dist/types`.
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
pnpm fmt
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
This command runs prettier for standardized formatting across all files.
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
pnpm docs:dev
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
This command will start the Vitepress devserver with hot module reloading to quickly test changes to documentation. It will generate a webpage for each markdown file in the `docs` directory according to the config specified in `docs/.vitepress/config.ts`
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
pnpm docs:build
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
This command will use Vitepress to fully build the html pages for the documentation site and puts them into `docs/.vitepress/dist`. Similar to the `docs:dev` command, it will generate an html page for each markdown file in the `docs` directory according to the configuration specified in `docs/.vitepress/config.ts`.
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
pnpm docs:serve
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
This command will run the same build as the `docs:build` command and it will then serve the fully generated html files on a local server. This allows inspection of the documentation webpages in a way that's fully consistent with what will be served on the real website.
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
pnpm test
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
This command will run all the tests in the package using Vitest as the test runner.
|
|
110
|
+
|
|
111
|
+
## Commands to Use in a Starter
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
pages dev
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
This command starts a devserver with hot module reloading to be used to quickly test changes to
|
|
118
|
+
JS templates.
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
vite build
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
This command runs a production build on your repo. It minifies and fingerprints assets so they are
|
|
125
|
+
prepared to be statically served by a webserver. Additionally provides a default Yext Plugin to
|
|
126
|
+
generate html pages from JS templates and prepares the template modules for generation.
|