@meetploy/nextjs 1.0.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.
@@ -0,0 +1,5 @@
1
+ import type { PloyContext, GetPloyContextOptions } from "./types.js";
2
+ export declare function getPloyContext(options: {
3
+ async: true;
4
+ }): Promise<PloyContext>;
5
+ export declare function getPloyContext(options?: GetPloyContextOptions): PloyContext;
@@ -0,0 +1,28 @@
1
+ const PLOY_CONTEXT_SYMBOL = Symbol.for("__ploy-context__");
2
+ export function getPloyContext(options) {
3
+ const alsContext = globalThis[PLOY_CONTEXT_SYMBOL];
4
+ if (alsContext) {
5
+ return options?.async ? Promise.resolve(alsContext) : alsContext;
6
+ }
7
+ const devContext = globalThis.__PLOY_DEV_CONTEXT__;
8
+ if (devContext) {
9
+ return options?.async ? Promise.resolve(devContext) : devContext;
10
+ }
11
+ if (options?.async) {
12
+ return Promise.resolve({
13
+ env: {},
14
+ cf: undefined,
15
+ ctx: undefined,
16
+ });
17
+ }
18
+ throw new Error(`getPloyContext() called outside of request context.\n\n` +
19
+ `In production, this is automatically set up by the Ploy handler.\n` +
20
+ `In development, add this to your next.config.ts:\n\n` +
21
+ ` import { initPloyForDev } from "@meetploy/nextjs";\n\n` +
22
+ ` if (process.env.NODE_ENV === "development") {\n` +
23
+ ` await initPloyForDev();\n` +
24
+ ` }\n\n` +
25
+ `For SSG routes, use { async: true }:\n` +
26
+ ` const { env } = await getPloyContext({ async: true });`);
27
+ }
28
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAcA,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;AA2C3D,MAAM,UAAU,cAAc,CAC7B,OAA+B;IAG/B,MAAM,UAAU,GAAI,UAAqD,CACxE,mBAAmB,CACnB,CAAC;IACF,IAAI,UAAU,EAAE,CAAC;QAChB,OAAO,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;IAClE,CAAC;IAGD,MAAM,UAAU,GACf,UACA,CAAC,oBAAoB,CAAC;IACvB,IAAI,UAAU,EAAE,CAAC;QAChB,OAAO,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;IAClE,CAAC;IAGD,IAAI,OAAO,EAAE,KAAK,EAAE,CAAC;QACpB,OAAO,OAAO,CAAC,OAAO,CAAC;YACtB,GAAG,EAAE,EAAE;YACP,EAAE,EAAE,SAAS;YACb,GAAG,EAAE,SAAS;SACd,CAAC,CAAC;IACJ,CAAC;IAED,MAAM,IAAI,KAAK,CACd,yDAAyD;QACxD,oEAAoE;QACpE,sDAAsD;QACtD,0DAA0D;QAC1D,mDAAmD;QACnD,+BAA+B;QAC/B,SAAS;QACT,wCAAwC;QACxC,0DAA0D,CAC3D,CAAC;AACH,CAAC"}
package/dist/dev.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import type { PloyDevConfig } from "./types.js";
2
+ export declare function initPloyForDev(config?: PloyDevConfig): Promise<void>;
package/dist/dev.js ADDED
@@ -0,0 +1,166 @@
1
+ const PLOY_CONTEXT_SYMBOL = Symbol.for("__ploy-context__");
2
+ function createDevD1(databaseId, apiUrl) {
3
+ return {
4
+ async dump() {
5
+ const response = await fetch(`${apiUrl}/db`, {
6
+ method: "POST",
7
+ headers: { "Content-Type": "application/json" },
8
+ body: JSON.stringify({
9
+ databaseId,
10
+ method: "dump",
11
+ }),
12
+ });
13
+ if (!response.ok) {
14
+ throw new Error(`DB dump failed: ${await response.text()}`);
15
+ }
16
+ return await response.arrayBuffer();
17
+ },
18
+ prepare(query) {
19
+ let boundParams = [];
20
+ const stmt = {
21
+ bind(...values) {
22
+ boundParams = values;
23
+ return stmt;
24
+ },
25
+ async run() {
26
+ const response = await fetch(`${apiUrl}/db`, {
27
+ method: "POST",
28
+ headers: { "Content-Type": "application/json" },
29
+ body: JSON.stringify({
30
+ databaseId,
31
+ method: "prepare",
32
+ query,
33
+ params: boundParams,
34
+ }),
35
+ });
36
+ if (!response.ok) {
37
+ throw new Error(`DB query failed: ${await response.text()}`);
38
+ }
39
+ return (await response.json());
40
+ },
41
+ async all() {
42
+ return await stmt.run();
43
+ },
44
+ async first(colName) {
45
+ const result = await stmt.run();
46
+ if (result.results.length === 0) {
47
+ return null;
48
+ }
49
+ const firstRow = result.results[0];
50
+ if (colName) {
51
+ return firstRow[colName] ?? null;
52
+ }
53
+ return firstRow;
54
+ },
55
+ async raw() {
56
+ const result = await stmt.run();
57
+ if (result.results.length === 0) {
58
+ return [];
59
+ }
60
+ const keys = Object.keys(result.results[0]);
61
+ return result.results.map((row) => keys.map((k) => row[k]));
62
+ },
63
+ };
64
+ return stmt;
65
+ },
66
+ async exec(query) {
67
+ const response = await fetch(`${apiUrl}/db`, {
68
+ method: "POST",
69
+ headers: { "Content-Type": "application/json" },
70
+ body: JSON.stringify({
71
+ databaseId,
72
+ method: "exec",
73
+ query,
74
+ }),
75
+ });
76
+ if (!response.ok) {
77
+ throw new Error(`DB exec failed: ${await response.text()}`);
78
+ }
79
+ return (await response.json());
80
+ },
81
+ async batch(statements) {
82
+ const stmts = statements.map((s) => {
83
+ const data = s.__db_data;
84
+ return data || s;
85
+ });
86
+ const response = await fetch(`${apiUrl}/db`, {
87
+ method: "POST",
88
+ headers: { "Content-Type": "application/json" },
89
+ body: JSON.stringify({
90
+ databaseId,
91
+ method: "batch",
92
+ statements: stmts,
93
+ }),
94
+ });
95
+ if (!response.ok) {
96
+ throw new Error(`DB batch failed: ${await response.text()}`);
97
+ }
98
+ return (await response.json());
99
+ },
100
+ };
101
+ }
102
+ async function parseBindingsFromConfig(configPath) {
103
+ try {
104
+ const fs = await import("node:fs/promises");
105
+ const path = await import("node:path");
106
+ const resolvedPath = path.resolve(process.cwd(), configPath);
107
+ const content = await fs.readFile(resolvedPath, "utf-8");
108
+ const dbMatch = content.match(/^db:\s*\n((?:\s+\w+:\s*.+\n?)+)/m);
109
+ if (!dbMatch) {
110
+ return { db: {} };
111
+ }
112
+ const dbBindings = {};
113
+ const bindingLines = dbMatch[1].matchAll(/^\s+(\w+):\s*(.+)$/gm);
114
+ for (const match of bindingLines) {
115
+ const bindingName = match[1].trim();
116
+ const databaseId = match[2].trim();
117
+ dbBindings[bindingName] = databaseId;
118
+ }
119
+ return { db: dbBindings };
120
+ }
121
+ catch (error) {
122
+ if (error instanceof Error && "code" in error && error.code === "ENOENT") {
123
+ return { db: {} };
124
+ }
125
+ console.warn("[Ploy] Failed to parse ploy.yaml:", error);
126
+ return { db: {} };
127
+ }
128
+ }
129
+ export async function initPloyForDev(config) {
130
+ if (process.env.NODE_ENV !== "development") {
131
+ return;
132
+ }
133
+ if (globalThis.__PLOY_DEV_INITIALIZED__) {
134
+ return;
135
+ }
136
+ globalThis.__PLOY_DEV_INITIALIZED__ = true;
137
+ const apiUrl = config?.apiUrl || "http://localhost:4003";
138
+ const configPath = config?.configPath || "./ploy.yaml";
139
+ let bindings = config?.bindings;
140
+ if (!bindings) {
141
+ bindings = await parseBindingsFromConfig(configPath);
142
+ }
143
+ const env = {};
144
+ if (bindings?.db) {
145
+ for (const [bindingName, databaseId] of Object.entries(bindings.db)) {
146
+ env[bindingName] = createDevD1(databaseId, apiUrl);
147
+ }
148
+ }
149
+ const context = {
150
+ env,
151
+ cf: undefined,
152
+ ctx: undefined,
153
+ };
154
+ globalThis.__PLOY_DEV_CONTEXT__ = context;
155
+ Object.defineProperty(globalThis, PLOY_CONTEXT_SYMBOL, {
156
+ get() {
157
+ return context;
158
+ },
159
+ configurable: true,
160
+ });
161
+ const bindingNames = Object.keys(env);
162
+ if (bindingNames.length > 0) {
163
+ console.log(`[Ploy] Development context initialized with bindings: ${bindingNames.join(", ")}`);
164
+ }
165
+ }
166
+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EH,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACtC,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAE7B,OAAO,CAAC,GAAG,CACV,yDAAyD,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAClF,CAAC;IACH,CAAC;AACF,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { getPloyContext } from "./context.js";
2
+ export { initPloyForDev } from "./dev.js";
3
+ export type { PloyContext, PloyEnv, GetPloyContextOptions, PloyDevConfig, CfProperties, PloyExecutionContext, D1Database, D1PreparedStatement, D1Result, D1ResultMeta, } from "./types.js";
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export { getPloyContext } from "./context.js";
2
+ export { initPloyForDev } from "./dev.js";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAiCA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,39 @@
1
+ import type { D1Database as D1DatabaseType, D1PreparedStatement as D1PreparedStatementType, D1Result as D1ResultType, D1ResultMeta as D1ResultMetaType } from "@meetploy/types";
2
+ export type D1Database = D1DatabaseType;
3
+ export type D1PreparedStatement = D1PreparedStatementType;
4
+ export type D1Result<T = unknown> = D1ResultType<T>;
5
+ export type D1ResultMeta = D1ResultMetaType;
6
+ export interface CfProperties {
7
+ colo?: string;
8
+ country?: string;
9
+ city?: string;
10
+ continent?: string;
11
+ latitude?: string;
12
+ longitude?: string;
13
+ postalCode?: string;
14
+ region?: string;
15
+ regionCode?: string;
16
+ timezone?: string;
17
+ }
18
+ export interface PloyExecutionContext {
19
+ waitUntil: (promise: Promise<unknown>) => void;
20
+ passThroughOnException: () => void;
21
+ }
22
+ export interface PloyContext<TEnv = PloyEnv> {
23
+ env: TEnv;
24
+ cf?: CfProperties;
25
+ ctx?: PloyExecutionContext;
26
+ }
27
+ export interface PloyEnv {
28
+ [key: string]: unknown;
29
+ }
30
+ export interface GetPloyContextOptions {
31
+ async?: boolean;
32
+ }
33
+ export interface PloyDevConfig {
34
+ configPath?: string;
35
+ bindings?: {
36
+ db?: Record<string, string>;
37
+ };
38
+ apiUrl?: string;
39
+ }
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@meetploy/nextjs",
3
+ "version": "1.0.0",
4
+ "private": false,
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/polarlightsllc/ploy.git",
8
+ "directory": "packages/nextjs"
9
+ },
10
+ "license": "SEE LICENSE IN ../../LICENSE",
11
+ "type": "module",
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "import": "./dist/index.js",
16
+ "require": "./dist/index.js"
17
+ }
18
+ },
19
+ "module": "./dist/index.js",
20
+ "types": "./dist/index.d.ts",
21
+ "files": [
22
+ "dist/"
23
+ ],
24
+ "scripts": {
25
+ "build": "tsc && resolve-tspaths",
26
+ "dev": "tsc-watch --onSuccess 'resolve-tspaths'",
27
+ "format": "eslint --fix . && prettier --write .",
28
+ "lint": "eslint . && prettier --check ."
29
+ },
30
+ "dependencies": {
31
+ "@meetploy/types": "*"
32
+ }
33
+ }