@baeta/plugin-graphql 0.0.3 → 0.0.5

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.
@@ -296,7 +296,7 @@ function buildModule(name, doc, {
296
296
  function printMetadata() {
297
297
  return `export namespace ModuleMetadata {
298
298
  export const id = '${name}';
299
- export const dirname = __dirname;
299
+ export const dirname = './${name}';
300
300
  export const typedef = ${JSON.stringify(doc)} as unknown as DocumentNode;
301
301
  ${printBaetaManager()}
302
302
  }`;
@@ -1243,6 +1243,7 @@ async function generate(options) {
1243
1243
  makeResolverTypeCallable: true,
1244
1244
  includeDirectives: true,
1245
1245
  resolverTypeWrapperSignature: "T",
1246
+ emitLegacyCommonJSImports: false,
1246
1247
  scalars: {
1247
1248
  BigInt: "number",
1248
1249
  Bytes: "Buffer",
File without changes
@@ -281,7 +281,7 @@ function buildModule(name, doc, {
281
281
  function printMetadata() {
282
282
  return `export namespace ModuleMetadata {
283
283
  export const id = '${name}';
284
- export const dirname = __dirname;
284
+ export const dirname = './${name}';
285
285
  export const typedef = ${JSON.stringify(doc)} as unknown as DocumentNode;
286
286
  ${printBaetaManager()}
287
287
  }`;
@@ -1149,7 +1149,7 @@ import { PrismaLoader } from "@graphql-tools/prisma-loader";
1149
1149
  // utils/hash.ts
1150
1150
  import { getCachedDocumentNodeFromSchema as getCachedDocumentNodeFromSchema2 } from "@graphql-codegen/plugin-helpers";
1151
1151
  import { print } from "graphql";
1152
- import { createHash } from "crypto";
1152
+ import { createHash } from "node:crypto";
1153
1153
  function hashContent(content) {
1154
1154
  return createHash("sha256").update(content).digest("hex");
1155
1155
  }
@@ -1240,6 +1240,7 @@ async function generate(options) {
1240
1240
  makeResolverTypeCallable: true,
1241
1241
  includeDirectives: true,
1242
1242
  resolverTypeWrapperSignature: "T",
1243
+ emitLegacyCommonJSImports: false,
1243
1244
  scalars: {
1244
1245
  BigInt: "number",
1245
1246
  Bytes: "Buffer",
package/package.json CHANGED
@@ -1,12 +1,14 @@
1
1
  {
2
2
  "name": "@baeta/plugin-graphql",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "type": "module",
5
5
  "scripts": {
6
- "build": "tsup --dts"
6
+ "prepack": "yarn prep --move dist",
7
+ "postpack": "yarn prep --clean",
8
+ "build": "yarn tsup --dts"
7
9
  },
8
10
  "dependencies": {
9
- "@baeta/plugin": "^0.0.3",
11
+ "@baeta/plugin": "^0.0.4",
10
12
  "@graphql-codegen/core": "^2.6.2",
11
13
  "@graphql-codegen/plugin-helpers": "^2.7.1",
12
14
  "@graphql-codegen/typescript": "^2.7.3",
@@ -28,39 +30,36 @@
28
30
  "tslib": "^2.4.0"
29
31
  },
30
32
  "devDependencies": {
33
+ "@baeta/prep": "^0.0.0",
31
34
  "@types/node": "^18.7.23",
32
35
  "@types/parse-filepath": "1.0.0",
33
36
  "graphql": "^16.6.0",
34
- "tsup": "^6.2.3",
35
37
  "typescript": "^4.8.3"
36
38
  },
37
39
  "peerDependencies": {
38
- "@baeta/core": "^0.0.7",
40
+ "@baeta/core": "^0.0.11",
39
41
  "graphql": "^15.3.0 || ^16.0.0"
40
42
  },
41
43
  "files": [
42
- "dist"
44
+ "*.js",
45
+ "*.cjs",
46
+ "*.d.ts"
43
47
  ],
44
- "types": "./dist/index.d.ts",
45
48
  "publishConfig": {
46
49
  "access": "public",
47
- "main": "./dist/index.cjs",
48
- "module": "./dist/index.js",
49
50
  "exports": {
50
51
  ".": {
51
- "import": "./dist/index.js",
52
- "require": "./dist/index.cjs",
53
- "types": "./dist/index.d.ts"
52
+ "import": "./index.js",
53
+ "require": "./index.cjs",
54
+ "types": "./index.d.ts"
54
55
  }
55
56
  }
56
57
  },
57
- "main": "./dist/index.cjs",
58
- "module": "./dist/index.js",
59
58
  "exports": {
60
59
  ".": {
61
- "import": "./dist/index.js",
62
- "require": "./dist/index.cjs",
63
- "types": "./dist/index.d.ts"
60
+ "import": "./index.js",
61
+ "require": "./index.cjs",
62
+ "types": "./index.d.ts"
64
63
  }
65
64
  }
66
65
  }