@snowtop/ent 0.1.27 → 0.2.0-alpha.10-test1
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/action/orchestrator.js +13 -7
- package/core/base.d.ts +1 -0
- package/core/clause.d.ts +44 -0
- package/core/clause.js +75 -2
- package/core/db.d.ts +1 -1
- package/core/db.js +2 -2
- package/core/ent.d.ts +10 -2
- package/core/ent.js +11 -18
- package/core/loaders/assoc_edge_loader.d.ts +1 -1
- package/core/loaders/assoc_edge_loader.js +3 -3
- package/core/query/assoc_query.d.ts +2 -2
- package/core/query/assoc_query.js +14 -2
- package/core/query/custom_clause_query.d.ts +8 -6
- package/core/query/custom_clause_query.js +22 -7
- package/core/query/custom_query.d.ts +2 -2
- package/core/query/custom_query.js +1 -1
- package/core/query/query.d.ts +3 -7
- package/core/query/query.js +73 -199
- package/core/query/shared_test.d.ts +3 -3
- package/core/query/shared_test.js +31 -23
- package/core/query_impl.d.ts +0 -1
- package/core/query_impl.js +18 -1
- package/graphql/graphql.js +3 -0
- package/graphql/query/edge_connection.d.ts +5 -4
- package/graphql/query/edge_connection.js +34 -14
- package/graphql/query/shared_edge_connection.d.ts +2 -2
- package/graphql/query/shared_edge_connection.js +26 -13
- package/names/names.d.ts +10 -0
- package/names/names.js +157 -0
- package/package.json +1 -1
- package/schema/base_schema.js +2 -2
- package/schema/field.d.ts +1 -1
- package/schema/field.js +9 -8
- package/schema/schema.d.ts +1 -3
- package/schema/schema.js +2 -5
- package/schema/struct_field.js +12 -9
- package/scripts/read_schema.js +2 -2
- package/testutils/builder.js +7 -9
- package/testutils/db/temp_db.js +2 -2
- package/testutils/db/value.d.ts +1 -0
- package/testutils/db/value.js +2 -1
- package/testutils/db_mock.d.ts +1 -1
- package/testutils/db_mock.js +1 -1
- package/testutils/ent-graphql-tests/index.d.ts +1 -1
- package/testutils/ent-graphql-tests/index.js +5 -5
- package/testutils/fake_data/fake_contact.js +2 -2
- package/testutils/fake_data/fake_event.js +1 -1
- package/testutils/fake_data/test_helpers.js +3 -3
- package/testutils/fake_data/user_query.d.ts +5 -5
- package/testutils/fake_data/user_query.js +11 -14
- package/testutils/soft_delete.js +0 -4
- package/testutils/test_edge_global_schema.js +0 -2
- package/tsc/compilerOptions.js +4 -1
- package/tsc/transform_action.js +2 -2
package/testutils/builder.js
CHANGED
|
@@ -10,12 +10,11 @@ const action_1 = require("../action");
|
|
|
10
10
|
const schema_1 = require("../schema");
|
|
11
11
|
const db_mock_1 = require("./db_mock");
|
|
12
12
|
const pluralize_1 = __importDefault(require("pluralize"));
|
|
13
|
-
const snake_case_1 = require("snake-case");
|
|
14
13
|
const loaders_1 = require("../core/loaders");
|
|
15
14
|
const convert_1 = require("../core/convert");
|
|
16
|
-
const camel_case_1 = require("camel-case");
|
|
17
15
|
const base_schema_1 = require("../schema/base_schema");
|
|
18
16
|
const schema_2 = require("../schema/schema");
|
|
17
|
+
const names_1 = require("../names/names");
|
|
19
18
|
class BaseEnt {
|
|
20
19
|
constructor(viewer, data) {
|
|
21
20
|
this.viewer = viewer;
|
|
@@ -157,7 +156,7 @@ function getSchemaName(value) {
|
|
|
157
156
|
}
|
|
158
157
|
exports.getSchemaName = getSchemaName;
|
|
159
158
|
function getTableName(value) {
|
|
160
|
-
return (0, pluralize_1.default)((0,
|
|
159
|
+
return (0, pluralize_1.default)((0, names_1.toDBColumnOrTable)(value.ent.name)).toLowerCase();
|
|
161
160
|
}
|
|
162
161
|
exports.getTableName = getTableName;
|
|
163
162
|
const getDbFields = (schema) => {
|
|
@@ -212,17 +211,17 @@ class SimpleBuilder {
|
|
|
212
211
|
for (const [name, f] of schemaFields) {
|
|
213
212
|
dbFields.push((0, schema_2.getStorageKey)(f, name));
|
|
214
213
|
}
|
|
215
|
-
if (!schemaFields.has("id")
|
|
214
|
+
if (!schemaFields.has("id")) {
|
|
216
215
|
if (schemaFields.size !== 1) {
|
|
217
216
|
throw new Error(`no id field and multiple fields so can't deduce key. add an id field to schema`);
|
|
218
217
|
}
|
|
219
218
|
for (const [name, _] of fields) {
|
|
220
|
-
key = (0,
|
|
219
|
+
key = (0, names_1.toDBColumnOrTable)(name);
|
|
221
220
|
}
|
|
222
221
|
}
|
|
223
222
|
this.ent = schema.ent;
|
|
224
223
|
const tableName = getTableName(schema);
|
|
225
|
-
this.nodeType = (0,
|
|
224
|
+
this.nodeType = (0, names_1.toFieldName)(schema.ent.name);
|
|
226
225
|
const fieldInfo = getFieldInfo(schema);
|
|
227
226
|
this.orchestrator = new orchestrator_1.Orchestrator({
|
|
228
227
|
viewer: this.viewer,
|
|
@@ -270,9 +269,8 @@ class SimpleBuilder {
|
|
|
270
269
|
this.fields.set(k, input[k]);
|
|
271
270
|
}
|
|
272
271
|
else {
|
|
273
|
-
//
|
|
274
|
-
|
|
275
|
-
const sc = (0, snake_case_1.snakeCase)(k);
|
|
272
|
+
// TODO: ola 2/18/2024. we may not need both anymore?
|
|
273
|
+
const sc = (0, names_1.toDBColumnOrTable)(k);
|
|
276
274
|
if (knownFields.has(sc)) {
|
|
277
275
|
this.fields.set(sc, input[k]);
|
|
278
276
|
}
|
package/testutils/db/temp_db.js
CHANGED
|
@@ -34,9 +34,9 @@ const better_sqlite3_1 = __importDefault(require("better-sqlite3"));
|
|
|
34
34
|
const config_1 = require("../../core/config");
|
|
35
35
|
const fs = __importStar(require("fs"));
|
|
36
36
|
const schema_1 = require("../../schema");
|
|
37
|
-
const snake_case_1 = require("snake-case");
|
|
38
37
|
const builder_1 = require("../builder");
|
|
39
38
|
const test_edge_global_schema_1 = require("../test_edge_global_schema");
|
|
39
|
+
const names_1 = require("../../names/names");
|
|
40
40
|
function primaryKey(name, cols) {
|
|
41
41
|
return {
|
|
42
42
|
name: name,
|
|
@@ -790,7 +790,7 @@ function storageKey(fieldName, f) {
|
|
|
790
790
|
if (f.storageKey) {
|
|
791
791
|
return f.storageKey;
|
|
792
792
|
}
|
|
793
|
-
return (0,
|
|
793
|
+
return (0, names_1.toDBColumnOrTable)(fieldName);
|
|
794
794
|
}
|
|
795
795
|
function isSyncClient(client) {
|
|
796
796
|
return client.execSync !== undefined;
|
package/testutils/db/value.d.ts
CHANGED
package/testutils/db/value.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getDefaultValue = exports.randomEmail = void 0;
|
|
3
|
+
exports.getDefaultValue = exports.randomPhoneNumber = exports.randomEmail = void 0;
|
|
4
4
|
const uuid_1 = require("uuid");
|
|
5
5
|
const schema_1 = require("../../schema");
|
|
6
6
|
const schema_2 = require("../../schema");
|
|
@@ -15,6 +15,7 @@ exports.randomEmail = randomEmail;
|
|
|
15
15
|
function randomPhoneNumber() {
|
|
16
16
|
return `+1${Math.random().toString(10).substring(2, 11)}`;
|
|
17
17
|
}
|
|
18
|
+
exports.randomPhoneNumber = randomPhoneNumber;
|
|
18
19
|
function coinFlip() {
|
|
19
20
|
return Math.floor(Math.random() * 10) >= 5;
|
|
20
21
|
}
|
package/testutils/db_mock.d.ts
CHANGED
package/testutils/db_mock.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.QueryRecorder = exports.queryType = void 0;
|
|
4
|
-
const uuid_1 = require("uuid");
|
|
5
4
|
const jest_mock_1 = require("jest-mock");
|
|
5
|
+
const uuid_1 = require("uuid");
|
|
6
6
|
const parse_sql_1 = require("./parse_sql");
|
|
7
7
|
const eventEmitter = {
|
|
8
8
|
on: jest.fn(),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Express, RequestHandler } from "express";
|
|
2
|
-
import { Viewer } from "../../core/base";
|
|
3
2
|
import { GraphQLSchema } from "graphql";
|
|
4
3
|
import supertest from "supertest";
|
|
4
|
+
import { Viewer } from "../../core/base";
|
|
5
5
|
export type Option = [string, any] | [string, any, string];
|
|
6
6
|
interface queryConfig {
|
|
7
7
|
viewer?: Viewer;
|
|
@@ -30,12 +30,12 @@ exports.expectMutation = exports.expectQueryFromRoot = void 0;
|
|
|
30
30
|
// NB: this is copied from ent-graphql-tests package until I have time to figure out how to share code here effectively
|
|
31
31
|
// the circular dependencies btw this package and ent-graphql-tests seems to imply something needs to change
|
|
32
32
|
const express_1 = __importDefault(require("express"));
|
|
33
|
-
const
|
|
33
|
+
const fs = __importStar(require("fs"));
|
|
34
34
|
const graphql_1 = require("graphql");
|
|
35
|
-
const
|
|
35
|
+
const graphql_helix_1 = require("graphql-helix");
|
|
36
36
|
const supertest_1 = __importDefault(require("supertest"));
|
|
37
|
-
const fs = __importStar(require("fs"));
|
|
38
37
|
const util_1 = require("util");
|
|
38
|
+
const auth_1 = require("../../auth");
|
|
39
39
|
function server(config) {
|
|
40
40
|
const viewer = config.viewer;
|
|
41
41
|
if (viewer) {
|
|
@@ -125,7 +125,7 @@ function makeGraphQLRequest(config, query, fieldArgs) {
|
|
|
125
125
|
if (files.size) {
|
|
126
126
|
let ret = test
|
|
127
127
|
.post(config.graphQLPath || "/graphql")
|
|
128
|
-
.set(config.headers || {});
|
|
128
|
+
.set((config.headers || {}));
|
|
129
129
|
ret.field("operations", JSON.stringify({
|
|
130
130
|
query: query,
|
|
131
131
|
variables: variables,
|
|
@@ -152,7 +152,7 @@ function makeGraphQLRequest(config, query, fieldArgs) {
|
|
|
152
152
|
test,
|
|
153
153
|
test
|
|
154
154
|
.post(config.graphQLPath || "/graphql")
|
|
155
|
-
.set(config.headers || {})
|
|
155
|
+
.set((config.headers || {}))
|
|
156
156
|
.send({
|
|
157
157
|
query: query,
|
|
158
158
|
variables: JSON.stringify(variables),
|
|
@@ -130,7 +130,7 @@ exports.FakeContactSchema = (0, builder_1.getBuilderSchemaFromFields)({
|
|
|
130
130
|
lastName: (0, schema_1.StringType)(),
|
|
131
131
|
emailAddress: (0, schema_1.StringType)(),
|
|
132
132
|
userID: (0, schema_1.UUIDType)({
|
|
133
|
-
foreignKey: { schema: "User", column: "
|
|
133
|
+
foreignKey: { schema: "User", column: "id" },
|
|
134
134
|
}),
|
|
135
135
|
}, FakeContact);
|
|
136
136
|
exports.FakeContactSchemaWithDeletedAt = (0, builder_1.getBuilderSchemaFromFields)({
|
|
@@ -138,7 +138,7 @@ exports.FakeContactSchemaWithDeletedAt = (0, builder_1.getBuilderSchemaFromField
|
|
|
138
138
|
lastName: (0, schema_1.StringType)(),
|
|
139
139
|
emailAddress: (0, schema_1.StringType)(),
|
|
140
140
|
userID: (0, schema_1.UUIDType)({
|
|
141
|
-
foreignKey: { schema: "User", column: "
|
|
141
|
+
foreignKey: { schema: "User", column: "id" },
|
|
142
142
|
}),
|
|
143
143
|
}, FakeContact, {
|
|
144
144
|
patterns: [new soft_delete_1.DeletedAtPattern()],
|
|
@@ -132,7 +132,7 @@ exports.FakeEventSchema = (0, builder_1.getBuilderSchemaFromFields)({
|
|
|
132
132
|
nullable: true,
|
|
133
133
|
}),
|
|
134
134
|
userID: (0, schema_1.UUIDType)({
|
|
135
|
-
foreignKey: { schema: "User", column: "
|
|
135
|
+
foreignKey: { schema: "User", column: "id" },
|
|
136
136
|
}),
|
|
137
137
|
}, FakeEvent);
|
|
138
138
|
function getEventBuilder(viewer, input) {
|
|
@@ -4,7 +4,6 @@ exports.createAllEvents = exports.tempDBTables = exports.setupTempDB = exports.c
|
|
|
4
4
|
const jest_date_mock_1 = require("jest-date-mock");
|
|
5
5
|
const viewer_1 = require("../../core/viewer");
|
|
6
6
|
const ent_1 = require("../../core/ent");
|
|
7
|
-
const snake_case_1 = require("snake-case");
|
|
8
7
|
const write_1 = require("../write");
|
|
9
8
|
const temp_db_1 = require("../db/temp_db");
|
|
10
9
|
const _1 = require(".");
|
|
@@ -15,6 +14,7 @@ const builder_1 = require("../builder");
|
|
|
15
14
|
const action_1 = require("../../action");
|
|
16
15
|
const fake_tag_1 = require("./fake_tag");
|
|
17
16
|
const db_1 = require("../../core/db");
|
|
17
|
+
const names_1 = require("../../names/names");
|
|
18
18
|
function getContactInput(user, input) {
|
|
19
19
|
return {
|
|
20
20
|
firstName: "Jon",
|
|
@@ -190,7 +190,7 @@ async function createEdges() {
|
|
|
190
190
|
await (0, write_1.createRowForTest)({
|
|
191
191
|
tableName: "assoc_edge_config",
|
|
192
192
|
fields: {
|
|
193
|
-
edge_table: (0,
|
|
193
|
+
edge_table: (0, names_1.toDBColumnOrTable)(edge, "table"),
|
|
194
194
|
symmetric_edge: _1.SymmetricEdges.has(edge),
|
|
195
195
|
inverse_edge_type: _1.InverseEdges.get(edge) || null,
|
|
196
196
|
edge_type: edge,
|
|
@@ -206,7 +206,7 @@ async function createEdges() {
|
|
|
206
206
|
exports.createEdges = createEdges;
|
|
207
207
|
function edgeTableNames() {
|
|
208
208
|
const edges = Object.values(_1.EdgeType);
|
|
209
|
-
return edges.map((edge) => (0,
|
|
209
|
+
return edges.map((edge) => (0, names_1.toDBColumnOrTable)(edge, "table"));
|
|
210
210
|
}
|
|
211
211
|
exports.edgeTableNames = edgeTableNames;
|
|
212
212
|
async function createTestEvent(user, input) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Data, Ent, ID, Viewer } from "../../core/base";
|
|
2
|
-
import { CustomEdgeQueryBase } from "../../core/query/custom_query";
|
|
3
|
-
import { AssocEdge } from "../../core/ent";
|
|
4
2
|
import * as clause from "../../core/clause";
|
|
5
|
-
import {
|
|
6
|
-
import { FakeUser, FakeEvent, FakeContact, EventToAttendeesQuery, EventToDeclinedQuery, EventToHostsQuery, EventToInvitedQuery, EventToMaybeQuery } from "./internal";
|
|
7
|
-
import { RawCountLoaderFactory } from "../../core/loaders/raw_count_loader";
|
|
3
|
+
import { AssocEdge } from "../../core/ent";
|
|
8
4
|
import { QueryLoaderFactory } from "../../core/loaders/query_loader";
|
|
5
|
+
import { RawCountLoaderFactory } from "../../core/loaders/raw_count_loader";
|
|
6
|
+
import { AssocEdgeQueryBase, EdgeQuerySource } from "../../core/query/assoc_query";
|
|
7
|
+
import { CustomEdgeQueryBase } from "../../core/query/custom_query";
|
|
8
|
+
import { EventToAttendeesQuery, EventToDeclinedQuery, EventToHostsQuery, EventToInvitedQuery, EventToMaybeQuery, FakeContact, FakeEvent, FakeUser } from "./internal";
|
|
9
9
|
export declare class UserToContactsQuery extends AssocEdgeQueryBase<FakeUser, FakeContact, AssocEdge> {
|
|
10
10
|
constructor(viewer: Viewer, src: EdgeQuerySource<FakeUser>);
|
|
11
11
|
static query(viewer: Viewer, src: EdgeQuerySource<FakeUser>): UserToContactsQuery;
|
|
@@ -24,21 +24,20 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.UserToFollowingQuery = exports.UserToEventsInNextWeekQuery = exports.getCompleteClause = exports.getNextWeekClause = exports.UserToHostedEventsQuery = exports.UserToEventsAttendingQuery = exports.UserToIncomingFriendRequestsQuery = exports.UserToFriendRequestsQuery = exports.UserToCustomEdgeQuery = exports.CustomEdge = exports.UserToFriendsQuery = exports.UserToContactsFkeyQueryDeletedAtAsc = exports.UserToContactsFkeyQueryAsc = exports.UserToContactsFkeyQueryDeletedAt = exports.UserToContactsFkeyQuery = exports.UserToContactsFkeyQueryDeprecated = exports.userToContactsDataLoaderFactory = exports.userToContactsCountLoaderFactory = exports.UserToContactsQuery = void 0;
|
|
27
|
-
const
|
|
28
|
-
const
|
|
27
|
+
const jest_date_mock_1 = require("jest-date-mock");
|
|
28
|
+
const _1 = require(".");
|
|
29
29
|
const clause = __importStar(require("../../core/clause"));
|
|
30
|
-
const
|
|
31
|
-
const internal_1 = require("./internal");
|
|
32
|
-
const raw_count_loader_1 = require("../../core/loaders/raw_count_loader");
|
|
30
|
+
const ent_1 = require("../../core/ent");
|
|
33
31
|
const assoc_count_loader_1 = require("../../core/loaders/assoc_count_loader");
|
|
34
32
|
const assoc_edge_loader_1 = require("../../core/loaders/assoc_edge_loader");
|
|
35
|
-
const fake_contact_1 = require("./fake_contact");
|
|
36
|
-
const jest_date_mock_1 = require("jest-date-mock");
|
|
37
|
-
const luxon_1 = require("luxon");
|
|
38
33
|
const query_loader_1 = require("../../core/loaders/query_loader");
|
|
39
|
-
const
|
|
40
|
-
const _1 = require(".");
|
|
34
|
+
const raw_count_loader_1 = require("../../core/loaders/raw_count_loader");
|
|
41
35
|
const privacy_1 = require("../../core/privacy");
|
|
36
|
+
const assoc_query_1 = require("../../core/query/assoc_query");
|
|
37
|
+
const custom_query_1 = require("../../core/query/custom_query");
|
|
38
|
+
const mock_date_1 = require("./../mock_date");
|
|
39
|
+
const fake_contact_1 = require("./fake_contact");
|
|
40
|
+
const internal_1 = require("./internal");
|
|
42
41
|
class UserToContactsQuery extends assoc_query_1.AssocEdgeQueryBase {
|
|
43
42
|
constructor(viewer, src) {
|
|
44
43
|
super(viewer, src, new assoc_count_loader_1.AssocEdgeCountLoaderFactory(internal_1.EdgeType.UserToContacts), new assoc_edge_loader_1.AssocEdgeLoaderFactory(internal_1.EdgeType.UserToContacts, ent_1.AssocEdge), internal_1.FakeContact.loaderOptions());
|
|
@@ -351,10 +350,8 @@ const getNextWeekClause = () => {
|
|
|
351
350
|
(0, jest_date_mock_1.clear)();
|
|
352
351
|
const start = mock_date_1.MockDate.getDate();
|
|
353
352
|
// 7 days
|
|
354
|
-
const end =
|
|
355
|
-
|
|
356
|
-
.toISO();
|
|
357
|
-
return clause.And(clause.GreaterEq("start_time", start.toISOString()), clause.LessEq("start_time", end));
|
|
353
|
+
const end = new Date(start.getTime() + 86400 * 1000 * 7);
|
|
354
|
+
return clause.And(clause.GreaterEq("start_time", start.toISOString()), clause.LessEq("start_time", end.toISOString()));
|
|
358
355
|
};
|
|
359
356
|
exports.getNextWeekClause = getNextWeekClause;
|
|
360
357
|
function getCompleteClause(id) {
|
package/testutils/soft_delete.js
CHANGED
|
@@ -33,8 +33,6 @@ class DeletedAtPattern {
|
|
|
33
33
|
constructor() {
|
|
34
34
|
this.name = "deleted_at";
|
|
35
35
|
this.fields = {
|
|
36
|
-
// need this to be lowerCamelCase because we do this based on field name
|
|
37
|
-
// #510
|
|
38
36
|
deletedAt: (0, field_1.TimestampType)({
|
|
39
37
|
nullable: true,
|
|
40
38
|
index: true,
|
|
@@ -95,8 +93,6 @@ class DeletedAtPatternWithExtraWrites {
|
|
|
95
93
|
constructor() {
|
|
96
94
|
this.name = "deleted_at";
|
|
97
95
|
this.fields = {
|
|
98
|
-
// need this to be lowerCamelCase because we do this based on field name
|
|
99
|
-
// #510
|
|
100
96
|
deletedAt: (0, field_1.TimestampType)({
|
|
101
97
|
nullable: true,
|
|
102
98
|
index: true,
|
|
@@ -36,8 +36,6 @@ class EdgeWithDeletedAt extends ent_1.AssocEdge {
|
|
|
36
36
|
exports.EdgeWithDeletedAt = EdgeWithDeletedAt;
|
|
37
37
|
exports.testEdgeGlobalSchema = {
|
|
38
38
|
extraEdgeFields: {
|
|
39
|
-
// need this to be lowerCamelCase because we do this based on field name
|
|
40
|
-
// #510
|
|
41
39
|
deletedAt: (0, schema_1.TimestampType)({
|
|
42
40
|
nullable: true,
|
|
43
41
|
index: true,
|
package/tsc/compilerOptions.js
CHANGED
|
@@ -60,6 +60,9 @@ function readCompilerOptions(filePath) {
|
|
|
60
60
|
if (options.moduleResolution === "node") {
|
|
61
61
|
options.moduleResolution = typescript_1.default.ModuleResolutionKind.NodeJs;
|
|
62
62
|
}
|
|
63
|
+
if (options.target) {
|
|
64
|
+
options.target = getTarget(options.target.toString());
|
|
65
|
+
}
|
|
63
66
|
return options;
|
|
64
67
|
}
|
|
65
68
|
exports.readCompilerOptions = readCompilerOptions;
|
|
@@ -92,7 +95,7 @@ function getTarget(target) {
|
|
|
92
95
|
exports.getTarget = getTarget;
|
|
93
96
|
function getTargetFromCurrentDir() {
|
|
94
97
|
const options = readCompilerOptions(".");
|
|
95
|
-
return
|
|
98
|
+
return options.target ?? typescript_1.default.ScriptTarget.ESNext;
|
|
96
99
|
}
|
|
97
100
|
exports.getTargetFromCurrentDir = getTargetFromCurrentDir;
|
|
98
101
|
function createSourceFile(target, file) {
|
package/tsc/transform_action.js
CHANGED
|
@@ -31,7 +31,7 @@ const typescript_1 = __importDefault(require("typescript"));
|
|
|
31
31
|
const ast_1 = require("../tsc/ast");
|
|
32
32
|
const viewer_1 = require("../core/viewer");
|
|
33
33
|
const path = __importStar(require("path"));
|
|
34
|
-
const
|
|
34
|
+
const names_1 = require("../names/names");
|
|
35
35
|
// returns input and importPath
|
|
36
36
|
function getBaseFileInfo(file, classInfo, sourceFile) {
|
|
37
37
|
// @ts-ignore
|
|
@@ -155,7 +155,7 @@ class TransformAction {
|
|
|
155
155
|
klassContents += mm.getFullText(sourceFile);
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
|
-
const builderPath = `src/ent/generated/${(0,
|
|
158
|
+
const builderPath = `src/ent/generated/${(0, names_1.toFilePath)(nodeName)}/actions/${(0, names_1.toFilePath)(builder)}`;
|
|
159
159
|
let imports = new Map([
|
|
160
160
|
[
|
|
161
161
|
(0, ast_1.transformRelative)(file, this.customInfo.viewerInfo.path, this.customInfo.relativeImports),
|