@snowtop/ent 0.0.33 → 0.1.0-alpha2
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/action.d.ts +15 -14
- package/action/experimental_action.d.ts +20 -20
- package/action/experimental_action.js +1 -1
- package/action/orchestrator.d.ts +9 -9
- package/action/orchestrator.js +11 -11
- package/core/base.d.ts +12 -6
- package/core/ent.d.ts +2 -1
- package/core/ent.js +13 -8
- package/core/query/assoc_query.js +2 -2
- package/core/query/query.d.ts +1 -1
- package/imports/index.d.ts +0 -1
- package/imports/index.js +3 -36
- package/package.json +1 -1
- package/parse_schema/parse.d.ts +11 -2
- package/parse_schema/parse.js +52 -22
- package/schema/base_schema.js +15 -15
- package/schema/field.d.ts +24 -24
- package/schema/field.js +38 -40
- package/schema/index.d.ts +1 -1
- package/schema/json_field.d.ts +6 -6
- package/schema/json_field.js +2 -2
- package/schema/schema.d.ts +11 -7
- package/schema/schema.js +18 -5
- package/scripts/custom_compiler.js +2 -19
- package/scripts/transform_schema.d.ts +1 -0
- package/scripts/transform_schema.js +288 -0
- package/testutils/builder.d.ts +14 -13
- package/testutils/builder.js +2 -0
- package/testutils/db/test_db.js +9 -9
- package/testutils/fake_data/fake_contact.d.ts +2 -2
- package/testutils/fake_data/fake_contact.js +6 -13
- package/testutils/fake_data/fake_event.d.ts +2 -2
- package/testutils/fake_data/fake_event.js +8 -16
- package/testutils/fake_data/fake_user.d.ts +2 -2
- package/testutils/fake_data/fake_user.js +7 -16
- package/testutils/fake_data/user_query.d.ts +2 -2
- package/tsc/compilerOptions.d.ts +2 -0
- package/tsc/compilerOptions.js +61 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.readCompilerOptions = void 0;
|
|
26
|
+
const fs = __importStar(require("fs"));
|
|
27
|
+
const json5_1 = __importDefault(require("json5"));
|
|
28
|
+
const typescript_1 = __importDefault(require("typescript"));
|
|
29
|
+
const path = __importStar(require("path"));
|
|
30
|
+
function findTSConfigFile(filePath) {
|
|
31
|
+
while (filePath != "/") {
|
|
32
|
+
let configPath = `${filePath}/tsconfig.json`;
|
|
33
|
+
if (fs.existsSync(configPath)) {
|
|
34
|
+
return configPath;
|
|
35
|
+
}
|
|
36
|
+
filePath = path.join(filePath, "..");
|
|
37
|
+
}
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
function readCompilerOptions(filePath) {
|
|
41
|
+
let configPath = findTSConfigFile(filePath);
|
|
42
|
+
if (!configPath) {
|
|
43
|
+
return {};
|
|
44
|
+
}
|
|
45
|
+
let json = {};
|
|
46
|
+
try {
|
|
47
|
+
json = json5_1.default.parse(fs.readFileSync(configPath, {
|
|
48
|
+
encoding: "utf8",
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
catch (e) {
|
|
52
|
+
console.error("couldn't read tsconfig.json file");
|
|
53
|
+
}
|
|
54
|
+
let options = json["compilerOptions"] || {};
|
|
55
|
+
// @ts-ignore
|
|
56
|
+
if (options.moduleResolution === "node") {
|
|
57
|
+
options.moduleResolution = typescript_1.default.ModuleResolutionKind.NodeJs;
|
|
58
|
+
}
|
|
59
|
+
return options;
|
|
60
|
+
}
|
|
61
|
+
exports.readCompilerOptions = readCompilerOptions;
|