@bash-app/bash-common 1.0.6 → 1.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/README.md ADDED
@@ -0,0 +1,8 @@
1
+ # Getting Started
2
+
3
+ If you have issues with a Prisma enum being undefined:
4
+
5
+ 1. Make certain that the enum is used in a model. If it isn't, it won't show up.
6
+
7
+ You can add an unused enum to the model `unusedModelButNeededForSomeTypesToBeDefinedForTypescript`
8
+ 2. Delete node_modules directory and reinstall.
package/package.json CHANGED
@@ -1,13 +1,15 @@
1
1
  {
2
2
  "name": "@bash-app/bash-common",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "Common data and scripts to use on the frontend and backend",
5
5
  "type": "module",
6
- "main": "index.d.ts",
6
+ "main": "src/index.ts",
7
7
  "scripts": {
8
+ "installSelf": "tsx scripts/installSelfInMainProject.ts",
9
+ "build": "npm run generate && npm run tsc",
8
10
  "generate": "prisma generate",
9
11
  "tsc": "tsc",
10
- "prepublishOnly": "npm run tsc"
12
+ "prepublishOnly": "npm run build"
11
13
  },
12
14
  "repository": {
13
15
  "type": "git",
@@ -19,14 +21,19 @@
19
21
  "ts-node": "^10.9.1",
20
22
  "typescript": "^5.2.2"
21
23
  },
24
+ "peerDependencies": {
25
+ "tsx": "^4.10.3"
26
+ },
22
27
  "devDependencies": {
28
+ "@prisma/client": "^5.13.0",
23
29
  "@types/jest": "^29.5.5",
24
30
  "@types/node": "^20.8.4",
31
+ "@types/react": "^18.3.2",
32
+ "@types/shelljs": "^0.8.15",
25
33
  "jest": "^29.7.0",
26
- "ts-jest": "^29.1.1"
27
- },
28
- "peerDependencies": {
29
- "@prisma/client": "^5.13.0",
30
- "prisma": "^5.13.0"
34
+ "prisma": "^5.13.0",
35
+ "shelljs": "^0.8.5",
36
+ "ts-jest": "^29.1.1",
37
+ "tslib": "^2.6.2"
31
38
  }
32
39
  }
@@ -0,0 +1,23 @@
1
+ import shell from 'shelljs';
2
+
3
+ const BASH_COMMON_DIR = 'bash-common';
4
+ const BASH_APP_PATH = '../node_modules/@bash-app/'; // Need to get to the main project folder
5
+ const BASH_COMMON_PATH = `${BASH_APP_PATH}${BASH_COMMON_DIR}`;
6
+
7
+ shell.echo('', `Current working dir: ${shell.pwd()}`);
8
+ shell.echo('', `Deleting bash-common folder: ${BASH_COMMON_PATH}`);
9
+
10
+ shell.rm('-rf', BASH_COMMON_PATH);
11
+ shell.mkdir('-p', BASH_COMMON_PATH);
12
+
13
+ shell.echo('', `Copying bash-common folder: ${BASH_COMMON_PATH}`);
14
+ shell.cp('-rf', `../${BASH_COMMON_DIR}`,`${BASH_APP_PATH}`);
15
+
16
+ shell.echo('', `Running npm commands in bash-common folder: ${BASH_COMMON_PATH}`);
17
+ shell.exec(`npm --prefix ${BASH_COMMON_PATH} install`);
18
+ shell.exec(`npm --prefix ${BASH_COMMON_PATH} run build`);
19
+
20
+ shell.echo('', `Copying prisma folder from bash-common folder: ${BASH_COMMON_PATH}`);
21
+ shell.cp('-rf', `${BASH_COMMON_PATH}/prisma`, '../'); // Need to get to the main project folder
22
+
23
+ shell.echo('', 'Done setting up bash-common!');
package/src/index.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from "./extendedSchemas";
2
+ export * from "./definitions";
package/tsconfig.json CHANGED
@@ -1,17 +1,18 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "target": "ES5",
3
+ "target": "es2022",
4
+ "module": "esnext",
5
+ "moduleResolution": "node",
6
+ "esModuleInterop": true,
4
7
  "noEmit": true,
5
8
  "outDir": "./dist",
6
9
  "rootDir": "./src",
7
10
  "strict": true,
8
- "esModuleInterop": true,
9
- "moduleResolution": "node",
10
11
  "skipLibCheck": true,
11
12
  "forceConsistentCasingInFileNames": true,
12
13
  "jsx": "react-jsx",
13
14
  "noImplicitAny": true,
14
- "sourceMap": true
15
+ "sourceMap": true,
15
16
  },
16
17
  "include": ["src/**/*.ts", "src/**/*.tsx"],
17
18
  "exclude": ["node_modules"]
package/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from "./src/extendedSchemas";
2
- export * from "./src/definitions";