@vercel/gatsby-plugin-vercel-builder
Advanced tools
Comparing version 1.1.11 to 1.2.1
@@ -1,3 +0,3 @@ | ||
export declare function getGraphQLEngine(): Promise<import("gatsby/dist/schema/graphql-engine/entry").GraphQLEngine>; | ||
export declare function getPageSSRHelpers(): Promise<typeof import("gatsby/dist/utils/page-ssr-module/entry")>; | ||
export declare function getGraphQLEngine(): Promise<any>; | ||
export declare function getPageSSRHelpers(): Promise<any>; | ||
//# sourceMappingURL=utils.d.ts.map |
@@ -30,3 +30,3 @@ "use strict"; | ||
async function getGraphQLEngine() { | ||
const { GraphQLEngine } = (await Promise.resolve().then(() => __importStar(require(path_1.join(__dirname, '.cache/query-engine/index.js'))))); | ||
const { GraphQLEngine } = await Promise.resolve().then(() => __importStar(require(path_1.join(__dirname, '.cache/query-engine/index.js')))); | ||
return new GraphQLEngine({ dbPath: TMP_DATA_PATH }); | ||
@@ -36,5 +36,5 @@ } | ||
async function getPageSSRHelpers() { | ||
return (await Promise.resolve().then(() => __importStar(require(path_1.join(__dirname, '.cache/page-ssr/index.js'))))); | ||
return await Promise.resolve().then(() => __importStar(require(path_1.join(__dirname, '.cache/page-ssr/index.js')))); | ||
} | ||
exports.getPageSSRHelpers = getPageSSRHelpers; | ||
//# sourceMappingURL=utils.js.map |
@@ -20,3 +20,3 @@ "use strict"; | ||
}; | ||
if (schemas_1.validateGatsbyState(state)) { | ||
if (schemas_1.validateGatsbyState.Check(state)) { | ||
console.log('▲ Creating Vercel build output'); | ||
@@ -23,0 +23,0 @@ // `_pathPrefix` contains `assetPrefix` + `pathPrefix`, |
@@ -1,15 +0,60 @@ | ||
import type { IGatsbyPage, IGatsbyFunction, IRedirect, IGatsbyConfig } from 'gatsby/dist/redux/types'; | ||
import Ajv from 'ajv'; | ||
export declare type GatsbyPage = Pick<IGatsbyPage, 'mode' | 'path'>; | ||
export interface GatsbyState { | ||
pages: Array<[string, GatsbyPage]>; | ||
redirects: Array<GatsbyRedirect>; | ||
functions: Array<GatsbyFunction>; | ||
config: GatsbyConfig; | ||
} | ||
export declare type GatsbyFunction = Pick<IGatsbyFunction, 'functionRoute' | 'originalAbsoluteFilePath'>; | ||
export declare type GatsbyRedirect = Pick<IRedirect, 'fromPath' | 'toPath' | 'isPermanent'>; | ||
export declare type GatsbyConfig = Pick<IGatsbyConfig, 'trailingSlash'>; | ||
export declare const ajv: Ajv; | ||
export declare const validateGatsbyState: import("ajv").ValidateFunction<GatsbyState>; | ||
import { Static } from '@sinclair/typebox'; | ||
declare const GatsbyPageSchema: import("@sinclair/typebox").TObject<{ | ||
mode: import("@sinclair/typebox").TUnsafe<"SSG" | "DSG" | "SSR">; | ||
path: import("@sinclair/typebox").TString<string>; | ||
}>; | ||
export declare type GatsbyPage = Static<typeof GatsbyPageSchema>; | ||
declare const GatsbyFunctionSchema: import("@sinclair/typebox").TObject<{ | ||
functionRoute: import("@sinclair/typebox").TString<string>; | ||
originalAbsoluteFilePath: import("@sinclair/typebox").TString<string>; | ||
}>; | ||
export declare type GatsbyFunction = Static<typeof GatsbyFunctionSchema>; | ||
declare const GatsbyRedirectSchema: import("@sinclair/typebox").TObject<{ | ||
fromPath: import("@sinclair/typebox").TString<string>; | ||
toPath: import("@sinclair/typebox").TString<string>; | ||
isPermanent: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>; | ||
}>; | ||
export declare type GatsbyRedirect = Static<typeof GatsbyRedirectSchema>; | ||
declare const GatsbyConfigSchema: import("@sinclair/typebox").TObject<{ | ||
trailingSlash: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<"always" | "never" | "ignore" | "legacy">>; | ||
}>; | ||
export declare type GatsbyConfig = Static<typeof GatsbyConfigSchema>; | ||
declare const GatsbyStateSchema: import("@sinclair/typebox").TObject<{ | ||
pages: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TTuple<[import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TObject<{ | ||
mode: import("@sinclair/typebox").TUnsafe<"SSG" | "DSG" | "SSR">; | ||
path: import("@sinclair/typebox").TString<string>; | ||
}>]>>; | ||
redirects: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{ | ||
fromPath: import("@sinclair/typebox").TString<string>; | ||
toPath: import("@sinclair/typebox").TString<string>; | ||
isPermanent: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>; | ||
}>>; | ||
functions: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{ | ||
functionRoute: import("@sinclair/typebox").TString<string>; | ||
originalAbsoluteFilePath: import("@sinclair/typebox").TString<string>; | ||
}>>; | ||
config: import("@sinclair/typebox").TObject<{ | ||
trailingSlash: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<"always" | "never" | "ignore" | "legacy">>; | ||
}>; | ||
}>; | ||
export declare type GatsbyState = Static<typeof GatsbyStateSchema>; | ||
export declare const validateGatsbyState: import("@sinclair/typebox/compiler").TypeCheck<import("@sinclair/typebox").TObject<{ | ||
pages: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TTuple<[import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TObject<{ | ||
mode: import("@sinclair/typebox").TUnsafe<"SSG" | "DSG" | "SSR">; | ||
path: import("@sinclair/typebox").TString<string>; | ||
}>]>>; | ||
redirects: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{ | ||
fromPath: import("@sinclair/typebox").TString<string>; | ||
toPath: import("@sinclair/typebox").TString<string>; | ||
isPermanent: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>; | ||
}>>; | ||
functions: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{ | ||
functionRoute: import("@sinclair/typebox").TString<string>; | ||
originalAbsoluteFilePath: import("@sinclair/typebox").TString<string>; | ||
}>>; | ||
config: import("@sinclair/typebox").TObject<{ | ||
trailingSlash: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<"always" | "never" | "ignore" | "legacy">>; | ||
}>; | ||
}>>; | ||
export {}; | ||
//# sourceMappingURL=schemas.d.ts.map |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.validateGatsbyState = exports.ajv = void 0; | ||
const ajv_1 = __importDefault(require("ajv")); | ||
const GatsbyPageSchema = { | ||
type: 'object', | ||
properties: { | ||
mode: { | ||
type: 'string', | ||
enum: ['SSG', 'DSG', 'SSR'], | ||
}, | ||
path: { | ||
type: 'string', | ||
}, | ||
}, | ||
required: ['mode', 'path'], | ||
}; | ||
const GatsbyFunctionSchema = { | ||
type: 'object', | ||
properties: { | ||
functionRoute: { type: 'string' }, | ||
originalAbsoluteFilePath: { type: 'string' }, | ||
}, | ||
required: ['functionRoute', 'originalAbsoluteFilePath'], | ||
}; | ||
const GatsbyRedirectSchema = { | ||
type: 'object', | ||
properties: { | ||
fromPath: { type: 'string' }, | ||
toPath: { type: 'string' }, | ||
isPermanent: { type: 'boolean', nullable: true }, | ||
}, | ||
required: ['fromPath', 'toPath'], | ||
}; | ||
const GatsbyConfigSchema = { | ||
type: 'object', | ||
properties: { | ||
trailingSlash: { | ||
type: 'string', | ||
enum: ['always', 'never', 'ignore', 'legacy'], | ||
nullable: true, | ||
}, | ||
}, | ||
}; | ||
const GatsbyStateSchema = { | ||
type: 'object', | ||
properties: { | ||
pages: { | ||
type: 'array', | ||
items: { | ||
type: 'array', | ||
minItems: 2, | ||
maxItems: 2, | ||
items: [{ type: 'string' }, GatsbyPageSchema], | ||
}, | ||
}, | ||
redirects: { | ||
type: 'array', | ||
items: GatsbyRedirectSchema, | ||
}, | ||
functions: { | ||
type: 'array', | ||
items: GatsbyFunctionSchema, | ||
}, | ||
config: GatsbyConfigSchema, | ||
}, | ||
required: ['pages', 'redirects', 'functions', 'config'], | ||
additionalProperties: true, | ||
}; | ||
exports.ajv = new ajv_1.default({ allErrors: true }); | ||
exports.validateGatsbyState = exports.ajv.compile(GatsbyStateSchema); | ||
exports.validateGatsbyState = void 0; | ||
const typebox_1 = require("@sinclair/typebox"); | ||
const custom_1 = require("@sinclair/typebox/custom"); | ||
const compiler_1 = require("@sinclair/typebox/compiler"); | ||
custom_1.Custom.Set('StringEnum', (schema, value) => { | ||
return schema.enum.includes(value); | ||
}); | ||
function StringEnum(values) { | ||
return typebox_1.Type.Unsafe({ | ||
[typebox_1.Kind]: 'StringEnum', | ||
type: 'string', | ||
enum: values, | ||
}); | ||
} | ||
const GatsbyPageSchema = typebox_1.Type.Object({ | ||
mode: StringEnum(['SSG', 'DSG', 'SSR']), | ||
path: typebox_1.Type.String(), | ||
}); | ||
const GatsbyFunctionSchema = typebox_1.Type.Object({ | ||
functionRoute: typebox_1.Type.String(), | ||
originalAbsoluteFilePath: typebox_1.Type.String(), | ||
}); | ||
compiler_1.TypeCompiler.Compile(GatsbyFunctionSchema); | ||
const GatsbyRedirectSchema = typebox_1.Type.Object({ | ||
fromPath: typebox_1.Type.String(), | ||
toPath: typebox_1.Type.String(), | ||
isPermanent: typebox_1.Type.Optional(typebox_1.Type.Boolean()), | ||
}); | ||
const GatsbyConfigSchema = typebox_1.Type.Object({ | ||
trailingSlash: typebox_1.Type.Optional(StringEnum(['always', 'never', 'ignore', 'legacy'])), | ||
}); | ||
const GatsbyStateSchema = typebox_1.Type.Object({ | ||
pages: typebox_1.Type.Array(typebox_1.Type.Tuple([typebox_1.Type.String(), GatsbyPageSchema])), | ||
redirects: typebox_1.Type.Array(GatsbyRedirectSchema), | ||
functions: typebox_1.Type.Array(GatsbyFunctionSchema), | ||
config: GatsbyConfigSchema, | ||
}); | ||
exports.validateGatsbyState = compiler_1.TypeCompiler.Compile(GatsbyStateSchema); | ||
//# sourceMappingURL=schemas.js.map |
@@ -1,9 +0,10 @@ | ||
import type { GatsbyNode } from 'gatsby'; | ||
// this gets built separately, so import from "dist" instead of "src" | ||
import { generateVercelBuildOutputAPI3Output } from './dist'; | ||
export const onPostBuild: GatsbyNode['onPostBuild'] = async ({ | ||
export const onPostBuild = async ({ | ||
pathPrefix, | ||
store, | ||
}: { | ||
pathPrefix: string; | ||
store: any; | ||
}) => { | ||
@@ -10,0 +11,0 @@ await generateVercelBuildOutputAPI3Output({ |
{ | ||
"name": "@vercel/gatsby-plugin-vercel-builder", | ||
"version": "1.1.11", | ||
"version": "1.2.1", | ||
"main": "dist/index.js", | ||
@@ -17,6 +17,6 @@ "files": [ | ||
"dependencies": { | ||
"@vercel/build-utils": "6.3.2", | ||
"@vercel/node": "2.9.10", | ||
"@sinclair/typebox": "0.25.24", | ||
"@vercel/build-utils": "6.3.4", | ||
"@vercel/node": "2.9.12", | ||
"@vercel/routing-utils": "2.1.10", | ||
"ajv": "8.12.0", | ||
"esbuild": "0.14.47", | ||
@@ -31,6 +31,5 @@ "etag": "1.8.1", | ||
"@types/react": "18.0.26", | ||
"gatsby": "4.25.2", | ||
"typescript": "4.3.4" | ||
}, | ||
"gitHead": "803a9363f93c3f2be0f0ea2bce3ba64eefa78e04" | ||
"gitHead": "21a440b83262760ccae70f5c58dc73b3718182a5" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
52236
5
537
+ Added@sinclair/typebox@0.25.24
+ Added@sinclair/typebox@0.25.24(transitive)
+ Added@vercel/build-utils@6.3.4(transitive)
+ Added@vercel/node@2.9.12(transitive)
- Removedajv@8.12.0
- Removed@vercel/build-utils@6.3.2(transitive)
- Removed@vercel/node@2.9.10(transitive)
- Removedajv@8.12.0(transitive)
Updated@vercel/build-utils@6.3.4
Updated@vercel/node@2.9.12