@shiftapi/next 0.0.15 → 0.0.17
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/index.d.ts +1 -1
- package/dist/index.js +7 -6
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { ShiftAPIPluginOptions } from 'shiftapi/internal';
|
|
|
2
2
|
export { ShiftAPIPluginOptions } from 'shiftapi/internal';
|
|
3
3
|
export { ShiftAPIConfig, defineConfig } from 'shiftapi';
|
|
4
4
|
|
|
5
|
-
type NextConfigObject = Record<string,
|
|
5
|
+
type NextConfigObject = Record<string, any>;
|
|
6
6
|
type NextConfigFunction = (...args: unknown[]) => NextConfigObject | Promise<NextConfigObject>;
|
|
7
7
|
type NextConfig = NextConfigObject | NextConfigFunction;
|
|
8
8
|
/**
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
findConfigDir,
|
|
8
8
|
regenerateTypes as _regenerateTypes,
|
|
9
9
|
writeGeneratedFiles,
|
|
10
|
-
|
|
10
|
+
patchTsConfigPaths,
|
|
11
11
|
nextClientJsTemplate,
|
|
12
12
|
DEV_API_PREFIX,
|
|
13
13
|
GoServerManager,
|
|
@@ -44,7 +44,8 @@ function applyShiftAPI(nextConfig, opts) {
|
|
|
44
44
|
const isDev = process.env.NODE_ENV !== "production";
|
|
45
45
|
const shiftapiClientPath = resolve(configDir, ".shiftapi", "client.js");
|
|
46
46
|
const require2 = createRequire(import.meta.url);
|
|
47
|
-
const
|
|
47
|
+
const openapiPkgDir = resolve(require2.resolve("openapi-fetch/package.json"), "..");
|
|
48
|
+
const openapiPath = resolve(openapiPkgDir, "dist", "index.js");
|
|
48
49
|
const initPromise = initializeAsync(projectRoot, configDir, isDev, opts);
|
|
49
50
|
const patched = { ...nextConfig };
|
|
50
51
|
const existingWebpack = nextConfig.webpack;
|
|
@@ -149,9 +150,9 @@ async function initializeDev(projectRoot, configDir, serverEntry, baseUrl, goRoo
|
|
|
149
150
|
try {
|
|
150
151
|
const result = await _regenerateTypes(serverEntry, goRoot, baseUrl, true, "");
|
|
151
152
|
generatedDts = result.types;
|
|
152
|
-
const clientJs = nextClientJsTemplate(goPort, baseUrl);
|
|
153
|
+
const clientJs = nextClientJsTemplate(goPort, baseUrl, DEV_API_PREFIX);
|
|
153
154
|
writeGeneratedFiles(configDir, generatedDts, baseUrl, { clientJsContent: clientJs });
|
|
154
|
-
|
|
155
|
+
patchTsConfigPaths(projectRoot, configDir);
|
|
155
156
|
console.log("[shiftapi] Types generated.");
|
|
156
157
|
} catch (err) {
|
|
157
158
|
console.error("[shiftapi] Failed to generate types:", err);
|
|
@@ -176,7 +177,7 @@ async function initializeDev(projectRoot, configDir, serverEntry, baseUrl, goRoo
|
|
|
176
177
|
);
|
|
177
178
|
if (result.changed) {
|
|
178
179
|
generatedDts = result.types;
|
|
179
|
-
const clientJs = nextClientJsTemplate(goPort, baseUrl);
|
|
180
|
+
const clientJs = nextClientJsTemplate(goPort, baseUrl, DEV_API_PREFIX);
|
|
180
181
|
writeGeneratedFiles(configDir, generatedDts, baseUrl, {
|
|
181
182
|
clientJsContent: clientJs
|
|
182
183
|
});
|
|
@@ -215,7 +216,7 @@ async function initializeBuild(projectRoot, configDir, serverEntry, baseUrl, goR
|
|
|
215
216
|
const result = await _regenerateTypes(serverEntry, goRoot, baseUrl, false, "");
|
|
216
217
|
const clientJs = nextClientJsTemplate(basePort, baseUrl);
|
|
217
218
|
writeGeneratedFiles(configDir, result.types, baseUrl, { clientJsContent: clientJs });
|
|
218
|
-
|
|
219
|
+
patchTsConfigPaths(projectRoot, configDir);
|
|
219
220
|
console.log("[shiftapi] Types generated for build.");
|
|
220
221
|
} catch (err) {
|
|
221
222
|
console.error("[shiftapi] Failed to generate types for build:", err);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shiftapi/next",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.17",
|
|
4
4
|
"description": "Next.js integration for fully-typed TypeScript clients from shiftapi Go servers",
|
|
5
5
|
"author": "Frank Chiarulli Jr. <frank@frankchiarulli.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"openapi-fetch": "^0.13.0",
|
|
33
|
-
"shiftapi": "0.0.
|
|
33
|
+
"shiftapi": "0.0.17"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/node": "^25.2.3",
|