@atomic-ehr/fhir-canonical-manager 0.0.6 → 0.0.8

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/dist/compat.d.ts DELETED
@@ -1,17 +0,0 @@
1
- export declare class ShellError extends Error {
2
- exitCode: number;
3
- stdout: string;
4
- stderr: string;
5
- constructor(message: string, exitCode: number, stdout: string, stderr: string);
6
- }
7
- interface ShellResult {
8
- stdout: string;
9
- stderr: string;
10
- exitCode: number;
11
- }
12
- interface ShellPromise extends Promise<ShellResult> {
13
- quiet(): Promise<ShellResult>;
14
- }
15
- export declare function $(strings: TemplateStringsArray, ...values: any[]): ShellPromise;
16
- export {};
17
- //# sourceMappingURL=compat.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"compat.d.ts","sourceRoot":"","sources":["../src/compat.ts"],"names":[],"mappings":"AAmBA,qBAAa,UAAW,SAAQ,KAAK;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;gBAEH,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAO9E;AAED,UAAU,WAAW;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,YAAa,SAAQ,OAAO,CAAC,WAAW,CAAC;IACjD,KAAK,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;CAC/B;AAMD,wBAAgB,CAAC,CAAC,OAAO,EAAE,oBAAoB,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,GAAG,YAAY,CAkD/E"}
package/dist/compat.js DELETED
@@ -1,56 +0,0 @@
1
- import { exec } from 'child_process';
2
- import { promisify } from 'util';
3
- const execAsync = promisify(exec);
4
- export class ShellError extends Error {
5
- exitCode;
6
- stdout;
7
- stderr;
8
- constructor(message, exitCode, stdout, stderr) {
9
- super(message);
10
- this.name = 'ShellError';
11
- this.exitCode = exitCode;
12
- this.stdout = stdout;
13
- this.stderr = stderr;
14
- }
15
- }
16
- export function $(strings, ...values) {
17
- const command = strings.reduce((acc, str, i) => {
18
- return acc + str + (values[i] || '');
19
- }, '');
20
- const execute = async (options = {}) => {
21
- if (typeof Bun !== 'undefined' && Bun.$) {
22
- const bunShell = Bun.$;
23
- if (options.quiet) {
24
- const result = await bunShell(strings, ...values).quiet();
25
- return {
26
- stdout: result.stdout ? result.stdout.toString() : '',
27
- stderr: result.stderr ? result.stderr.toString() : '',
28
- exitCode: result.exitCode || 0
29
- };
30
- }
31
- else {
32
- const result = await bunShell(strings, ...values);
33
- return {
34
- stdout: result.stdout ? result.stdout.toString() : '',
35
- stderr: result.stderr ? result.stderr.toString() : '',
36
- exitCode: result.exitCode || 0
37
- };
38
- }
39
- }
40
- try {
41
- const { stdout, stderr } = await execAsync(command);
42
- return {
43
- stdout: stdout || '',
44
- stderr: stderr || '',
45
- exitCode: 0
46
- };
47
- }
48
- catch (error) {
49
- throw new ShellError(`Failed with exit code ${error.code}`, error.code || 1, error.stdout || '', error.stderr || '');
50
- }
51
- };
52
- const promise = execute();
53
- promise.quiet = () => execute({ quiet: true });
54
- return promise;
55
- }
56
- //# sourceMappingURL=compat.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"compat.js","sourceRoot":"","sources":["../src/compat.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAEjC,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AAGlC,MAAM,OAAO,UAAW,SAAQ,KAAK;IACnC,QAAQ,CAAS;IACjB,MAAM,CAAS;IACf,MAAM,CAAS;IAEf,YAAY,OAAe,EAAE,QAAgB,EAAE,MAAc,EAAE,MAAc;QAC3E,K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C,CAAC;gBAClD,OAAO;oBACL,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE;oBACrD,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE;oBACrD,QAAQ,EAAE,MAAM,CAAC,QAAQ,IAAI,CAAC;iBAC/B,CAAC;YACJ,CAAC;QACH,CAAC;QAGD,IAAI,CAAC;YACH,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,CAAC;YACpD,OAAO;gBACL,MAAM,EAAE,MAAM,IAAI,EAAE;gBACpB,MAAM,EAAE,MAAM,IAAI,EAAE;gBACpB,QAAQ,EAAE,CAAC;aACZ,CAAC;QACJ,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,MAAM,IAAI,UAAU,CAClB,yBAAyB,KAAK,CAAC,IAAI,EAAE,EACrC,KAAK,CAAC,IAAI,IAAI,CAAC,EACf,KAAK,CAAC,MAAM,IAAI,EAAE,EAClB,KAAK,CAAC,MAAM,IAAI,EAAE,CACnB,CAAC;QACJ,CAAC;IACH,CAAC,CAAC;IAGF,MAAM,OAAO,GAAG,OAAO,EAAS,CAAC;IACjC,OAAO,CAAC,KAAK,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAC/C,OAAO,OAAuB,CAAC;AACjC,CAAC"}
package/src/compat.ts DELETED
@@ -1,98 +0,0 @@
1
- /**
2
- * Compatibility layer for shell commands
3
- * This allows the library to work with both Bun.$ and Node.js child_process
4
- *
5
- * Usage:
6
- * import { $ } from './compat.js';
7
- * await $`npm install package-name`;
8
- * await $`npm install package-name`.quiet();
9
- *
10
- * In Bun environment: Uses native Bun.$ for better performance
11
- * In Node.js environment: Falls back to child_process.exec
12
- */
13
-
14
- import { exec } from 'child_process';
15
- import { promisify } from 'util';
16
-
17
- const execAsync = promisify(exec);
18
-
19
- // Shell error type matching Bun's ShellError
20
- export class ShellError extends Error {
21
- exitCode: number;
22
- stdout: string;
23
- stderr: string;
24
-
25
- constructor(message: string, exitCode: number, stdout: string, stderr: string) {
26
- super(message);
27
- this.name = 'ShellError';
28
- this.exitCode = exitCode;
29
- this.stdout = stdout;
30
- this.stderr = stderr;
31
- }
32
- }
33
-
34
- interface ShellResult {
35
- stdout: string;
36
- stderr: string;
37
- exitCode: number;
38
- }
39
-
40
- interface ShellPromise extends Promise<ShellResult> {
41
- quiet(): Promise<ShellResult>;
42
- }
43
-
44
- /**
45
- * Shell command execution that mimics Bun.$
46
- * Works with both Bun and Node.js environments
47
- */
48
- export function $(strings: TemplateStringsArray, ...values: any[]): ShellPromise {
49
- const command = strings.reduce((acc, str, i) => {
50
- return acc + str + (values[i] || '');
51
- }, '');
52
-
53
- // Create a chainable object that mimics Bun.$
54
- const execute = async (options: { quiet?: boolean } = {}) => {
55
- // If Bun.$ is available, use it
56
- if (typeof Bun !== 'undefined' && (Bun as any).$) {
57
- const bunShell = (Bun as any).$;
58
- // Apply quiet option before executing if requested
59
- if (options.quiet) {
60
- const result = await bunShell(strings, ...values).quiet();
61
- return {
62
- stdout: result.stdout ? result.stdout.toString() : '',
63
- stderr: result.stderr ? result.stderr.toString() : '',
64
- exitCode: result.exitCode || 0
65
- };
66
- } else {
67
- const result = await bunShell(strings, ...values);
68
- return {
69
- stdout: result.stdout ? result.stdout.toString() : '',
70
- stderr: result.stderr ? result.stderr.toString() : '',
71
- exitCode: result.exitCode || 0
72
- };
73
- }
74
- }
75
-
76
- // Node.js fallback
77
- try {
78
- const { stdout, stderr } = await execAsync(command);
79
- return {
80
- stdout: stdout || '',
81
- stderr: stderr || '',
82
- exitCode: 0
83
- };
84
- } catch (error: any) {
85
- throw new ShellError(
86
- `Failed with exit code ${error.code}`,
87
- error.code || 1,
88
- error.stdout || '',
89
- error.stderr || ''
90
- );
91
- }
92
- };
93
-
94
- // Return chainable API
95
- const promise = execute() as any;
96
- promise.quiet = () => execute({ quiet: true });
97
- return promise as ShellPromise;
98
- }