@snowtop/ent 0.1.0-alpha133 → 0.1.0-alpha134

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.
@@ -420,8 +420,8 @@ class GQLCapture {
420
420
  if (inter) {
421
421
  const fields = this.customFields.get(inter.nodeName);
422
422
  if (fields) {
423
- // TODO check for duplicate fields
424
- // e.g. if field is already defined no need to add it
423
+ // check for duplicate fields
424
+ // if field is already defined no need to add it
425
425
  let objFields = this.customFields.get(obj.nodeName);
426
426
  if (!objFields) {
427
427
  objFields = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snowtop/ent",
3
- "version": "0.1.0-alpha133",
3
+ "version": "0.1.0-alpha134",
4
4
  "description": "snowtop ent framework",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -8,6 +8,7 @@
8
8
  "example": "examples"
9
9
  },
10
10
  "dependencies": {
11
+ "@swc-node/register": "^1.6.5",
11
12
  "@types/node": "^18.11.18",
12
13
  "camel-case": "^4.1.2",
13
14
  "cosmiconfig": "^8.0.0",
@@ -149,12 +149,20 @@ async function captureDynamic(filePath, gqlCapture) {
149
149
  return;
150
150
  }
151
151
  return await new Promise((resolve, reject) => {
152
- // do we eventually need tsconfig-paths here or do we get it by default because child process?
153
- const args = ["--swc", filePath];
154
- if (process.env.DISABLE_SWC) {
155
- args.shift();
152
+ // we seem to get tsconfig-paths by default because child process but not 100% sure...
153
+ const args = ["--transpileOnly"];
154
+ const env = {
155
+ ...process.env,
156
+ };
157
+ if (!process.env.DISABLE_SWC) {
158
+ args.push("-r", "@swc-node/register");
159
+ env.SWCRC = "true";
156
160
  }
157
- const r = (0, child_process_1.spawn)("ts-node", args);
161
+ args.push(filePath);
162
+ console.error("running ts-node", args, env);
163
+ const r = (0, child_process_1.spawn)("ts-node", args, {
164
+ env,
165
+ });
158
166
  const datas = [];
159
167
  r.stdout.on("data", (data) => {
160
168
  datas.push(data.toString());