Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add shared code package. #31

Merged
merged 2 commits into from
Aug 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 54 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
"npm": ">=7.20"
},
"scripts": {
"build": "npm run build-server && npm run build-web",
"build": "npm run build-shared && npm run build-server && npm run build-web",
"build-server": "npm run -w server build",
"build-shared": "npm run -w shared build",
"build-web": "web-build -o dist -t \"PorkBelly CRM\"",
"lint": "npm run --ws lint",
"lint:nofix": "npm run --ws lint:nofix",
Expand All @@ -19,6 +20,7 @@
},
"workspaces": [
"server",
"shared",
"web"
]
}
1 change: 1 addition & 0 deletions server/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/member-delimiter-style": "error",
"no-console": "off",
"import/no-default-export": "error",
"import/prefer-default-export": "off",
Expand Down
1 change: 1 addition & 0 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"start": "node ./build/start.js"
},
"dependencies": {
"@porkbellypro/crm-shared": "file:shared",
"argparse": "^2.0.1",
"express": "^4.17.1",
"mongoose": "^5.13.7"
Expand Down
25 changes: 25 additions & 0 deletions shared/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"env": {
"es2021": true,
"node": true
},
"extends": [
"airbnb-typescript/base"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module",
"project": "./tsconfig.json"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/member-delimiter-style": "error",
"no-console": "off",
"import/no-default-export": "error",
"import/prefer-default-export": "off",
"linebreak-style": "off"
}
}
1 change: 1 addition & 0 deletions shared/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/lib
18 changes: 18 additions & 0 deletions shared/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "@porkbellypro/crm-shared",
"main": "lib/index.js",
"scripts": {
"build": "tsc",
"lint": "eslint src --ext .ts --fix",
"lint:nofix": "eslint src --ext .ts"
},
"devDependencies": {
"@tsconfig/recommended": "^1.0.1",
"@typescript-eslint/eslint-plugin": "^4.29.1",
"@typescript-eslint/parser": "^4.29.1",
"eslint": "^7.32.0",
"eslint-config-airbnb-typescript": "^12.3.1",
"eslint-plugin-import": "^2.24.0",
"typescript": "^4.3.5"
}
}
Empty file added shared/src/index.ts
Empty file.
12 changes: 12 additions & 0 deletions shared/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "@tsconfig/recommended/tsconfig.json",
"compilerOptions": {
"declaration": true,
"lib": [
"dom",
"es2020"
],
"outDir": "./lib",
"rootDir": "./src"
}
}
1 change: 1 addition & 0 deletions web/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/member-delimiter-style": "error",
"@typescript-eslint/no-use-before-define": "error",
"import/no-default-export": "error",
"import/prefer-default-export": "off",
Expand Down
1 change: 1 addition & 0 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
},
"dependencies": {
"@fluentui/react": "^8.28.2",
"@porkbellypro/crm-shared": "file:shared",
"@tsconfig/recommended": "^1.0.1",
"@types/react-dom": "^17.0.9",
"@types/react": "^17.0.18",
Expand Down