@stryke/prisma-trpc-generator 0.6.1 → 0.7.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/dist/generator.cjs +15 -27
- package/dist/generator.js +15 -27
- package/dist/index.cjs +15 -27
- package/dist/index.js +15 -27
- package/package.json +1 -1
package/dist/generator.cjs
CHANGED
|
@@ -6883,13 +6883,13 @@ var configMiddleware = z.union([
|
|
|
6883
6883
|
]);
|
|
6884
6884
|
var configShield = z.union([
|
|
6885
6885
|
configBoolean,
|
|
6886
|
-
z.string().default("../src/trpc/
|
|
6886
|
+
z.string().default("../src/trpc/shields")
|
|
6887
6887
|
]);
|
|
6888
6888
|
var modelActionEnum = z.nativeEnum(ModelAction);
|
|
6889
6889
|
var configSchema = z.object({
|
|
6890
6890
|
debug: configBoolean.default("false"),
|
|
6891
|
-
withMiddleware: configMiddleware.default("
|
|
6892
|
-
|
|
6891
|
+
withMiddleware: configMiddleware.default("false"),
|
|
6892
|
+
withShields: configShield.default("true"),
|
|
6893
6893
|
withZod: configBoolean.default("true"),
|
|
6894
6894
|
withNext: configBoolean.default("true"),
|
|
6895
6895
|
contextPath: z.string().default("../src/trpc/context"),
|
|
@@ -7622,7 +7622,7 @@ __name(getRelativePath, "getRelativePath");
|
|
|
7622
7622
|
|
|
7623
7623
|
// src/helpers.ts
|
|
7624
7624
|
var getProcedureName = /* @__PURE__ */ __name((config) => {
|
|
7625
|
-
return config.
|
|
7625
|
+
return config.withShields ? "shieldedProcedure" : config.withMiddleware ? "protectedProcedure" : "publicProcedure";
|
|
7626
7626
|
}, "getProcedureName");
|
|
7627
7627
|
var generateCreateRouterImport = /* @__PURE__ */ __name(({ sourceFile, config }) => {
|
|
7628
7628
|
const imports = [
|
|
@@ -7682,6 +7682,7 @@ async function generateBaseRouter(sourceFile, config, options) {
|
|
|
7682
7682
|
`
|
|
7683
7683
|
import { createContext } from '${relativeContextPath}';
|
|
7684
7684
|
import { initTRPC, TRPCError } from '@trpc/server';
|
|
7685
|
+
import { experimental_nextAppDirCaller } from '@trpc/server/adapters/next-app-dir';
|
|
7685
7686
|
import { createTRPCServerActionHandler } from '@stryke/trpc-next/action-handler';
|
|
7686
7687
|
`
|
|
7687
7688
|
);
|
|
@@ -7730,7 +7731,7 @@ async function generateBaseRouter(sourceFile, config, options) {
|
|
|
7730
7731
|
)
|
|
7731
7732
|
});
|
|
7732
7733
|
}
|
|
7733
|
-
if (config.
|
|
7734
|
+
if (config.withShields) {
|
|
7734
7735
|
sourceFile.addStatements(
|
|
7735
7736
|
/* ts */
|
|
7736
7737
|
`
|
|
@@ -7763,22 +7764,6 @@ export const createCallerFactory = t.createCallerFactory;`
|
|
|
7763
7764
|
sourceFile.addStatements(
|
|
7764
7765
|
/* ts */
|
|
7765
7766
|
`
|
|
7766
|
-
export const protectedProcedure = publicProcedure.use((opts) => {
|
|
7767
|
-
const { session } = opts.ctx;
|
|
7768
|
-
|
|
7769
|
-
if (!session?.user) {
|
|
7770
|
-
throw new TRPCError({
|
|
7771
|
-
code: 'UNAUTHORIZED',
|
|
7772
|
-
});
|
|
7773
|
-
}
|
|
7774
|
-
|
|
7775
|
-
return opts.next({ ctx: { session } });
|
|
7776
|
-
});
|
|
7777
|
-
`
|
|
7778
|
-
);
|
|
7779
|
-
sourceFile.addStatements(
|
|
7780
|
-
/* ts */
|
|
7781
|
-
`
|
|
7782
7767
|
export const createAction = createTRPCServerActionHandler(t, createContext);
|
|
7783
7768
|
`
|
|
7784
7769
|
);
|
|
@@ -7790,14 +7775,17 @@ export const protectedProcedure = publicProcedure.use((opts) => {
|
|
|
7790
7775
|
sourceFile.addStatements(
|
|
7791
7776
|
/* ts */
|
|
7792
7777
|
`
|
|
7793
|
-
export const ${procName} = t.procedure
|
|
7794
|
-
`
|
|
7778
|
+
export const ${procName} = t.procedure`
|
|
7795
7779
|
);
|
|
7796
7780
|
}
|
|
7797
7781
|
sourceFile.addStatements(
|
|
7798
7782
|
/* ts */
|
|
7799
7783
|
`
|
|
7800
|
-
.use(${middleware.type === "shield" ? "permissionsMiddleware" : "globalMiddleware"})
|
|
7784
|
+
.use(${middleware.type === "shield" ? "permissionsMiddleware" : "globalMiddleware"})${config.withNext ? `.experimental_caller(
|
|
7785
|
+
experimental_nextAppDirCaller({
|
|
7786
|
+
normalizeFormData: true,
|
|
7787
|
+
}),
|
|
7788
|
+
)` : ""}
|
|
7801
7789
|
`
|
|
7802
7790
|
);
|
|
7803
7791
|
});
|
|
@@ -11640,7 +11628,7 @@ async function generate(options) {
|
|
|
11640
11628
|
queries.sort();
|
|
11641
11629
|
mutations.sort();
|
|
11642
11630
|
subscriptions.sort();
|
|
11643
|
-
if (config.
|
|
11631
|
+
if (config.withShields !== false) {
|
|
11644
11632
|
consoleLog("Generating tRPC Shield");
|
|
11645
11633
|
const shieldOutputDir = outputDir;
|
|
11646
11634
|
consoleLog("Constructing tRPC Shield source file");
|
|
@@ -11695,8 +11683,8 @@ export default {${config.withNext ? "\n transformer," : ""}
|
|
|
11695
11683
|
overwrite: true
|
|
11696
11684
|
});
|
|
11697
11685
|
consoleLog("Generating tRPC imports");
|
|
11698
|
-
if (config.
|
|
11699
|
-
await generateShieldImport(createRouter, options, config.
|
|
11686
|
+
if (config.withShields) {
|
|
11687
|
+
await generateShieldImport(createRouter, options, config.withShields);
|
|
11700
11688
|
}
|
|
11701
11689
|
consoleLog("Generating tRPC base router");
|
|
11702
11690
|
await generateBaseRouter(createRouter, config, options);
|
package/dist/generator.js
CHANGED
|
@@ -6888,13 +6888,13 @@ var configMiddleware = z.union([
|
|
|
6888
6888
|
]);
|
|
6889
6889
|
var configShield = z.union([
|
|
6890
6890
|
configBoolean,
|
|
6891
|
-
z.string().default("../src/trpc/
|
|
6891
|
+
z.string().default("../src/trpc/shields")
|
|
6892
6892
|
]);
|
|
6893
6893
|
var modelActionEnum = z.nativeEnum(ModelAction);
|
|
6894
6894
|
var configSchema = z.object({
|
|
6895
6895
|
debug: configBoolean.default("false"),
|
|
6896
|
-
withMiddleware: configMiddleware.default("
|
|
6897
|
-
|
|
6896
|
+
withMiddleware: configMiddleware.default("false"),
|
|
6897
|
+
withShields: configShield.default("true"),
|
|
6898
6898
|
withZod: configBoolean.default("true"),
|
|
6899
6899
|
withNext: configBoolean.default("true"),
|
|
6900
6900
|
contextPath: z.string().default("../src/trpc/context"),
|
|
@@ -7627,7 +7627,7 @@ __name(getRelativePath, "getRelativePath");
|
|
|
7627
7627
|
|
|
7628
7628
|
// src/helpers.ts
|
|
7629
7629
|
var getProcedureName = /* @__PURE__ */ __name((config) => {
|
|
7630
|
-
return config.
|
|
7630
|
+
return config.withShields ? "shieldedProcedure" : config.withMiddleware ? "protectedProcedure" : "publicProcedure";
|
|
7631
7631
|
}, "getProcedureName");
|
|
7632
7632
|
var generateCreateRouterImport = /* @__PURE__ */ __name(({ sourceFile, config }) => {
|
|
7633
7633
|
const imports = [
|
|
@@ -7687,6 +7687,7 @@ async function generateBaseRouter(sourceFile, config, options) {
|
|
|
7687
7687
|
`
|
|
7688
7688
|
import { createContext } from '${relativeContextPath}';
|
|
7689
7689
|
import { initTRPC, TRPCError } from '@trpc/server';
|
|
7690
|
+
import { experimental_nextAppDirCaller } from '@trpc/server/adapters/next-app-dir';
|
|
7690
7691
|
import { createTRPCServerActionHandler } from '@stryke/trpc-next/action-handler';
|
|
7691
7692
|
`
|
|
7692
7693
|
);
|
|
@@ -7735,7 +7736,7 @@ async function generateBaseRouter(sourceFile, config, options) {
|
|
|
7735
7736
|
)
|
|
7736
7737
|
});
|
|
7737
7738
|
}
|
|
7738
|
-
if (config.
|
|
7739
|
+
if (config.withShields) {
|
|
7739
7740
|
sourceFile.addStatements(
|
|
7740
7741
|
/* ts */
|
|
7741
7742
|
`
|
|
@@ -7768,22 +7769,6 @@ export const createCallerFactory = t.createCallerFactory;`
|
|
|
7768
7769
|
sourceFile.addStatements(
|
|
7769
7770
|
/* ts */
|
|
7770
7771
|
`
|
|
7771
|
-
export const protectedProcedure = publicProcedure.use((opts) => {
|
|
7772
|
-
const { session } = opts.ctx;
|
|
7773
|
-
|
|
7774
|
-
if (!session?.user) {
|
|
7775
|
-
throw new TRPCError({
|
|
7776
|
-
code: 'UNAUTHORIZED',
|
|
7777
|
-
});
|
|
7778
|
-
}
|
|
7779
|
-
|
|
7780
|
-
return opts.next({ ctx: { session } });
|
|
7781
|
-
});
|
|
7782
|
-
`
|
|
7783
|
-
);
|
|
7784
|
-
sourceFile.addStatements(
|
|
7785
|
-
/* ts */
|
|
7786
|
-
`
|
|
7787
7772
|
export const createAction = createTRPCServerActionHandler(t, createContext);
|
|
7788
7773
|
`
|
|
7789
7774
|
);
|
|
@@ -7795,14 +7780,17 @@ export const protectedProcedure = publicProcedure.use((opts) => {
|
|
|
7795
7780
|
sourceFile.addStatements(
|
|
7796
7781
|
/* ts */
|
|
7797
7782
|
`
|
|
7798
|
-
export const ${procName} = t.procedure
|
|
7799
|
-
`
|
|
7783
|
+
export const ${procName} = t.procedure`
|
|
7800
7784
|
);
|
|
7801
7785
|
}
|
|
7802
7786
|
sourceFile.addStatements(
|
|
7803
7787
|
/* ts */
|
|
7804
7788
|
`
|
|
7805
|
-
.use(${middleware.type === "shield" ? "permissionsMiddleware" : "globalMiddleware"})
|
|
7789
|
+
.use(${middleware.type === "shield" ? "permissionsMiddleware" : "globalMiddleware"})${config.withNext ? `.experimental_caller(
|
|
7790
|
+
experimental_nextAppDirCaller({
|
|
7791
|
+
normalizeFormData: true,
|
|
7792
|
+
}),
|
|
7793
|
+
)` : ""}
|
|
7806
7794
|
`
|
|
7807
7795
|
);
|
|
7808
7796
|
});
|
|
@@ -11645,7 +11633,7 @@ async function generate(options) {
|
|
|
11645
11633
|
queries.sort();
|
|
11646
11634
|
mutations.sort();
|
|
11647
11635
|
subscriptions.sort();
|
|
11648
|
-
if (config.
|
|
11636
|
+
if (config.withShields !== false) {
|
|
11649
11637
|
consoleLog("Generating tRPC Shield");
|
|
11650
11638
|
const shieldOutputDir = outputDir;
|
|
11651
11639
|
consoleLog("Constructing tRPC Shield source file");
|
|
@@ -11700,8 +11688,8 @@ export default {${config.withNext ? "\n transformer," : ""}
|
|
|
11700
11688
|
overwrite: true
|
|
11701
11689
|
});
|
|
11702
11690
|
consoleLog("Generating tRPC imports");
|
|
11703
|
-
if (config.
|
|
11704
|
-
await generateShieldImport(createRouter, options, config.
|
|
11691
|
+
if (config.withShields) {
|
|
11692
|
+
await generateShieldImport(createRouter, options, config.withShields);
|
|
11705
11693
|
}
|
|
11706
11694
|
consoleLog("Generating tRPC base router");
|
|
11707
11695
|
await generateBaseRouter(createRouter, config, options);
|
package/dist/index.cjs
CHANGED
|
@@ -6879,13 +6879,13 @@ var configMiddleware = z.union([
|
|
|
6879
6879
|
]);
|
|
6880
6880
|
var configShield = z.union([
|
|
6881
6881
|
configBoolean,
|
|
6882
|
-
z.string().default("../src/trpc/
|
|
6882
|
+
z.string().default("../src/trpc/shields")
|
|
6883
6883
|
]);
|
|
6884
6884
|
var modelActionEnum = z.nativeEnum(ModelAction);
|
|
6885
6885
|
var configSchema = z.object({
|
|
6886
6886
|
debug: configBoolean.default("false"),
|
|
6887
|
-
withMiddleware: configMiddleware.default("
|
|
6888
|
-
|
|
6887
|
+
withMiddleware: configMiddleware.default("false"),
|
|
6888
|
+
withShields: configShield.default("true"),
|
|
6889
6889
|
withZod: configBoolean.default("true"),
|
|
6890
6890
|
withNext: configBoolean.default("true"),
|
|
6891
6891
|
contextPath: z.string().default("../src/trpc/context"),
|
|
@@ -7618,7 +7618,7 @@ __name(getRelativePath, "getRelativePath");
|
|
|
7618
7618
|
|
|
7619
7619
|
// src/helpers.ts
|
|
7620
7620
|
var getProcedureName = /* @__PURE__ */ __name((config) => {
|
|
7621
|
-
return config.
|
|
7621
|
+
return config.withShields ? "shieldedProcedure" : config.withMiddleware ? "protectedProcedure" : "publicProcedure";
|
|
7622
7622
|
}, "getProcedureName");
|
|
7623
7623
|
var generateCreateRouterImport = /* @__PURE__ */ __name(({ sourceFile, config }) => {
|
|
7624
7624
|
const imports = [
|
|
@@ -7678,6 +7678,7 @@ async function generateBaseRouter(sourceFile, config, options) {
|
|
|
7678
7678
|
`
|
|
7679
7679
|
import { createContext } from '${relativeContextPath}';
|
|
7680
7680
|
import { initTRPC, TRPCError } from '@trpc/server';
|
|
7681
|
+
import { experimental_nextAppDirCaller } from '@trpc/server/adapters/next-app-dir';
|
|
7681
7682
|
import { createTRPCServerActionHandler } from '@stryke/trpc-next/action-handler';
|
|
7682
7683
|
`
|
|
7683
7684
|
);
|
|
@@ -7726,7 +7727,7 @@ async function generateBaseRouter(sourceFile, config, options) {
|
|
|
7726
7727
|
)
|
|
7727
7728
|
});
|
|
7728
7729
|
}
|
|
7729
|
-
if (config.
|
|
7730
|
+
if (config.withShields) {
|
|
7730
7731
|
sourceFile.addStatements(
|
|
7731
7732
|
/* ts */
|
|
7732
7733
|
`
|
|
@@ -7759,22 +7760,6 @@ export const createCallerFactory = t.createCallerFactory;`
|
|
|
7759
7760
|
sourceFile.addStatements(
|
|
7760
7761
|
/* ts */
|
|
7761
7762
|
`
|
|
7762
|
-
export const protectedProcedure = publicProcedure.use((opts) => {
|
|
7763
|
-
const { session } = opts.ctx;
|
|
7764
|
-
|
|
7765
|
-
if (!session?.user) {
|
|
7766
|
-
throw new TRPCError({
|
|
7767
|
-
code: 'UNAUTHORIZED',
|
|
7768
|
-
});
|
|
7769
|
-
}
|
|
7770
|
-
|
|
7771
|
-
return opts.next({ ctx: { session } });
|
|
7772
|
-
});
|
|
7773
|
-
`
|
|
7774
|
-
);
|
|
7775
|
-
sourceFile.addStatements(
|
|
7776
|
-
/* ts */
|
|
7777
|
-
`
|
|
7778
7763
|
export const createAction = createTRPCServerActionHandler(t, createContext);
|
|
7779
7764
|
`
|
|
7780
7765
|
);
|
|
@@ -7786,14 +7771,17 @@ export const protectedProcedure = publicProcedure.use((opts) => {
|
|
|
7786
7771
|
sourceFile.addStatements(
|
|
7787
7772
|
/* ts */
|
|
7788
7773
|
`
|
|
7789
|
-
export const ${procName} = t.procedure
|
|
7790
|
-
`
|
|
7774
|
+
export const ${procName} = t.procedure`
|
|
7791
7775
|
);
|
|
7792
7776
|
}
|
|
7793
7777
|
sourceFile.addStatements(
|
|
7794
7778
|
/* ts */
|
|
7795
7779
|
`
|
|
7796
|
-
.use(${middleware.type === "shield" ? "permissionsMiddleware" : "globalMiddleware"})
|
|
7780
|
+
.use(${middleware.type === "shield" ? "permissionsMiddleware" : "globalMiddleware"})${config.withNext ? `.experimental_caller(
|
|
7781
|
+
experimental_nextAppDirCaller({
|
|
7782
|
+
normalizeFormData: true,
|
|
7783
|
+
}),
|
|
7784
|
+
)` : ""}
|
|
7797
7785
|
`
|
|
7798
7786
|
);
|
|
7799
7787
|
});
|
|
@@ -11636,7 +11624,7 @@ async function generate(options) {
|
|
|
11636
11624
|
queries.sort();
|
|
11637
11625
|
mutations.sort();
|
|
11638
11626
|
subscriptions.sort();
|
|
11639
|
-
if (config.
|
|
11627
|
+
if (config.withShields !== false) {
|
|
11640
11628
|
consoleLog("Generating tRPC Shield");
|
|
11641
11629
|
const shieldOutputDir = outputDir;
|
|
11642
11630
|
consoleLog("Constructing tRPC Shield source file");
|
|
@@ -11691,8 +11679,8 @@ export default {${config.withNext ? "\n transformer," : ""}
|
|
|
11691
11679
|
overwrite: true
|
|
11692
11680
|
});
|
|
11693
11681
|
consoleLog("Generating tRPC imports");
|
|
11694
|
-
if (config.
|
|
11695
|
-
await generateShieldImport(createRouter, options, config.
|
|
11682
|
+
if (config.withShields) {
|
|
11683
|
+
await generateShieldImport(createRouter, options, config.withShields);
|
|
11696
11684
|
}
|
|
11697
11685
|
consoleLog("Generating tRPC base router");
|
|
11698
11686
|
await generateBaseRouter(createRouter, config, options);
|
package/dist/index.js
CHANGED
|
@@ -6884,13 +6884,13 @@ var configMiddleware = z.union([
|
|
|
6884
6884
|
]);
|
|
6885
6885
|
var configShield = z.union([
|
|
6886
6886
|
configBoolean,
|
|
6887
|
-
z.string().default("../src/trpc/
|
|
6887
|
+
z.string().default("../src/trpc/shields")
|
|
6888
6888
|
]);
|
|
6889
6889
|
var modelActionEnum = z.nativeEnum(ModelAction);
|
|
6890
6890
|
var configSchema = z.object({
|
|
6891
6891
|
debug: configBoolean.default("false"),
|
|
6892
|
-
withMiddleware: configMiddleware.default("
|
|
6893
|
-
|
|
6892
|
+
withMiddleware: configMiddleware.default("false"),
|
|
6893
|
+
withShields: configShield.default("true"),
|
|
6894
6894
|
withZod: configBoolean.default("true"),
|
|
6895
6895
|
withNext: configBoolean.default("true"),
|
|
6896
6896
|
contextPath: z.string().default("../src/trpc/context"),
|
|
@@ -7623,7 +7623,7 @@ __name(getRelativePath, "getRelativePath");
|
|
|
7623
7623
|
|
|
7624
7624
|
// src/helpers.ts
|
|
7625
7625
|
var getProcedureName = /* @__PURE__ */ __name((config) => {
|
|
7626
|
-
return config.
|
|
7626
|
+
return config.withShields ? "shieldedProcedure" : config.withMiddleware ? "protectedProcedure" : "publicProcedure";
|
|
7627
7627
|
}, "getProcedureName");
|
|
7628
7628
|
var generateCreateRouterImport = /* @__PURE__ */ __name(({ sourceFile, config }) => {
|
|
7629
7629
|
const imports = [
|
|
@@ -7683,6 +7683,7 @@ async function generateBaseRouter(sourceFile, config, options) {
|
|
|
7683
7683
|
`
|
|
7684
7684
|
import { createContext } from '${relativeContextPath}';
|
|
7685
7685
|
import { initTRPC, TRPCError } from '@trpc/server';
|
|
7686
|
+
import { experimental_nextAppDirCaller } from '@trpc/server/adapters/next-app-dir';
|
|
7686
7687
|
import { createTRPCServerActionHandler } from '@stryke/trpc-next/action-handler';
|
|
7687
7688
|
`
|
|
7688
7689
|
);
|
|
@@ -7731,7 +7732,7 @@ async function generateBaseRouter(sourceFile, config, options) {
|
|
|
7731
7732
|
)
|
|
7732
7733
|
});
|
|
7733
7734
|
}
|
|
7734
|
-
if (config.
|
|
7735
|
+
if (config.withShields) {
|
|
7735
7736
|
sourceFile.addStatements(
|
|
7736
7737
|
/* ts */
|
|
7737
7738
|
`
|
|
@@ -7764,22 +7765,6 @@ export const createCallerFactory = t.createCallerFactory;`
|
|
|
7764
7765
|
sourceFile.addStatements(
|
|
7765
7766
|
/* ts */
|
|
7766
7767
|
`
|
|
7767
|
-
export const protectedProcedure = publicProcedure.use((opts) => {
|
|
7768
|
-
const { session } = opts.ctx;
|
|
7769
|
-
|
|
7770
|
-
if (!session?.user) {
|
|
7771
|
-
throw new TRPCError({
|
|
7772
|
-
code: 'UNAUTHORIZED',
|
|
7773
|
-
});
|
|
7774
|
-
}
|
|
7775
|
-
|
|
7776
|
-
return opts.next({ ctx: { session } });
|
|
7777
|
-
});
|
|
7778
|
-
`
|
|
7779
|
-
);
|
|
7780
|
-
sourceFile.addStatements(
|
|
7781
|
-
/* ts */
|
|
7782
|
-
`
|
|
7783
7768
|
export const createAction = createTRPCServerActionHandler(t, createContext);
|
|
7784
7769
|
`
|
|
7785
7770
|
);
|
|
@@ -7791,14 +7776,17 @@ export const protectedProcedure = publicProcedure.use((opts) => {
|
|
|
7791
7776
|
sourceFile.addStatements(
|
|
7792
7777
|
/* ts */
|
|
7793
7778
|
`
|
|
7794
|
-
export const ${procName} = t.procedure
|
|
7795
|
-
`
|
|
7779
|
+
export const ${procName} = t.procedure`
|
|
7796
7780
|
);
|
|
7797
7781
|
}
|
|
7798
7782
|
sourceFile.addStatements(
|
|
7799
7783
|
/* ts */
|
|
7800
7784
|
`
|
|
7801
|
-
.use(${middleware.type === "shield" ? "permissionsMiddleware" : "globalMiddleware"})
|
|
7785
|
+
.use(${middleware.type === "shield" ? "permissionsMiddleware" : "globalMiddleware"})${config.withNext ? `.experimental_caller(
|
|
7786
|
+
experimental_nextAppDirCaller({
|
|
7787
|
+
normalizeFormData: true,
|
|
7788
|
+
}),
|
|
7789
|
+
)` : ""}
|
|
7802
7790
|
`
|
|
7803
7791
|
);
|
|
7804
7792
|
});
|
|
@@ -11641,7 +11629,7 @@ async function generate(options) {
|
|
|
11641
11629
|
queries.sort();
|
|
11642
11630
|
mutations.sort();
|
|
11643
11631
|
subscriptions.sort();
|
|
11644
|
-
if (config.
|
|
11632
|
+
if (config.withShields !== false) {
|
|
11645
11633
|
consoleLog("Generating tRPC Shield");
|
|
11646
11634
|
const shieldOutputDir = outputDir;
|
|
11647
11635
|
consoleLog("Constructing tRPC Shield source file");
|
|
@@ -11696,8 +11684,8 @@ export default {${config.withNext ? "\n transformer," : ""}
|
|
|
11696
11684
|
overwrite: true
|
|
11697
11685
|
});
|
|
11698
11686
|
consoleLog("Generating tRPC imports");
|
|
11699
|
-
if (config.
|
|
11700
|
-
await generateShieldImport(createRouter, options, config.
|
|
11687
|
+
if (config.withShields) {
|
|
11688
|
+
await generateShieldImport(createRouter, options, config.withShields);
|
|
11701
11689
|
}
|
|
11702
11690
|
consoleLog("Generating tRPC base router");
|
|
11703
11691
|
await generateBaseRouter(createRouter, config, options);
|