@venizia/dev-configs 0.4.7-0 → 0.4.7-1
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/LICENSE.md +1 -3
- package/README.md +1 -1
- package/dist/checks/catalog.d.ts +4 -2
- package/dist/checks/catalog.d.ts.map +1 -1
- package/dist/checks/catalog.js +72 -70
- package/dist/checks/catalog.js.map +1 -1
- package/dist/checks/module-cycles.d.ts +11 -9
- package/dist/checks/module-cycles.d.ts.map +1 -1
- package/dist/checks/module-cycles.js +32 -30
- package/dist/checks/module-cycles.js.map +1 -1
- package/dist/checks/purity/manifest.d.ts +44 -38
- package/dist/checks/purity/manifest.d.ts.map +1 -1
- package/dist/checks/purity/manifest.js +121 -115
- package/dist/checks/purity/manifest.js.map +1 -1
- package/dist/checks/purity/probe.d.ts +22 -18
- package/dist/checks/purity/probe.d.ts.map +1 -1
- package/dist/checks/purity/probe.js +99 -98
- package/dist/checks/purity/probe.js.map +1 -1
- package/dist/checks/purity/run.d.ts +18 -16
- package/dist/checks/purity/run.d.ts.map +1 -1
- package/dist/checks/purity/run.js +90 -86
- package/dist/checks/purity/run.js.map +1 -1
- package/dist/checks/test-controls.d.ts +17 -15
- package/dist/checks/test-controls.d.ts.map +1 -1
- package/dist/checks/test-controls.js +71 -70
- package/dist/checks/test-controls.js.map +1 -1
- package/dist/checks/test-dead-code.d.ts +5 -3
- package/dist/checks/test-dead-code.d.ts.map +1 -1
- package/dist/checks/test-dead-code.js +23 -21
- package/dist/checks/test-dead-code.js.map +1 -1
- package/dist/checks/test-mutate.d.ts +12 -7
- package/dist/checks/test-mutate.d.ts.map +1 -1
- package/dist/checks/test-mutate.js +59 -56
- package/dist/checks/test-mutate.js.map +1 -1
- package/dist/checks/test-weight.d.ts +11 -8
- package/dist/checks/test-weight.d.ts.map +1 -1
- package/dist/checks/test-weight.js +98 -94
- package/dist/checks/test-weight.js.map +1 -1
- package/dist/cli/check.d.ts.map +1 -1
- package/dist/cli/check.js +11 -8
- package/dist/cli/check.js.map +1 -1
- package/dist/cli/codemod/async-style.d.ts +29 -8
- package/dist/cli/codemod/async-style.d.ts.map +1 -1
- package/dist/cli/codemod/async-style.js +102 -20
- package/dist/cli/codemod/async-style.js.map +1 -1
- package/dist/cli/codemod/index.d.ts.map +1 -1
- package/dist/cli/codemod/index.js +6 -2
- package/dist/cli/codemod/index.js.map +1 -1
- package/dist/cli/codemod/model-settings.d.ts +7 -5
- package/dist/cli/codemod/model-settings.d.ts.map +1 -1
- package/dist/cli/codemod/model-settings.js +293 -291
- package/dist/cli/codemod/model-settings.js.map +1 -1
- package/dist/cli/codemod/namespace-functions/index.d.ts +20 -0
- package/dist/cli/codemod/namespace-functions/index.d.ts.map +1 -0
- package/dist/cli/codemod/namespace-functions/index.js +182 -0
- package/dist/cli/codemod/namespace-functions/index.js.map +1 -0
- package/dist/cli/codemod/namespace-functions/logger-scope.d.ts +32 -0
- package/dist/cli/codemod/namespace-functions/logger-scope.d.ts.map +1 -0
- package/dist/cli/codemod/namespace-functions/logger-scope.js +128 -0
- package/dist/cli/codemod/namespace-functions/logger-scope.js.map +1 -0
- package/dist/cli/codemod/namespace-functions/mapping.d.ts +66 -0
- package/dist/cli/codemod/namespace-functions/mapping.d.ts.map +1 -0
- package/dist/cli/codemod/namespace-functions/mapping.js +99 -0
- package/dist/cli/codemod/namespace-functions/mapping.js.map +1 -0
- package/dist/cli/codemod/namespace-functions/mappings/boot.d.ts +7 -0
- package/dist/cli/codemod/namespace-functions/mappings/boot.d.ts.map +1 -0
- package/dist/cli/codemod/namespace-functions/mappings/boot.js +28 -0
- package/dist/cli/codemod/namespace-functions/mappings/boot.js.map +1 -0
- package/dist/cli/codemod/namespace-functions/mappings/connectors.d.ts +4 -0
- package/dist/cli/codemod/namespace-functions/mappings/connectors.d.ts.map +1 -0
- package/dist/cli/codemod/namespace-functions/mappings/connectors.js +218 -0
- package/dist/cli/codemod/namespace-functions/mappings/connectors.js.map +1 -0
- package/dist/cli/codemod/namespace-functions/mappings/core-server.d.ts +7 -0
- package/dist/cli/codemod/namespace-functions/mappings/core-server.d.ts.map +1 -0
- package/dist/cli/codemod/namespace-functions/mappings/core-server.js +162 -0
- package/dist/cli/codemod/namespace-functions/mappings/core-server.js.map +1 -0
- package/dist/cli/codemod/namespace-functions/mappings/core-worker.d.ts +7 -0
- package/dist/cli/codemod/namespace-functions/mappings/core-worker.d.ts.map +1 -0
- package/dist/cli/codemod/namespace-functions/mappings/core-worker.js +18 -0
- package/dist/cli/codemod/namespace-functions/mappings/core-worker.js.map +1 -0
- package/dist/cli/codemod/namespace-functions/mappings/dev-configs.d.ts +7 -0
- package/dist/cli/codemod/namespace-functions/mappings/dev-configs.d.ts.map +1 -0
- package/dist/cli/codemod/namespace-functions/mappings/dev-configs.js +192 -0
- package/dist/cli/codemod/namespace-functions/mappings/dev-configs.js.map +1 -0
- package/dist/cli/codemod/namespace-functions/mappings/filter.d.ts +7 -0
- package/dist/cli/codemod/namespace-functions/mappings/filter.d.ts.map +1 -0
- package/dist/cli/codemod/namespace-functions/mappings/filter.js +30 -0
- package/dist/cli/codemod/namespace-functions/mappings/filter.js.map +1 -0
- package/dist/cli/codemod/namespace-functions/mappings/helpers.d.ts +16 -0
- package/dist/cli/codemod/namespace-functions/mappings/helpers.d.ts.map +1 -0
- package/dist/cli/codemod/namespace-functions/mappings/helpers.js +535 -0
- package/dist/cli/codemod/namespace-functions/mappings/helpers.js.map +1 -0
- package/dist/cli/codemod/namespace-functions/mappings/index.d.ts +4 -0
- package/dist/cli/codemod/namespace-functions/mappings/index.d.ts.map +1 -0
- package/dist/cli/codemod/namespace-functions/mappings/index.js +25 -0
- package/dist/cli/codemod/namespace-functions/mappings/index.js.map +1 -0
- package/dist/cli/codemod/namespace-functions/mappings/inversion.d.ts +10 -0
- package/dist/cli/codemod/namespace-functions/mappings/inversion.d.ts.map +1 -0
- package/dist/cli/codemod/namespace-functions/mappings/inversion.js +81 -0
- package/dist/cli/codemod/namespace-functions/mappings/inversion.js.map +1 -0
- package/dist/cli/codemod/namespace-functions/mappings/kernel.d.ts +17 -0
- package/dist/cli/codemod/namespace-functions/mappings/kernel.d.ts.map +1 -0
- package/dist/cli/codemod/namespace-functions/mappings/kernel.js +229 -0
- package/dist/cli/codemod/namespace-functions/mappings/kernel.js.map +1 -0
- package/dist/cli/codemod/namespace-functions/rewriter.d.ts +61 -0
- package/dist/cli/codemod/namespace-functions/rewriter.d.ts.map +1 -0
- package/dist/cli/codemod/namespace-functions/rewriter.js +564 -0
- package/dist/cli/codemod/namespace-functions/rewriter.js.map +1 -0
- package/dist/cli/index.js +2 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/compilers/bun.d.ts +1 -1
- package/dist/compilers/bun.js +1 -1
- package/dist/compilers/bun.js.map +1 -1
- package/dist/linters/house/await-support.d.ts +17 -3
- package/dist/linters/house/await-support.d.ts.map +1 -1
- package/dist/linters/house/await-support.js +52 -23
- package/dist/linters/house/await-support.js.map +1 -1
- package/dist/linters/house/common.d.ts +13 -9
- package/dist/linters/house/common.d.ts.map +1 -1
- package/dist/linters/house/common.js +18 -15
- package/dist/linters/house/common.js.map +1 -1
- package/dist/linters/house/configs.d.ts +5 -2
- package/dist/linters/house/configs.d.ts.map +1 -1
- package/dist/linters/house/configs.js +11 -2
- package/dist/linters/house/configs.js.map +1 -1
- package/dist/linters/house/const-class-values.rule.d.ts.map +1 -1
- package/dist/linters/house/const-class-values.rule.js +27 -19
- package/dist/linters/house/const-class-values.rule.js.map +1 -1
- package/dist/linters/house/effect-cleanup-consistency.rule.js +3 -3
- package/dist/linters/house/effect-cleanup-consistency.rule.js.map +1 -1
- package/dist/linters/house/hook-support.d.ts.map +1 -1
- package/dist/linters/house/hook-support.js +17 -14
- package/dist/linters/house/hook-support.js.map +1 -1
- package/dist/linters/house/index.d.ts +3 -0
- package/dist/linters/house/index.d.ts.map +1 -1
- package/dist/linters/house/index.js +3 -0
- package/dist/linters/house/index.js.map +1 -1
- package/dist/linters/house/max-params-own.rule.d.ts.map +1 -1
- package/dist/linters/house/max-params-own.rule.js +33 -24
- package/dist/linters/house/max-params-own.rule.js.map +1 -1
- package/dist/linters/house/no-async-hook-callback.rule.js +1 -1
- package/dist/linters/house/no-async-hook-callback.rule.js.map +1 -1
- package/dist/linters/house/no-await-promise-chain.rule.d.ts +24 -0
- package/dist/linters/house/no-await-promise-chain.rule.d.ts.map +1 -0
- package/dist/linters/house/no-await-promise-chain.rule.js +298 -0
- package/dist/linters/house/no-await-promise-chain.rule.js.map +1 -0
- package/dist/linters/house/no-inline-await.rule.d.ts.map +1 -1
- package/dist/linters/house/no-inline-await.rule.js +6 -12
- package/dist/linters/house/no-inline-await.rule.js.map +1 -1
- package/dist/linters/house/no-new-error.rule.js +4 -4
- package/dist/linters/house/no-new-error.rule.js.map +1 -1
- package/dist/linters/house/no-return-await.rule.d.ts.map +1 -1
- package/dist/linters/house/no-return-await.rule.js +11 -11
- package/dist/linters/house/no-return-await.rule.js.map +1 -1
- package/dist/linters/house/no-silent-catch.rule.d.ts +22 -0
- package/dist/linters/house/no-silent-catch.rule.d.ts.map +1 -0
- package/dist/linters/house/no-silent-catch.rule.js +88 -0
- package/dist/linters/house/no-silent-catch.rule.js.map +1 -0
- package/dist/linters/house/plugin.d.ts.map +1 -1
- package/dist/linters/house/plugin.js +4 -0
- package/dist/linters/house/plugin.js.map +1 -1
- package/dist/linters/house/promise-chain-support.d.ts +49 -0
- package/dist/linters/house/promise-chain-support.d.ts.map +1 -0
- package/dist/linters/house/promise-chain-support.js +188 -0
- package/dist/linters/house/promise-chain-support.js.map +1 -0
- package/dist/linters/rules/no-restricted-properties.rule.js +1 -1
- package/dist/linters/rules/no-restricted-properties.rule.js.map +1 -1
- package/dist/testing/rejection.helper.d.ts +25 -20
- package/dist/testing/rejection.helper.d.ts.map +1 -1
- package/dist/testing/rejection.helper.js +33 -31
- package/dist/testing/rejection.helper.js.map +1 -1
- package/dist/testing/repo-tmp.d.ts +19 -9
- package/dist/testing/repo-tmp.d.ts.map +1 -1
- package/dist/testing/repo-tmp.js +50 -48
- package/dist/testing/repo-tmp.js.map +1 -1
- package/dist/testing/spawn.helper.d.ts +12 -10
- package/dist/testing/spawn.helper.d.ts.map +1 -1
- package/dist/testing/spawn.helper.js +22 -16
- package/dist/testing/spawn.helper.js.map +1 -1
- package/dist/testing/tmpdir-preload.js +1 -1
- package/dist/testing/tmpdir-preload.js.map +1 -1
- package/package.json +2 -3
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The table behind `devz codemod namespace-functions`. One entry per public function that moved into
|
|
3
|
+
* a class: the old name is no longer exported, and the codemod moves callers to the class form, so an
|
|
4
|
+
* entry is the only upgrade path for that name.
|
|
5
|
+
*
|
|
6
|
+
* How an entry is written, in the file of the package that exports the old name
|
|
7
|
+
* (`mappings/<package-dir>.ts`):
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* {
|
|
11
|
+
* // Every module specifier the old name can be imported from: the root, a subpath, a re-export.
|
|
12
|
+
* modules: ['@venizia/ignis-helpers', '@venizia/ignis-helpers/core'],
|
|
13
|
+
* oldName: 'float',
|
|
14
|
+
* className: 'ParseUtility',
|
|
15
|
+
* method: 'toFloat',
|
|
16
|
+
* // Where the class is imported from, when that is not where the old name came from. Optional.
|
|
17
|
+
* newModules: ['@venizia/ignis-helpers'],
|
|
18
|
+
* // The old positional parameters in order; each becomes a key of the options object. A parameter
|
|
19
|
+
* // that has a default value in the old function is `optional`, and an optional one is never
|
|
20
|
+
* // followed by a required one.
|
|
21
|
+
* params: [{ key: 'input' }, { key: 'digit', optional: true }],
|
|
22
|
+
* // The old rest parameter, if any (`float` has none): its arguments go under this key as one
|
|
23
|
+
* // array, `[]` when the call passes none. Optional.
|
|
24
|
+
* // restKey: 'values',
|
|
25
|
+
* }
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* So `float(value, 3)` becomes `ParseUtility.toFloat({ input: value, digit: 3 })`, and `float(input)`
|
|
29
|
+
* becomes `ParseUtility.toFloat({ input })`. Add the entry in the pull request that adds the class
|
|
30
|
+
* and removes the old export, never before: the codemod would rewrite callers to a method that does not
|
|
31
|
+
* exist yet. `NamespaceMappings.validate` checks every entry in the test suite.
|
|
32
|
+
*/
|
|
33
|
+
/** One old positional parameter, and the key it becomes in the options object. */
|
|
34
|
+
export interface INamespaceMappingParameter {
|
|
35
|
+
key: string;
|
|
36
|
+
/** The old parameter has a default value: a call may leave it out, and then the key is left out. */
|
|
37
|
+
optional?: boolean;
|
|
38
|
+
}
|
|
39
|
+
/** One function that moved into a class. */
|
|
40
|
+
export interface INamespaceMapping {
|
|
41
|
+
/** Every module specifier the old name can be imported from. */
|
|
42
|
+
modules: string[];
|
|
43
|
+
oldName: string;
|
|
44
|
+
className: string;
|
|
45
|
+
method: string;
|
|
46
|
+
/** Where the class is imported from; without it, from the module the old name was imported from. */
|
|
47
|
+
newModules?: string[];
|
|
48
|
+
/** The old positional parameters, in order. */
|
|
49
|
+
params: INamespaceMappingParameter[];
|
|
50
|
+
/** The old rest parameter: its arguments are passed as one array under this key. */
|
|
51
|
+
restKey?: string;
|
|
52
|
+
/**
|
|
53
|
+
* The old function already takes ONE options object and the method takes the same one, so a call
|
|
54
|
+
* keeps its arguments and only the callee changes: `isEmpty({ value })` becomes
|
|
55
|
+
* `ObjectUtility.isEmpty({ value })`. `params` is empty and `restKey` unset for such an entry.
|
|
56
|
+
*/
|
|
57
|
+
keepsOptions?: boolean;
|
|
58
|
+
}
|
|
59
|
+
/** Checks a mapping table. */
|
|
60
|
+
export declare class NamespaceMappings {
|
|
61
|
+
/** What is wrong with the table, one line per problem; empty when every entry is usable. */
|
|
62
|
+
static validate(opts: {
|
|
63
|
+
mappings: ReadonlyArray<INamespaceMapping>;
|
|
64
|
+
}): string[];
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=mapping.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapping.d.ts","sourceRoot":"","sources":["../../../../src/cli/codemod/namespace-functions/mapping.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,kFAAkF;AAClF,MAAM,WAAW,0BAA0B;IACzC,GAAG,EAAE,MAAM,CAAC;IACZ,oGAAoG;IACpG,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,4CAA4C;AAC5C,MAAM,WAAW,iBAAiB;IAChC,gEAAgE;IAChE,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,oGAAoG;IACpG,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,+CAA+C;IAC/C,MAAM,EAAE,0BAA0B,EAAE,CAAC;IACrC,oFAAoF;IACpF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAID,8BAA8B;AAC9B,qBAAa,iBAAiB;IAC5B,4FAA4F;IAC5F,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE;QAAE,QAAQ,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAA;KAAE,GAAG,MAAM,EAAE;CAuEhF"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* The table behind `devz codemod namespace-functions`. One entry per public function that moved into
|
|
4
|
+
* a class: the old name is no longer exported, and the codemod moves callers to the class form, so an
|
|
5
|
+
* entry is the only upgrade path for that name.
|
|
6
|
+
*
|
|
7
|
+
* How an entry is written, in the file of the package that exports the old name
|
|
8
|
+
* (`mappings/<package-dir>.ts`):
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
11
|
+
* {
|
|
12
|
+
* // Every module specifier the old name can be imported from: the root, a subpath, a re-export.
|
|
13
|
+
* modules: ['@venizia/ignis-helpers', '@venizia/ignis-helpers/core'],
|
|
14
|
+
* oldName: 'float',
|
|
15
|
+
* className: 'ParseUtility',
|
|
16
|
+
* method: 'toFloat',
|
|
17
|
+
* // Where the class is imported from, when that is not where the old name came from. Optional.
|
|
18
|
+
* newModules: ['@venizia/ignis-helpers'],
|
|
19
|
+
* // The old positional parameters in order; each becomes a key of the options object. A parameter
|
|
20
|
+
* // that has a default value in the old function is `optional`, and an optional one is never
|
|
21
|
+
* // followed by a required one.
|
|
22
|
+
* params: [{ key: 'input' }, { key: 'digit', optional: true }],
|
|
23
|
+
* // The old rest parameter, if any (`float` has none): its arguments go under this key as one
|
|
24
|
+
* // array, `[]` when the call passes none. Optional.
|
|
25
|
+
* // restKey: 'values',
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* So `float(value, 3)` becomes `ParseUtility.toFloat({ input: value, digit: 3 })`, and `float(input)`
|
|
30
|
+
* becomes `ParseUtility.toFloat({ input })`. Add the entry in the pull request that adds the class
|
|
31
|
+
* and removes the old export, never before: the codemod would rewrite callers to a method that does not
|
|
32
|
+
* exist yet. `NamespaceMappings.validate` checks every entry in the test suite.
|
|
33
|
+
*/
|
|
34
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
+
exports.NamespaceMappings = void 0;
|
|
36
|
+
const IDENTIFIER = /^[A-Za-z_$][\w$]*$/;
|
|
37
|
+
/** Checks a mapping table. */
|
|
38
|
+
class NamespaceMappings {
|
|
39
|
+
/** What is wrong with the table, one line per problem; empty when every entry is usable. */
|
|
40
|
+
static validate(opts) {
|
|
41
|
+
const { mappings } = opts;
|
|
42
|
+
const problems = [];
|
|
43
|
+
const seen = new Set();
|
|
44
|
+
for (const mapping of mappings) {
|
|
45
|
+
const label = `${mapping.oldName} -> ${mapping.className}.${mapping.method}`;
|
|
46
|
+
for (const [field, value] of [
|
|
47
|
+
['oldName', mapping.oldName],
|
|
48
|
+
['className', mapping.className],
|
|
49
|
+
['method', mapping.method],
|
|
50
|
+
]) {
|
|
51
|
+
if (!IDENTIFIER.test(value)) {
|
|
52
|
+
problems.push(`${label}: ${field} "${value}" is not an identifier`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (mapping.modules.length === 0 || mapping.modules.some((module) => module.trim() === '')) {
|
|
56
|
+
problems.push(`${label}: modules must list at least one module specifier, none empty`);
|
|
57
|
+
}
|
|
58
|
+
if (mapping.newModules?.length === 0) {
|
|
59
|
+
problems.push(`${label}: newModules, when given, lists at least one module specifier`);
|
|
60
|
+
}
|
|
61
|
+
const keys = new Set();
|
|
62
|
+
let isOptionalSeen = false;
|
|
63
|
+
for (const parameter of mapping.params) {
|
|
64
|
+
if (!IDENTIFIER.test(parameter.key)) {
|
|
65
|
+
problems.push(`${label}: the parameter key "${parameter.key}" is not an identifier`);
|
|
66
|
+
}
|
|
67
|
+
if (keys.has(parameter.key)) {
|
|
68
|
+
problems.push(`${label}: the parameter key "${parameter.key}" is listed twice`);
|
|
69
|
+
}
|
|
70
|
+
keys.add(parameter.key);
|
|
71
|
+
if (isOptionalSeen && !parameter.optional) {
|
|
72
|
+
problems.push(`${label}: the required parameter "${parameter.key}" follows an optional one`);
|
|
73
|
+
}
|
|
74
|
+
isOptionalSeen = isOptionalSeen || parameter.optional === true;
|
|
75
|
+
}
|
|
76
|
+
if (mapping.restKey !== undefined) {
|
|
77
|
+
if (!IDENTIFIER.test(mapping.restKey)) {
|
|
78
|
+
problems.push(`${label}: restKey "${mapping.restKey}" is not an identifier`);
|
|
79
|
+
}
|
|
80
|
+
if (keys.has(mapping.restKey)) {
|
|
81
|
+
problems.push(`${label}: restKey "${mapping.restKey}" is also a parameter key`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (mapping.keepsOptions && (mapping.params.length > 0 || mapping.restKey !== undefined)) {
|
|
85
|
+
problems.push(`${label}: keepsOptions leaves params empty and restKey unset`);
|
|
86
|
+
}
|
|
87
|
+
for (const module of mapping.modules) {
|
|
88
|
+
const id = `${module}#${mapping.oldName}`;
|
|
89
|
+
if (seen.has(id)) {
|
|
90
|
+
problems.push(`${label}: ${mapping.oldName} from ${module} has two entries`);
|
|
91
|
+
}
|
|
92
|
+
seen.add(id);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return problems;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
exports.NamespaceMappings = NamespaceMappings;
|
|
99
|
+
//# sourceMappingURL=mapping.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapping.js","sourceRoot":"","sources":["../../../../src/cli/codemod/namespace-functions/mapping.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;;;AA8BH,MAAM,UAAU,GAAG,oBAAoB,CAAC;AAExC,8BAA8B;AAC9B,MAAa,iBAAiB;IAC5B,4FAA4F;IAC5F,MAAM,CAAC,QAAQ,CAAC,IAAoD;QAClE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;QAC1B,MAAM,QAAQ,GAAa,EAAE,CAAC;QAC9B,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;QAE/B,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC/B,MAAM,KAAK,GAAG,GAAG,OAAO,CAAC,OAAO,OAAO,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;YAE7E,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI;gBAC3B,CAAC,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC;gBAC5B,CAAC,WAAW,EAAE,OAAO,CAAC,SAAS,CAAC;gBAChC,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC;aAClB,EAAE,CAAC;gBACX,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;oBAC5B,QAAQ,CAAC,IAAI,CAAC,GAAG,K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,IAAI,SAAS,CAAC,QAAQ,KAAK,IAAI,CAAC;YACjE,CAAC;YAED,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;gBAClC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;oBACtC,QAAQ,CAAC,IAAI,CAAC,GAAG,KAAK,cAAc,OAAO,CAAC,OAAO,wBAAwB,CAAC,CAAC;gBAC/E,CAAC;gBAED,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;oBAC9B,QAAQ,CAAC,IAAI,CAAC,GAAG,KAAK,cAAc,OAAO,CAAC,OAAO,2BAA2B,CAAC,CAAC;gBAClF,CAAC;YACH,CAAC;YAED,IAAI,OAAO,CAAC,YAAY,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,CAAC,EAAE,CAAC;gBACzF,QAAQ,CAAC,IAAI,CAAC,GAAG,KAAK,sDAAsD,CAAC,CAAC;YAChF,CAAC;YAED,KAAK,MAAM,MAAM,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;gBACrC,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;gBAC1C,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;oBACjB,QAAQ,CAAC,IAAI,CAAC,GAAG,KAAK,KAAK,OAAO,CAAC,OAAO,SAAS,MAAM,kBAAkB,CAAC,CAAC;gBAC/E,CAAC;gBACD,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACf,CAAC;QACH,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAzED,8CAyEC","sourcesContent":["/**\n * The table behind `devz codemod namespace-functions`. One entry per public function that moved into\n * a class: the old name is no longer exported, and the codemod moves callers to the class form, so an\n * entry is the only upgrade path for that name.\n *\n * How an entry is written, in the file of the package that exports the old name\n * (`mappings/<package-dir>.ts`):\n *\n * ```ts\n * {\n * // Every module specifier the old name can be imported from: the root, a subpath, a re-export.\n * modules: ['@venizia/ignis-helpers', '@venizia/ignis-helpers/core'],\n * oldName: 'float',\n * className: 'ParseUtility',\n * method: 'toFloat',\n * // Where the class is imported from, when that is not where the old name came from. Optional.\n * newModules: ['@venizia/ignis-helpers'],\n * // The old positional parameters in order; each becomes a key of the options object. A parameter\n * // that has a default value in the old function is `optional`, and an optional one is never\n * // followed by a required one.\n * params: [{ key: 'input' }, { key: 'digit', optional: true }],\n * // The old rest parameter, if any (`float` has none): its arguments go under this key as one\n * // array, `[]` when the call passes none. Optional.\n * // restKey: 'values',\n * }\n * ```\n *\n * So `float(value, 3)` becomes `ParseUtility.toFloat({ input: value, digit: 3 })`, and `float(input)`\n * becomes `ParseUtility.toFloat({ input })`. Add the entry in the pull request that adds the class\n * and removes the old export, never before: the codemod would rewrite callers to a method that does not\n * exist yet. `NamespaceMappings.validate` checks every entry in the test suite.\n */\n\n/** One old positional parameter, and the key it becomes in the options object. */\nexport interface INamespaceMappingParameter {\n key: string;\n /** The old parameter has a default value: a call may leave it out, and then the key is left out. */\n optional?: boolean;\n}\n\n/** One function that moved into a class. */\nexport interface INamespaceMapping {\n /** Every module specifier the old name can be imported from. */\n modules: string[];\n oldName: string;\n className: string;\n method: string;\n /** Where the class is imported from; without it, from the module the old name was imported from. */\n newModules?: string[];\n /** The old positional parameters, in order. */\n params: INamespaceMappingParameter[];\n /** The old rest parameter: its arguments are passed as one array under this key. */\n restKey?: string;\n /**\n * The old function already takes ONE options object and the method takes the same one, so a call\n * keeps its arguments and only the callee changes: `isEmpty({ value })` becomes\n * `ObjectUtility.isEmpty({ value })`. `params` is empty and `restKey` unset for such an entry.\n */\n keepsOptions?: boolean;\n}\n\nconst IDENTIFIER = /^[A-Za-z_$][\\w$]*$/;\n\n/** Checks a mapping table. */\nexport class NamespaceMappings {\n /** What is wrong with the table, one line per problem; empty when every entry is usable. */\n static validate(opts: { mappings: ReadonlyArray<INamespaceMapping> }): string[] {\n const { mappings } = opts;\n const problems: string[] = [];\n const seen = new Set<string>();\n\n for (const mapping of mappings) {\n const label = `${mapping.oldName} -> ${mapping.className}.${mapping.method}`;\n\n for (const [field, value] of [\n ['oldName', mapping.oldName],\n ['className', mapping.className],\n ['method', mapping.method],\n ] as const) {\n if (!IDENTIFIER.test(value)) {\n problems.push(`${label}: ${field} \"${value}\" is not an identifier`);\n }\n }\n\n if (mapping.modules.length === 0 || mapping.modules.some((module) => module.trim() === '')) {\n problems.push(`${label}: modules must list at least one module specifier, none empty`);\n }\n\n if (mapping.newModules?.length === 0) {\n problems.push(`${label}: newModules, when given, lists at least one module specifier`);\n }\n\n const keys = new Set<string>();\n let isOptionalSeen = false;\n for (const parameter of mapping.params) {\n if (!IDENTIFIER.test(parameter.key)) {\n problems.push(`${label}: the parameter key \"${parameter.key}\" is not an identifier`);\n }\n\n if (keys.has(parameter.key)) {\n problems.push(`${label}: the parameter key \"${parameter.key}\" is listed twice`);\n }\n keys.add(parameter.key);\n\n if (isOptionalSeen && !parameter.optional) {\n problems.push(\n `${label}: the required parameter \"${parameter.key}\" follows an optional one`,\n );\n }\n isOptionalSeen = isOptionalSeen || parameter.optional === true;\n }\n\n if (mapping.restKey !== undefined) {\n if (!IDENTIFIER.test(mapping.restKey)) {\n problems.push(`${label}: restKey \"${mapping.restKey}\" is not an identifier`);\n }\n\n if (keys.has(mapping.restKey)) {\n problems.push(`${label}: restKey \"${mapping.restKey}\" is also a parameter key`);\n }\n }\n\n if (mapping.keepsOptions && (mapping.params.length > 0 || mapping.restKey !== undefined)) {\n problems.push(`${label}: keepsOptions leaves params empty and restKey unset`);\n }\n\n for (const module of mapping.modules) {\n const id = `${module}#${mapping.oldName}`;\n if (seen.has(id)) {\n problems.push(`${label}: ${mapping.oldName} from ${module} has two entries`);\n }\n seen.add(id);\n }\n }\n\n return problems;\n }\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { INamespaceMapping } from '../mapping';
|
|
2
|
+
/**
|
|
3
|
+
* The functions of `@venizia/ignis-boot` that moved into a class. Both already took one options
|
|
4
|
+
* object, so each entry only moves the callee (`keepsOptions`).
|
|
5
|
+
*/
|
|
6
|
+
export declare const BOOT_MAPPINGS: ReadonlyArray<INamespaceMapping>;
|
|
7
|
+
//# sourceMappingURL=boot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boot.d.ts","sourceRoot":"","sources":["../../../../../src/cli/codemod/namespace-functions/mappings/boot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAKpD;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,iBAAiB,CAiB1D,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BOOT_MAPPINGS = void 0;
|
|
4
|
+
/** `.` and `./generator` both export the generator (`src/index.ts` re-exports `./generator`); no other package re-exports it. */
|
|
5
|
+
const BOOT_AND_GENERATOR = ['@venizia/ignis-boot', '@venizia/ignis-boot/generator'];
|
|
6
|
+
/**
|
|
7
|
+
* The functions of `@venizia/ignis-boot` that moved into a class. Both already took one options
|
|
8
|
+
* object, so each entry only moves the callee (`keepsOptions`).
|
|
9
|
+
*/
|
|
10
|
+
exports.BOOT_MAPPINGS = [
|
|
11
|
+
{
|
|
12
|
+
modules: BOOT_AND_GENERATOR,
|
|
13
|
+
oldName: 'generateArtifactIndex',
|
|
14
|
+
className: 'ArtifactIndexGenerator',
|
|
15
|
+
method: 'generate',
|
|
16
|
+
params: [],
|
|
17
|
+
keepsOptions: true,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
modules: BOOT_AND_GENERATOR,
|
|
21
|
+
oldName: 'checkArtifactIndex',
|
|
22
|
+
className: 'ArtifactIndexGenerator',
|
|
23
|
+
method: 'check',
|
|
24
|
+
params: [],
|
|
25
|
+
keepsOptions: true,
|
|
26
|
+
},
|
|
27
|
+
];
|
|
28
|
+
//# sourceMappingURL=boot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boot.js","sourceRoot":"","sources":["../../../../../src/cli/codemod/namespace-functions/mappings/boot.ts"],"names":[],"mappings":";;;AAEA,iIAAiI;AACjI,MAAM,kBAAkB,GAAG,CAAC,qBAAqB,EAAE,+BAA+B,CAAC,CAAC;AAEpF;;;GAGG;AACU,QAAA,aAAa,GAAqC;IAC7D;QACE,OAAO,EAAE,kBAAkB;QAC3B,OAAO,EAAE,uBAAuB;QAChC,SAAS,EAAE,wBAAwB;QACnC,MAAM,EAAE,UAAU;QAClB,MAAM,EAAE,EAAE;QACV,YAAY,EAAE,IAAI;KACnB;IACD;QACE,OAAO,EAAE,kBAAkB;QAC3B,OAAO,EAAE,oBAAoB;QAC7B,SAAS,EAAE,wBAAwB;QACnC,MAAM,EAAE,OAAO;QACf,MAAM,EAAE,EAAE;QACV,YAAY,EAAE,IAAI;KACnB;CACF,CAAC","sourcesContent":["import type { INamespaceMapping } from '../mapping';\n\n/** `.` and `./generator` both export the generator (`src/index.ts` re-exports `./generator`); no other package re-exports it. */\nconst BOOT_AND_GENERATOR = ['@venizia/ignis-boot', '@venizia/ignis-boot/generator'];\n\n/**\n * The functions of `@venizia/ignis-boot` that moved into a class. Both already took one options\n * object, so each entry only moves the callee (`keepsOptions`).\n */\nexport const BOOT_MAPPINGS: ReadonlyArray<INamespaceMapping> = [\n {\n modules: BOOT_AND_GENERATOR,\n oldName: 'generateArtifactIndex',\n className: 'ArtifactIndexGenerator',\n method: 'generate',\n params: [],\n keepsOptions: true,\n },\n {\n modules: BOOT_AND_GENERATOR,\n oldName: 'checkArtifactIndex',\n className: 'ArtifactIndexGenerator',\n method: 'check',\n params: [],\n keepsOptions: true,\n },\n];\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connectors.d.ts","sourceRoot":"","sources":["../../../../../src/cli/codemod/namespace-functions/mappings/connectors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AA+DpD,4EAA4E;AAC5E,eAAO,MAAM,mBAAmB,EAAE,aAAa,CAAC,iBAAiB,CAwKhE,CAAC"}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CONNECTORS_MAPPINGS = void 0;
|
|
4
|
+
const CONNECTORS = '@venizia/ignis-connectors';
|
|
5
|
+
const CORE_SERVER = '@venizia/ignis';
|
|
6
|
+
/**
|
|
7
|
+
* `@venizia/ignis` (the root) re-exports `@venizia/ignis-connectors/postgres` only, and every other
|
|
8
|
+
* core-server subpath mirrors the connectors subpath of the same name.
|
|
9
|
+
*/
|
|
10
|
+
const POSTGRES_MODULES = [`${CONNECTORS}/postgres`, CORE_SERVER, `${CORE_SERVER}/postgres`];
|
|
11
|
+
const SQLITE_MODULES = [`${CONNECTORS}/sqlite`, `${CORE_SERVER}/sqlite`];
|
|
12
|
+
const RELATIONAL_MODULES = [CONNECTORS, `${CONNECTORS}/relational`, `${CORE_SERVER}/relational`];
|
|
13
|
+
const RELATIONAL_AND_DIALECT_MODULES = [
|
|
14
|
+
...RELATIONAL_MODULES,
|
|
15
|
+
`${CONNECTORS}/postgres`,
|
|
16
|
+
`${CONNECTORS}/sqlite`,
|
|
17
|
+
CORE_SERVER,
|
|
18
|
+
`${CORE_SERVER}/postgres`,
|
|
19
|
+
`${CORE_SERVER}/sqlite`,
|
|
20
|
+
];
|
|
21
|
+
const SEARCH_MODULES = [
|
|
22
|
+
CONNECTORS,
|
|
23
|
+
`${CONNECTORS}/search`,
|
|
24
|
+
`${CONNECTORS}/typesense`,
|
|
25
|
+
`${CORE_SERVER}/search`,
|
|
26
|
+
`${CORE_SERVER}/typesense`,
|
|
27
|
+
];
|
|
28
|
+
const SEARCH_CONTROLLER_MODULES = [
|
|
29
|
+
`${CONNECTORS}/search/controllers`,
|
|
30
|
+
`${CONNECTORS}/typesense/controllers`,
|
|
31
|
+
`${CORE_SERVER}/search/controllers`,
|
|
32
|
+
`${CORE_SERVER}/typesense/controllers`,
|
|
33
|
+
];
|
|
34
|
+
/** The old function took one options object, so the class method takes it unchanged. */
|
|
35
|
+
const passthrough = (mapping) => ({ ...mapping, params: [], keepsOptions: true });
|
|
36
|
+
/** The enricher functions of one dialect: `generate*ColumnDefs(opts)` and `enrich*(baseSchema, opts)`. */
|
|
37
|
+
const enricher = (opts) => [
|
|
38
|
+
passthrough({
|
|
39
|
+
modules: opts.modules,
|
|
40
|
+
oldName: opts.generateName,
|
|
41
|
+
className: opts.className,
|
|
42
|
+
method: 'generateColumnDefs',
|
|
43
|
+
}),
|
|
44
|
+
{
|
|
45
|
+
modules: opts.modules,
|
|
46
|
+
oldName: opts.enrichName,
|
|
47
|
+
className: opts.className,
|
|
48
|
+
method: 'enrich',
|
|
49
|
+
params: [{ key: opts.baseKey }, { key: 'opts', optional: !opts.isOptionsRequired }],
|
|
50
|
+
},
|
|
51
|
+
];
|
|
52
|
+
/** The functions of `@venizia/ignis-connectors` that moved into a class. */
|
|
53
|
+
exports.CONNECTORS_MAPPINGS = [
|
|
54
|
+
...enricher({
|
|
55
|
+
modules: POSTGRES_MODULES,
|
|
56
|
+
className: 'PostgresDataTypeEnricher',
|
|
57
|
+
generateName: 'generateDataTypeColumnDefs',
|
|
58
|
+
enrichName: 'enrichDataTypes',
|
|
59
|
+
baseKey: 'baseSchema',
|
|
60
|
+
}),
|
|
61
|
+
...enricher({
|
|
62
|
+
modules: POSTGRES_MODULES,
|
|
63
|
+
className: 'PostgresIdEnricher',
|
|
64
|
+
generateName: 'generateIdColumnDefs',
|
|
65
|
+
enrichName: 'enrichId',
|
|
66
|
+
baseKey: 'baseColumns',
|
|
67
|
+
}),
|
|
68
|
+
...enricher({
|
|
69
|
+
modules: POSTGRES_MODULES,
|
|
70
|
+
className: 'PostgresPrincipalEnricher',
|
|
71
|
+
generateName: 'generatePrincipalColumnDefs',
|
|
72
|
+
enrichName: 'enrichPrincipal',
|
|
73
|
+
baseKey: 'baseSchema',
|
|
74
|
+
isOptionsRequired: true,
|
|
75
|
+
}),
|
|
76
|
+
...enricher({
|
|
77
|
+
modules: POSTGRES_MODULES,
|
|
78
|
+
className: 'PostgresTzEnricher',
|
|
79
|
+
generateName: 'generateTzColumnDefs',
|
|
80
|
+
enrichName: 'enrichTz',
|
|
81
|
+
baseKey: 'baseSchema',
|
|
82
|
+
}),
|
|
83
|
+
...enricher({
|
|
84
|
+
modules: POSTGRES_MODULES,
|
|
85
|
+
className: 'PostgresUserAuditEnricher',
|
|
86
|
+
generateName: 'generateUserAuditColumnDefs',
|
|
87
|
+
enrichName: 'enrichUserAudit',
|
|
88
|
+
baseKey: 'baseSchema',
|
|
89
|
+
}),
|
|
90
|
+
...enricher({
|
|
91
|
+
modules: SQLITE_MODULES,
|
|
92
|
+
className: 'SqliteDataTypeEnricher',
|
|
93
|
+
generateName: 'generateDataTypeColumnDefs',
|
|
94
|
+
enrichName: 'enrichDataTypes',
|
|
95
|
+
baseKey: 'baseSchema',
|
|
96
|
+
}),
|
|
97
|
+
...enricher({
|
|
98
|
+
modules: SQLITE_MODULES,
|
|
99
|
+
className: 'SqliteIdEnricher',
|
|
100
|
+
generateName: 'generateIdColumnDefs',
|
|
101
|
+
enrichName: 'enrichId',
|
|
102
|
+
baseKey: 'baseColumns',
|
|
103
|
+
}),
|
|
104
|
+
...enricher({
|
|
105
|
+
modules: SQLITE_MODULES,
|
|
106
|
+
className: 'SqlitePrincipalEnricher',
|
|
107
|
+
generateName: 'generatePrincipalColumnDefs',
|
|
108
|
+
enrichName: 'enrichPrincipal',
|
|
109
|
+
baseKey: 'baseSchema',
|
|
110
|
+
isOptionsRequired: true,
|
|
111
|
+
}),
|
|
112
|
+
...enricher({
|
|
113
|
+
modules: SQLITE_MODULES,
|
|
114
|
+
className: 'SqliteTzEnricher',
|
|
115
|
+
generateName: 'generateTzColumnDefs',
|
|
116
|
+
enrichName: 'enrichTz',
|
|
117
|
+
baseKey: 'baseSchema',
|
|
118
|
+
}),
|
|
119
|
+
...enricher({
|
|
120
|
+
modules: SQLITE_MODULES,
|
|
121
|
+
className: 'SqliteUserAuditEnricher',
|
|
122
|
+
generateName: 'generateUserAuditColumnDefs',
|
|
123
|
+
enrichName: 'enrichUserAudit',
|
|
124
|
+
baseKey: 'baseSchema',
|
|
125
|
+
}),
|
|
126
|
+
passthrough({
|
|
127
|
+
modules: [CONNECTORS],
|
|
128
|
+
oldName: 'assertScopeFilterSupported',
|
|
129
|
+
className: 'ScopeFilterUtility',
|
|
130
|
+
method: 'assertScopeFilterSupported',
|
|
131
|
+
}),
|
|
132
|
+
passthrough({
|
|
133
|
+
modules: RELATIONAL_AND_DIALECT_MODULES,
|
|
134
|
+
oldName: 'getIdType',
|
|
135
|
+
className: 'RelationalEntityUtility',
|
|
136
|
+
method: 'getIdType',
|
|
137
|
+
}),
|
|
138
|
+
passthrough({
|
|
139
|
+
modules: RELATIONAL_MODULES,
|
|
140
|
+
oldName: 'resolveAuditUserId',
|
|
141
|
+
className: 'AuditUserResolver',
|
|
142
|
+
method: 'resolveAuditUserId',
|
|
143
|
+
}),
|
|
144
|
+
passthrough({
|
|
145
|
+
modules: RELATIONAL_AND_DIALECT_MODULES,
|
|
146
|
+
oldName: 'toRelationConfigs',
|
|
147
|
+
className: 'RelationDeclarations',
|
|
148
|
+
method: 'toRelationConfigs',
|
|
149
|
+
}),
|
|
150
|
+
passthrough({
|
|
151
|
+
modules: [...RELATIONAL_MODULES, ...POSTGRES_MODULES],
|
|
152
|
+
oldName: 'getCachedColumns',
|
|
153
|
+
className: 'TableColumnCache',
|
|
154
|
+
method: 'get',
|
|
155
|
+
}),
|
|
156
|
+
...['isJsonPath', 'parseJsonPath', 'validateJsonPathComponents', 'validateJsonColumnType'].map((oldName) => passthrough({
|
|
157
|
+
modules: RELATIONAL_MODULES,
|
|
158
|
+
oldName,
|
|
159
|
+
className: 'JsonPathUtility',
|
|
160
|
+
method: oldName,
|
|
161
|
+
})),
|
|
162
|
+
passthrough({
|
|
163
|
+
modules: [...RELATIONAL_MODULES, ...POSTGRES_MODULES],
|
|
164
|
+
oldName: 'createRelations',
|
|
165
|
+
className: 'RelationsFactory',
|
|
166
|
+
method: 'create',
|
|
167
|
+
}),
|
|
168
|
+
passthrough({
|
|
169
|
+
modules: [`${CONNECTORS}/postgres/supabase`, `${CORE_SERVER}/postgres/supabase`],
|
|
170
|
+
oldName: 'buildPostgresJsOptions',
|
|
171
|
+
className: 'SupabasePooler',
|
|
172
|
+
method: 'buildPostgresJsOptions',
|
|
173
|
+
}),
|
|
174
|
+
passthrough({
|
|
175
|
+
modules: [`${CONNECTORS}/postgres/supabase`, `${CORE_SERVER}/postgres/supabase`],
|
|
176
|
+
oldName: 'withAuthContext',
|
|
177
|
+
className: 'SupabaseRls',
|
|
178
|
+
method: 'withAuthContext',
|
|
179
|
+
}),
|
|
180
|
+
passthrough({
|
|
181
|
+
modules: SEARCH_CONTROLLER_MODULES,
|
|
182
|
+
oldName: 'defineSearchRouteConfigs',
|
|
183
|
+
className: 'SearchControllerFactory',
|
|
184
|
+
method: 'defineRouteConfigs',
|
|
185
|
+
}),
|
|
186
|
+
passthrough({
|
|
187
|
+
modules: SEARCH_MODULES,
|
|
188
|
+
oldName: 'defineSearchCollection',
|
|
189
|
+
className: 'SearchCollectionFactory',
|
|
190
|
+
method: 'define',
|
|
191
|
+
}),
|
|
192
|
+
passthrough({
|
|
193
|
+
modules: SEARCH_MODULES,
|
|
194
|
+
oldName: 'deriveSearchDocumentSchema',
|
|
195
|
+
className: 'SearchCollectionFactory',
|
|
196
|
+
method: 'deriveDocumentSchema',
|
|
197
|
+
}),
|
|
198
|
+
{
|
|
199
|
+
modules: SEARCH_MODULES,
|
|
200
|
+
oldName: 'toSearchQueryParams',
|
|
201
|
+
className: 'SearchQueryParamsUtility',
|
|
202
|
+
method: 'toSearchQueryParams',
|
|
203
|
+
params: [{ key: 'input' }],
|
|
204
|
+
},
|
|
205
|
+
passthrough({
|
|
206
|
+
modules: [`${CONNECTORS}/meilisearch`, `${CORE_SERVER}/meilisearch`],
|
|
207
|
+
oldName: 'compileMeilisearchCollection',
|
|
208
|
+
className: 'MeilisearchCollectionCompiler',
|
|
209
|
+
method: 'compile',
|
|
210
|
+
}),
|
|
211
|
+
passthrough({
|
|
212
|
+
modules: [`${CONNECTORS}/typesense`, `${CORE_SERVER}/typesense`],
|
|
213
|
+
oldName: 'compileTypesenseCollection',
|
|
214
|
+
className: 'TypesenseCollectionCompiler',
|
|
215
|
+
method: 'compile',
|
|
216
|
+
}),
|
|
217
|
+
];
|
|
218
|
+
//# sourceMappingURL=connectors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connectors.js","sourceRoot":"","sources":["../../../../../src/cli/codemod/namespace-functions/mappings/connectors.ts"],"names":[],"mappings":";;;AAEA,MAAM,UAAU,GAAG,2BAA2B,CAAC;AAC/C,MAAM,WAAW,GAAG,gBAAgB,CAAC;AAErC;;;GAGG;AACH,MAAM,gBAAgB,GAAG,CAAC,GAAG,UAAU,WAAW,EAAE,WAAW,EAAE,GAAG,WAAW,WAAW,CAAC,CAAC;AAC5F,MAAM,cAAc,GAAG,CAAC,GAAG,UAAU,SAAS,EAAE,GAAG,WAAW,SAAS,CAAC,CAAC;AACzE,MAAM,kBAAkB,GAAG,CAAC,UAAU,EAAE,GAAG,UAAU,aAAa,EAAE,GAAG,WAAW,aAAa,CAAC,CAAC;AACjG,MAAM,8BAA8B,GAAG;IACrC,GAAG,kBAAkB;IACrB,GAAG,UAAU,WAAW;IACxB,GAAG,UAAU,SAAS;IACtB,WAAW;IACX,GAAG,WAAW,WAAW;IACzB,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QACpE,OAAO,EAAE,8BAA8B;QACvC,SAAS,EAAE,+BAA+B;QAC1C,MAAM,EAAE,SAAS;KAClB,CAAC;IACF,WAAW,CAAC;QACV,OAAO,EAAE,CAAC,GAAG,UAAU,YAAY,EAAE,GAAG,WAAW,YAAY,CAAC;QAChE,OAAO,EAAE,4BAA4B;QACrC,SAAS,EAAE,6BAA6B;QACxC,MAAM,EAAE,SAAS;KAClB,CAAC;CACH,CAAC","sourcesContent":["import type { INamespaceMapping } from '../mapping';\n\nconst CONNECTORS = '@venizia/ignis-connectors';\nconst CORE_SERVER = '@venizia/ignis';\n\n/**\n * `@venizia/ignis` (the root) re-exports `@venizia/ignis-connectors/postgres` only, and every other\n * core-server subpath mirrors the connectors subpath of the same name.\n */\nconst POSTGRES_MODULES = [`${CONNECTORS}/postgres`, CORE_SERVER, `${CORE_SERVER}/postgres`];\nconst SQLITE_MODULES = [`${CONNECTORS}/sqlite`, `${CORE_SERVER}/sqlite`];\nconst RELATIONAL_MODULES = [CONNECTORS, `${CONNECTORS}/relational`, `${CORE_SERVER}/relational`];\nconst RELATIONAL_AND_DIALECT_MODULES = [\n ...RELATIONAL_MODULES,\n `${CONNECTORS}/postgres`,\n `${CONNECTORS}/sqlite`,\n CORE_SERVER,\n `${CORE_SERVER}/postgres`,\n `${CORE_SERVER}/sqlite`,\n];\nconst SEARCH_MODULES = [\n CONNECTORS,\n `${CONNECTORS}/search`,\n `${CONNECTORS}/typesense`,\n `${CORE_SERVER}/search`,\n `${CORE_SERVER}/typesense`,\n];\nconst SEARCH_CONTROLLER_MODULES = [\n `${CONNECTORS}/search/controllers`,\n `${CONNECTORS}/typesense/controllers`,\n `${CORE_SERVER}/search/controllers`,\n `${CORE_SERVER}/typesense/controllers`,\n];\n\n/** The old function took one options object, so the class method takes it unchanged. */\nconst passthrough = (\n mapping: Omit<INamespaceMapping, 'params' | 'keepsOptions'>,\n): INamespaceMapping => ({ ...mapping, params: [], keepsOptions: true });\n\n/** The enricher functions of one dialect: `generate*ColumnDefs(opts)` and `enrich*(baseSchema, opts)`. */\nconst enricher = (opts: {\n modules: string[];\n className: string;\n generateName: string;\n enrichName: string;\n baseKey: 'baseColumns' | 'baseSchema';\n isOptionsRequired?: boolean;\n}): INamespaceMapping[] => [\n passthrough({\n modules: opts.modules,\n oldName: opts.generateName,\n className: opts.className,\n method: 'generateColumnDefs',\n }),\n {\n modules: opts.modules,\n oldName: opts.enrichName,\n className: opts.className,\n method: 'enrich',\n params: [{ key: opts.baseKey }, { key: 'opts', optional: !opts.isOptionsRequired }],\n },\n];\n\n/** The functions of `@venizia/ignis-connectors` that moved into a class. */\nexport const CONNECTORS_MAPPINGS: ReadonlyArray<INamespaceMapping> = [\n ...enricher({\n modules: POSTGRES_MODULES,\n className: 'PostgresDataTypeEnricher',\n generateName: 'generateDataTypeColumnDefs',\n enrichName: 'enrichDataTypes',\n baseKey: 'baseSchema',\n }),\n ...enricher({\n modules: POSTGRES_MODULES,\n className: 'PostgresIdEnricher',\n generateName: 'generateIdColumnDefs',\n enrichName: 'enrichId',\n baseKey: 'baseColumns',\n }),\n ...enricher({\n modules: POSTGRES_MODULES,\n className: 'PostgresPrincipalEnricher',\n generateName: 'generatePrincipalColumnDefs',\n enrichName: 'enrichPrincipal',\n baseKey: 'baseSchema',\n isOptionsRequired: true,\n }),\n ...enricher({\n modules: POSTGRES_MODULES,\n className: 'PostgresTzEnricher',\n generateName: 'generateTzColumnDefs',\n enrichName: 'enrichTz',\n baseKey: 'baseSchema',\n }),\n ...enricher({\n modules: POSTGRES_MODULES,\n className: 'PostgresUserAuditEnricher',\n generateName: 'generateUserAuditColumnDefs',\n enrichName: 'enrichUserAudit',\n baseKey: 'baseSchema',\n }),\n ...enricher({\n modules: SQLITE_MODULES,\n className: 'SqliteDataTypeEnricher',\n generateName: 'generateDataTypeColumnDefs',\n enrichName: 'enrichDataTypes',\n baseKey: 'baseSchema',\n }),\n ...enricher({\n modules: SQLITE_MODULES,\n className: 'SqliteIdEnricher',\n generateName: 'generateIdColumnDefs',\n enrichName: 'enrichId',\n baseKey: 'baseColumns',\n }),\n ...enricher({\n modules: SQLITE_MODULES,\n className: 'SqlitePrincipalEnricher',\n generateName: 'generatePrincipalColumnDefs',\n enrichName: 'enrichPrincipal',\n baseKey: 'baseSchema',\n isOptionsRequired: true,\n }),\n ...enricher({\n modules: SQLITE_MODULES,\n className: 'SqliteTzEnricher',\n generateName: 'generateTzColumnDefs',\n enrichName: 'enrichTz',\n baseKey: 'baseSchema',\n }),\n ...enricher({\n modules: SQLITE_MODULES,\n className: 'SqliteUserAuditEnricher',\n generateName: 'generateUserAuditColumnDefs',\n enrichName: 'enrichUserAudit',\n baseKey: 'baseSchema',\n }),\n\n passthrough({\n modules: [CONNECTORS],\n oldName: 'assertScopeFilterSupported',\n className: 'ScopeFilterUtility',\n method: 'assertScopeFilterSupported',\n }),\n passthrough({\n modules: RELATIONAL_AND_DIALECT_MODULES,\n oldName: 'getIdType',\n className: 'RelationalEntityUtility',\n method: 'getIdType',\n }),\n passthrough({\n modules: RELATIONAL_MODULES,\n oldName: 'resolveAuditUserId',\n className: 'AuditUserResolver',\n method: 'resolveAuditUserId',\n }),\n passthrough({\n modules: RELATIONAL_AND_DIALECT_MODULES,\n oldName: 'toRelationConfigs',\n className: 'RelationDeclarations',\n method: 'toRelationConfigs',\n }),\n passthrough({\n modules: [...RELATIONAL_MODULES, ...POSTGRES_MODULES],\n oldName: 'getCachedColumns',\n className: 'TableColumnCache',\n method: 'get',\n }),\n ...['isJsonPath', 'parseJsonPath', 'validateJsonPathComponents', 'validateJsonColumnType'].map(\n (oldName) =>\n passthrough({\n modules: RELATIONAL_MODULES,\n oldName,\n className: 'JsonPathUtility',\n method: oldName,\n }),\n ),\n passthrough({\n modules: [...RELATIONAL_MODULES, ...POSTGRES_MODULES],\n oldName: 'createRelations',\n className: 'RelationsFactory',\n method: 'create',\n }),\n passthrough({\n modules: [`${CONNECTORS}/postgres/supabase`, `${CORE_SERVER}/postgres/supabase`],\n oldName: 'buildPostgresJsOptions',\n className: 'SupabasePooler',\n method: 'buildPostgresJsOptions',\n }),\n passthrough({\n modules: [`${CONNECTORS}/postgres/supabase`, `${CORE_SERVER}/postgres/supabase`],\n oldName: 'withAuthContext',\n className: 'SupabaseRls',\n method: 'withAuthContext',\n }),\n passthrough({\n modules: SEARCH_CONTROLLER_MODULES,\n oldName: 'defineSearchRouteConfigs',\n className: 'SearchControllerFactory',\n method: 'defineRouteConfigs',\n }),\n passthrough({\n modules: SEARCH_MODULES,\n oldName: 'defineSearchCollection',\n className: 'SearchCollectionFactory',\n method: 'define',\n }),\n passthrough({\n modules: SEARCH_MODULES,\n oldName: 'deriveSearchDocumentSchema',\n className: 'SearchCollectionFactory',\n method: 'deriveDocumentSchema',\n }),\n {\n modules: SEARCH_MODULES,\n oldName: 'toSearchQueryParams',\n className: 'SearchQueryParamsUtility',\n method: 'toSearchQueryParams',\n params: [{ key: 'input' }],\n },\n passthrough({\n modules: [`${CONNECTORS}/meilisearch`, `${CORE_SERVER}/meilisearch`],\n oldName: 'compileMeilisearchCollection',\n className: 'MeilisearchCollectionCompiler',\n method: 'compile',\n }),\n passthrough({\n modules: [`${CONNECTORS}/typesense`, `${CORE_SERVER}/typesense`],\n oldName: 'compileTypesenseCollection',\n className: 'TypesenseCollectionCompiler',\n method: 'compile',\n }),\n];\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { INamespaceMapping } from '../mapping';
|
|
2
|
+
/**
|
|
3
|
+
* The functions of `@venizia/ignis` that moved into a class. An entry with `keepsOptions` is a
|
|
4
|
+
* function that already took ONE options object: its class method takes the same one.
|
|
5
|
+
*/
|
|
6
|
+
export declare const CORE_SERVER_MAPPINGS: ReadonlyArray<INamespaceMapping>;
|
|
7
|
+
//# sourceMappingURL=core-server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core-server.d.ts","sourceRoot":"","sources":["../../../../../src/cli/codemod/namespace-functions/mappings/core-server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,aAAa,CAAC,iBAAiB,CAyJjE,CAAC"}
|