@tstdl/base 0.92.41 → 0.92.43

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/file/mime-type.js CHANGED
@@ -10,9 +10,12 @@ export function getMimeTypeExtensions(mimeType) {
10
10
  return mimeTypesMap.get(mimeType) ?? [];
11
11
  }
12
12
  async function spawnFileCommand(args, file) {
13
- const process = await spawnCommand('file', args, { stdinPipeOptions: { preventCancel: true } });
13
+ const process = await spawnCommand('file', args);
14
14
  if (isDefined(file)) {
15
- await process.write(file);
15
+ try {
16
+ await process.write(file);
17
+ }
18
+ catch { /* ignore as file command closes stdin early */ }
16
19
  }
17
20
  const { code } = await process.wait();
18
21
  if (code != 0) {
package/orm/types.d.ts CHANGED
@@ -3,7 +3,7 @@ import type { boolean, date, doublePrecision, integer, jsonb, PgColumnBuilder, P
3
3
  import type { GetTagMetadata, Tagged, UnwrapTagged } from 'type-fest';
4
4
  import { Array, Integer } from '../schema/index.js';
5
5
  import type { AbstractConstructor, EnumerationObject, EnumerationValue, ObjectLiteral, UnionToTuple } from '../types.js';
6
- import { Embedded, Unique } from './decorators.js';
6
+ import { Column, Embedded, Index, PrimaryKey, References, Unique } from './decorators.js';
7
7
  import { Json, NumericDate, Timestamp, Uuid } from './schemas/index.js';
8
8
  export type IsPrimaryKey<T> = T extends Tagged<unknown, 'column', PgColumnBuilderBase> ? Tagged<UnwrapTagged<T>, 'column', DrizzleIsPrimaryKey<GetTagMetadata<T, 'column'>>> : Tagged<T, 'column', ColumnBuilder<T>>;
9
9
  export type HasDefault<T> = T extends Tagged<unknown, 'column', PgColumnBuilderBase> ? Tagged<UnwrapTagged<T>, 'column', DrizzleHasDefault<GetTagMetadata<T, 'column'>>> : Tagged<T, 'column', ColumnBuilder<T>>;
@@ -28,4 +28,4 @@ export type DoublePrecision = Tagged<number, 'column', ReturnType<typeof doubleP
28
28
  export type Boolean = Tagged<number, 'column', ReturnType<typeof boolean>>;
29
29
  export type NumericDate = Tagged<number, 'column', ReturnType<typeof date>>;
30
30
  export type Timestamp = Tagged<number, 'column', ReturnType<typeof timestamp>>;
31
- export { Array, Embedded, Integer, Json, NumericDate, Timestamp, Unique, Uuid };
31
+ export { Array, Column, Embedded, Index, Integer, Json, NumericDate, PrimaryKey, References, Timestamp, Unique, Uuid };
package/orm/types.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable @typescript-eslint/no-redeclare, @typescript-eslint/naming-convention */
2
2
  import { Array, Integer } from '../schema/index.js';
3
- import { Embedded, Unique } from './decorators.js';
3
+ import { Column, Embedded, Index, PrimaryKey, References, Unique } from './decorators.js';
4
4
  import { Json, NumericDate, Timestamp, Uuid } from './schemas/index.js';
5
- export { Array, Embedded, Integer, Json, NumericDate, Timestamp, Unique, Uuid };
5
+ export { Array, Column, Embedded, Index, Integer, Json, NumericDate, PrimaryKey, References, Timestamp, Unique, Uuid };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tstdl/base",
3
- "version": "0.92.41",
3
+ "version": "0.92.43",
4
4
  "author": "Patrick Hein",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -124,11 +124,11 @@
124
124
  "luxon": "^3.5",
125
125
  "reflect-metadata": "^0.2",
126
126
  "rxjs": "^7.8",
127
- "type-fest": "4.33"
127
+ "type-fest": "4.35"
128
128
  },
129
129
  "devDependencies": {
130
130
  "@mxssfd/typedoc-theme": "1.1",
131
- "@stylistic/eslint-plugin": "3.0",
131
+ "@stylistic/eslint-plugin": "3.1",
132
132
  "@types/chroma-js": "2.4",
133
133
  "@types/koa__router": "12.0",
134
134
  "@types/luxon": "3.4",
@@ -137,14 +137,13 @@
137
137
  "@types/node": "22",
138
138
  "@types/nodemailer": "6.4",
139
139
  "@types/pg": "8.11",
140
- "@typescript-eslint/eslint-plugin": "8.22",
140
+ "@typescript-eslint/eslint-plugin": "8.24",
141
141
  "concurrently": "9.1",
142
142
  "drizzle-kit": "0.30",
143
143
  "eslint": "8.57",
144
- "eslint-import-resolver-typescript": "3.7",
144
+ "eslint-import-resolver-typescript": "3.8",
145
145
  "eslint-plugin-import": "2.31",
146
146
  "tsc-alias": "1.8",
147
- "tsx": "^4.19.2",
148
147
  "typedoc": "0.27",
149
148
  "typedoc-plugin-missing-exports": "3.1",
150
149
  "typescript": "5.7"
@@ -152,7 +151,6 @@
152
151
  "peerDependencies": {
153
152
  "@elastic/elasticsearch": "^8.17",
154
153
  "@google/generative-ai": "^0.21",
155
- "@koa/router": "^13.1",
156
154
  "@tstdl/angular": "^0.92",
157
155
  "@zxcvbn-ts/core": "^3.0",
158
156
  "@zxcvbn-ts/language-common": "^3.0",
@@ -161,14 +159,13 @@
161
159
  "chroma-js": "^2.6",
162
160
  "drizzle-orm": "^0.39",
163
161
  "handlebars": "^4.7",
164
- "koa": "^2.15",
165
162
  "minio": "^8.0",
166
163
  "mjml": "^4.15",
167
164
  "mongodb": "^6.13",
168
165
  "nodemailer": "^6.10",
169
166
  "pg": "^8.13",
170
167
  "playwright": "^1.50",
171
- "preact": "^10.25",
168
+ "preact": "^10.26",
172
169
  "preact-render-to-string": "^6.5",
173
170
  "undici": "^7.3",
174
171
  "urlpattern-polyfill": "^10.0"
@@ -2,7 +2,7 @@ import type { ChildProcessWithoutNullStreams } from 'node:child_process';
2
2
  export type SpawnCommandResult = TransformStream<Uint8Array, Uint8Array> & {
3
3
  process: ChildProcessWithoutNullStreams;
4
4
  stderr: ReadableStream<Uint8Array>;
5
- write(chunk: ReadableStream<Uint8Array> | Uint8Array | string): Promise<void>;
5
+ write(chunk: ReadableStream<Uint8Array> | Uint8Array | string, options?: StreamPipeOptions): Promise<void>;
6
6
  readOutputBytes(): Promise<Uint8Array>;
7
7
  readOutput(): Promise<string>;
8
8
  readErrorBytes(): Promise<Uint8Array>;
@@ -12,6 +12,4 @@ export type SpawnCommandResult = TransformStream<Uint8Array, Uint8Array> & {
12
12
  signal: string | null;
13
13
  }>;
14
14
  };
15
- export declare function spawnCommand(command: string, args?: string[], options?: {
16
- stdinPipeOptions?: StreamPipeOptions;
17
- }): Promise<SpawnCommandResult>;
15
+ export declare function spawnCommand(command: string, args?: string[]): Promise<SpawnCommandResult>;
package/process/spawn.js CHANGED
@@ -3,7 +3,7 @@ import { decodeTextStream, encodeUtf8Stream } from '../utils/encoding.js';
3
3
  import { readBinaryStream, readTextStream } from '../utils/stream/stream-reader.js';
4
4
  import { toReadableStream } from '../utils/stream/to-readable-stream.js';
5
5
  import { isReadableStream, isString, isUint8Array } from '../utils/type-guards.js';
6
- export async function spawnCommand(command, args, options) {
6
+ export async function spawnCommand(command, args) {
7
7
  const { spawn } = await dynamicImport('node:child_process');
8
8
  const { Readable, Writable } = await dynamicImport('node:stream');
9
9
  const process = spawn(command, args, { stdio: 'pipe' });
@@ -14,15 +14,15 @@ export async function spawnCommand(command, args, options) {
14
14
  const readable = Readable.toWeb(process.stdout);
15
15
  const writable = Writable.toWeb(process.stdin);
16
16
  const stderr = Readable.toWeb(process.stderr);
17
- async function write(data) {
17
+ async function write(data, options) {
18
18
  if (isReadableStream(data)) {
19
- await data.pipeTo(writable, options?.stdinPipeOptions);
19
+ await data.pipeTo(writable, options);
20
20
  }
21
21
  else if (isUint8Array(data)) {
22
- await toReadableStream(data).pipeTo(writable, options?.stdinPipeOptions);
22
+ await toReadableStream(data).pipeTo(writable, options);
23
23
  }
24
24
  else if (isString(data)) {
25
- await toReadableStream(data).pipeThrough(encodeUtf8Stream()).pipeTo(writable, options?.stdinPipeOptions);
25
+ await toReadableStream(data).pipeThrough(encodeUtf8Stream()).pipeTo(writable, options);
26
26
  }
27
27
  }
28
28
  async function readOutputBytes() {
@@ -31,10 +31,10 @@ export async function spawnCommand(command, args, options) {
31
31
  async function readOutput() {
32
32
  return readTextStream(readable.pipeThrough(decodeTextStream()));
33
33
  }
34
- async function readErrBytes() {
34
+ async function readErrorBytes() {
35
35
  return readBinaryStream(stderr);
36
36
  }
37
- async function readErr() {
37
+ async function readError() {
38
38
  return readTextStream(stderr.pipeThrough(decodeTextStream()));
39
39
  }
40
40
  const signalPromise = new Promise((resolve) => process.on('close', (code, signal) => resolve({ code, signal })));
@@ -46,8 +46,8 @@ export async function spawnCommand(command, args, options) {
46
46
  write,
47
47
  readOutputBytes,
48
48
  readOutput,
49
- readErrorBytes: readErrBytes,
50
- readError: readErr,
49
+ readErrorBytes,
50
+ readError,
51
51
  async wait() {
52
52
  return signalPromise;
53
53
  }