@laboratory-one/api-components 0.0.30 → 0.0.31

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@laboratory-one/api-components",
3
- "version": "0.0.30",
3
+ "version": "0.0.31",
4
4
  "description": "API components for Laboratory One",
5
5
  "author": "Laboratory One",
6
6
  "private": false,
@@ -20,6 +20,7 @@
20
20
  "files": [
21
21
  "index.ts",
22
22
  "src/**/*.{js,ts}",
23
+ "scripts/**/*.sh",
23
24
  "package.json",
24
25
  "README.md",
25
26
  "LICENSE",
@@ -30,20 +31,24 @@
30
31
  "import": "./dist/src/*/index.js",
31
32
  "require": "./dist/src/*/index.js",
32
33
  "types": "./dist/src/*/index.d.ts"
33
- }
34
+ },
35
+ "./scripts/*": "./scripts/*"
34
36
  },
35
37
  "scripts": {
36
38
  "build": "tsc",
37
39
  "format": "prettier --write 'src/**/*.{js,ts}'",
38
40
  "lint": "eslint 'src/**/*.{js,ts}'",
39
41
  "lint:fix": "yarn format && yarn lint --fix",
42
+ "lint:ls": "ls-lint",
43
+ "lint:all": "yarn lint:fix && yarn lint:ls",
40
44
  "publish:local": "yalc publish",
41
45
  "push": "yarn build && yalc push --replace",
42
46
  "typecheck": "tsc --noEmit",
43
47
  "types:generate": "npx prisma generate",
44
48
  "version:minor": "./scripts/version.sh minor",
45
49
  "version:patch": "./scripts/version.sh patch",
46
- "start:dev": "watchman watch . && watchman -- trigger . yalc-push-trigger \"**/*\" -- ./scripts/yalc-push-trigger.sh"
50
+ "start:dev": "watchman watch . && watchman -- trigger . yalc-push-trigger \"**/*\" -- ./scripts/yalc-push-trigger.sh",
51
+ "prepare": "husky"
47
52
  },
48
53
  "dependencies": {
49
54
  "@casl/ability": "6.7.3",
@@ -72,6 +77,7 @@
72
77
  "zod": "4.1.11"
73
78
  },
74
79
  "devDependencies": {
80
+ "@ls-lint/ls-lint": "2.3.1",
75
81
  "@nestjs/cli": "11.0.10",
76
82
  "@nestjs/schematics": "11.0.7",
77
83
  "@nestjs/testing": "11.1.6",
@@ -85,6 +91,7 @@
85
91
  "eslint": "9.36.0",
86
92
  "eslint-config-prettier": "10.1.8",
87
93
  "eslint-plugin-prettier": "5.5.4",
94
+ "husky": "9.1.7",
88
95
  "jest": "30.1.3",
89
96
  "prettier": "3.6.2",
90
97
  "ts-node": "10.9.2",
@@ -0,0 +1,41 @@
1
+ #!/bin/bash
2
+
3
+ # Check if required arguments are provided
4
+ if [ "$#" -lt 2 ]; then
5
+ echo "Usage: $0 <sdk-name> <project-path> [project-path2] [project-path3] ..."
6
+ echo "Example: $0 anki ../ankisan ../other-project"
7
+ exit 1
8
+ fi
9
+
10
+ SDK_NAME=$1
11
+ shift # Remove first argument, rest are project paths
12
+ PROJECT_PATHS=("$@")
13
+
14
+ # Generate OpenAPI specification
15
+ echo "Generating OpenAPI specification..."
16
+ GENERATE_OPENAPI=true nest start
17
+
18
+ # Generate TypeScript SDK to ./generated directory
19
+ GENERATED_DIR="./generated/$SDK_NAME"
20
+ echo "Generating TypeScript SDK for '$SDK_NAME' to '$GENERATED_DIR'..."
21
+ npx openapi-typescript-codegen \
22
+ --input openapi.json \
23
+ --output "$GENERATED_DIR" \
24
+ --client fetch \
25
+ --useOptions \
26
+ --exportCore true \
27
+ --exportServices true \
28
+ --exportModels true \
29
+ --exportSchemas true
30
+
31
+ # Copy SDK to each project path
32
+ echo "Copying SDK to project paths..."
33
+ for PROJECT_PATH in "${PROJECT_PATHS[@]}"; do
34
+ TARGET_DIR="$PROJECT_PATH/src/generated/$SDK_NAME"
35
+ echo "Copying to $TARGET_DIR..."
36
+ mkdir -p "$TARGET_DIR"
37
+ cp -r "$GENERATED_DIR"/* "$TARGET_DIR/"
38
+ echo "✓ Copied to $PROJECT_PATH"
39
+ done
40
+
41
+ echo "SDK generation and distribution complete!"
@@ -0,0 +1,12 @@
1
+ # use yarn to bump patch or minor version based on arg
2
+ # Usage: ./scripts/version.sh patch
3
+ # Usage: ./scripts/version.sh minor
4
+
5
+ if [ "$1" = "patch" ]; then
6
+ yarn version --patch
7
+ elif [ "$1" = "minor" ]; then
8
+ yarn version --minor
9
+ else
10
+ echo "Usage: ./scripts/version.sh patch"
11
+ echo "Usage: ./scripts/version.sh minor"
12
+ fi
@@ -0,0 +1,2 @@
1
+ #!/bin/bash
2
+ yarn push
@@ -1 +1 @@
1
- export * from './instrument-sentry';
1
+ export * from './sentry.service';
@@ -1 +0,0 @@
1
- {"version":3,"file":"instrument-sentry.d.ts","sourceRoot":"","sources":["../../../src/services/instrument-sentry.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU,GAAI,aAAa,MAAM,SAkB7C,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"instrument-sentry.js","sourceRoot":"","sources":["../../../src/services/instrument-sentry.ts"],"names":[],"mappings":";;;;AAAA,6DAAuC;AACvC,2DAAkE;AAE3D,MAAM,UAAU,GAAG,CAAC,WAAmB,EAAE,EAAE;IAEhD,MAAM,CAAC,IAAI,CAAC;QACV,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU;QAC3B,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,WAAW;QACpC,OAAO,EAAE,GAAG,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE;QAC5D,YAAY,EAAE;YAEZ,IAAA,yCAAwB,GAAE;YAC1B,MAAM,CAAC,cAAc,CAAC,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC;SACnD;QAGD,gBAAgB,EAAE,GAAG;QAGrB,kBAAkB,EAAE,GAAG;KACxB,CAAC,CAAC;AACL,CAAC,CAAC;AAlBW,QAAA,UAAU,cAkBrB","sourcesContent":["import * as Sentry from '@sentry/node';\nimport { nodeProfilingIntegration } from '@sentry/profiling-node';\n\nexport const initSentry = (projectName: string) => {\n // Ensure to call this before requiring any other modules!\n Sentry.init({\n dsn: process.env.SENTRY_DSN,\n environment: process.env.ENVIRONMENT,\n release: `${projectName}@${process.env.npm_package_version}`,\n integrations: [\n // Add our Profiling integration\n nodeProfilingIntegration(),\n Sentry.anrIntegration({ captureStackTrace: true }),\n ],\n // Add Tracing by setting tracesSampleRate\n // We recommend adjusting this value in production\n tracesSampleRate: 1.0,\n // Set sampling rate for profiling\n // This is relative to tracesSampleRate\n profilesSampleRate: 1.0,\n });\n};\n"]}