ts-rules-composer 1.0.0 → 1.0.2
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/README.md +87 -14
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +148 -176
- package/dist/index.d.ts +148 -176
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +40 -43
- package/.editorconfig +0 -15
- package/.github/CONTRIBUTING.md +0 -3
- package/.github/ISSUE_TEMPLATE.md +0 -9
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -7
- package/.github/workflows/docs.yml +0 -29
- package/.github/workflows/publish.yml +0 -25
- package/.github/workflows/test.yml +0 -37
- package/.prettierignore +0 -2
- package/.releaserc +0 -11
- package/eslint.config.mjs +0 -84
- package/examples/financial-transaction.example.ts +0 -188
- package/examples/model-deployment.example.ts +0 -136
- package/examples/user-registration.example.ts +0 -101
- package/src/lib/combinators/index.ts +0 -2
- package/src/lib/combinators/logic/every.spec.ts +0 -264
- package/src/lib/combinators/logic/every.ts +0 -57
- package/src/lib/combinators/logic/if-else.spec.ts +0 -82
- package/src/lib/combinators/logic/if-else.ts +0 -64
- package/src/lib/combinators/logic/index.ts +0 -8
- package/src/lib/combinators/logic/match.spec.ts +0 -186
- package/src/lib/combinators/logic/match.ts +0 -106
- package/src/lib/combinators/logic/not.spec.ts +0 -64
- package/src/lib/combinators/logic/not.ts +0 -34
- package/src/lib/combinators/logic/one-of.spec.ts +0 -68
- package/src/lib/combinators/logic/one-of.ts +0 -48
- package/src/lib/combinators/logic/unless.spec.ts +0 -61
- package/src/lib/combinators/logic/unless.ts +0 -50
- package/src/lib/combinators/logic/when.spec.ts +0 -119
- package/src/lib/combinators/logic/when.ts +0 -50
- package/src/lib/combinators/logic/with-fallback.spec.ts +0 -72
- package/src/lib/combinators/logic/with-fallback.ts +0 -46
- package/src/lib/combinators/utility/index.ts +0 -11
- package/src/lib/combinators/utility/inject.spec.ts +0 -55
- package/src/lib/combinators/utility/inject.ts +0 -25
- package/src/lib/combinators/utility/map-error.spec.ts +0 -63
- package/src/lib/combinators/utility/map-error.ts +0 -35
- package/src/lib/combinators/utility/tap.spec.ts +0 -102
- package/src/lib/combinators/utility/tap.ts +0 -28
- package/src/lib/combinators/utility/validate-field.spec.ts +0 -150
- package/src/lib/combinators/utility/validate-field.ts +0 -66
- package/src/lib/combinators/utility/with-debug.spec.ts +0 -71
- package/src/lib/combinators/utility/with-debug.ts +0 -55
- package/src/lib/combinators/utility/with-memoize.spec.ts +0 -82
- package/src/lib/combinators/utility/with-memoize.ts +0 -89
- package/src/lib/combinators/utility/with-retry.spec.ts +0 -220
- package/src/lib/combinators/utility/with-retry.ts +0 -70
- package/src/lib/combinators/utility/with-safe-error.spec.ts +0 -137
- package/src/lib/combinators/utility/with-safe-error.ts +0 -56
- package/src/lib/combinators/utility/with-safe-predicate.spec.ts +0 -176
- package/src/lib/combinators/utility/with-safe-predicate.ts +0 -64
- package/src/lib/combinators/utility/with-tap.spec.ts +0 -104
- package/src/lib/combinators/utility/with-tap.ts +0 -46
- package/src/lib/combinators/utility/with-timeout.spec.ts +0 -115
- package/src/lib/combinators/utility/with-timeout.ts +0 -41
- package/src/lib/composition/compose-rules.spec.ts +0 -211
- package/src/lib/composition/compose-rules.ts +0 -55
- package/src/lib/composition/index.ts +0 -3
- package/src/lib/composition/pipe-rules.spec.ts +0 -220
- package/src/lib/composition/pipe-rules.ts +0 -52
- package/src/lib/composition/pipe.spec.ts +0 -47
- package/src/lib/composition/pipe.ts +0 -107
- package/src/lib/helpers/clone/clone.ts +0 -12
- package/src/lib/helpers/clone/getCloneFn.ts +0 -17
- package/src/lib/helpers/clone/shallowClone.ts +0 -12
- package/src/lib/helpers/context/has-context.ts +0 -13
- package/src/lib/helpers/context/index.ts +0 -3
- package/src/lib/helpers/context/require-context.spec.ts +0 -55
- package/src/lib/helpers/context/require-context.ts +0 -61
- package/src/lib/helpers/context/with-lazy-context.spec.ts +0 -74
- package/src/lib/helpers/context/with-lazy-context.ts +0 -35
- package/src/lib/helpers/index.ts +0 -8
- package/src/lib/helpers/result/fail.ts +0 -15
- package/src/lib/helpers/result/index.ts +0 -2
- package/src/lib/helpers/result/pass.ts +0 -14
- package/src/lib/helpers/retry/calculate-delay.ts +0 -31
- package/src/lib/helpers/safety/get-normalized-rule.spec.ts +0 -209
- package/src/lib/helpers/safety/get-normalized-rule.ts +0 -14
- package/src/lib/helpers/safety/get-normalized-rules.spec.ts +0 -138
- package/src/lib/helpers/safety/get-normalized-rules.ts +0 -14
- package/src/lib/index.ts +0 -4
- package/src/lib/types/composition-options.ts +0 -32
- package/src/lib/types/debug-options.ts +0 -36
- package/src/lib/types/index.ts +0 -8
- package/src/lib/types/predicate-result.ts +0 -20
- package/src/lib/types/predicate-safe.ts +0 -10
- package/src/lib/types/predicate-safety-options.ts +0 -27
- package/src/lib/types/predicate.ts +0 -8
- package/src/lib/types/prettify.ts +0 -3
- package/src/lib/types/rule-result.ts +0 -16
- package/src/lib/types/rule-safety-options.ts +0 -34
- package/src/lib/types/rule.ts +0 -21
- package/src/lib/types/safety-options.ts +0 -7
- package/src/test/financial-transaction.spec.ts +0 -251
- package/src/test/helpers/get-rule-error.ts +0 -23
- package/src/test/integration.spec.ts +0 -285
- package/src/test/model-deployment.spec.ts +0 -209
- package/src/test/user-registration.spec.ts +0 -164
- package/tsconfig.json +0 -56
- package/tsup.config.ts +0 -36
- package/typedoc/tsconfig.typedoc.json +0 -15
- package/typedoc/typedoc.json +0 -14
- package/vitest.config.ts +0 -16
package/tsup.config.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
// tsup.config.ts
|
|
2
|
-
import { defineConfig } from "tsup";
|
|
3
|
-
|
|
4
|
-
export default defineConfig({
|
|
5
|
-
// Entry file(s)
|
|
6
|
-
entry: ["src/lib/index.ts"],
|
|
7
|
-
|
|
8
|
-
// Output formats
|
|
9
|
-
format: ["cjs", "esm"],
|
|
10
|
-
|
|
11
|
-
// Generate declaration files
|
|
12
|
-
dts: true,
|
|
13
|
-
|
|
14
|
-
// Clean dist folder before build
|
|
15
|
-
clean: true,
|
|
16
|
-
|
|
17
|
-
// Target ES2018 for good balance
|
|
18
|
-
target: "es2018",
|
|
19
|
-
|
|
20
|
-
// Bundle dependencies (adjust based on your needs)
|
|
21
|
-
noExternal: [], // Bundle all dependencies
|
|
22
|
-
// or
|
|
23
|
-
// external: ['some-package'], // Mark specific packages as external
|
|
24
|
-
|
|
25
|
-
// Enable sourcemaps
|
|
26
|
-
sourcemap: true,
|
|
27
|
-
|
|
28
|
-
// Optional: Splitting for ESM
|
|
29
|
-
splitting: true,
|
|
30
|
-
|
|
31
|
-
// Optional: Minification
|
|
32
|
-
minify: true,
|
|
33
|
-
|
|
34
|
-
// Optional: Tree-shaking
|
|
35
|
-
treeshake: true,
|
|
36
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"moduleResolution": "bundler"
|
|
5
|
-
},
|
|
6
|
-
"module": "ES6",
|
|
7
|
-
"exclude": [
|
|
8
|
-
"dist/**",
|
|
9
|
-
"build/**",
|
|
10
|
-
"node_modules/**",
|
|
11
|
-
"vitest.config.ts",
|
|
12
|
-
// workaround for https://github.com/rollup/rollup/issues/5199
|
|
13
|
-
"**/**spec.ts",
|
|
14
|
-
],
|
|
15
|
-
}
|
package/typedoc/typedoc.json
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"githubPages": true,
|
|
3
|
-
"includeVersion": true,
|
|
4
|
-
"out": "../genDocs",
|
|
5
|
-
"entryPoints": [
|
|
6
|
-
"../src/lib/index.ts"
|
|
7
|
-
],
|
|
8
|
-
"tsconfig": "./tsconfig.typedoc.json",
|
|
9
|
-
"exclude": ["/**/**.spec.ts", "vitest.config.ts"],
|
|
10
|
-
"plugin": [
|
|
11
|
-
"typedoc-plugin-mermaid",
|
|
12
|
-
"typedoc-github-theme",
|
|
13
|
-
]
|
|
14
|
-
}
|
package/vitest.config.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/// <reference types="vitest" />
|
|
2
|
-
|
|
3
|
-
// Configure Vitest (https://vitest.dev/config/)
|
|
4
|
-
|
|
5
|
-
import { defineConfig } from 'vite';
|
|
6
|
-
|
|
7
|
-
export default defineConfig({
|
|
8
|
-
test: {
|
|
9
|
-
coverage: {
|
|
10
|
-
reporter: ['html', 'json'],
|
|
11
|
-
},
|
|
12
|
-
include: ['src/**/*.{test,spec}.ts'],
|
|
13
|
-
/* for example, use global to avoid globals imports (describe, test, expect): */
|
|
14
|
-
// globals: true,
|
|
15
|
-
},
|
|
16
|
-
});
|