Skip to content

Commit ef0f3b5

Browse files
committed
refactor(nx): removed nx
1 parent 530db12 commit ef0f3b5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+755
-152818
lines changed

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
node_modules
2+
dist
3+
log

.eslintrc.json

Lines changed: 72 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,81 @@
11
{
22
"root": true,
3-
"ignorePatterns": ["**/*"],
4-
"plugins": ["@nx"],
3+
"plugins": ["@typescript-eslint", "promise", "import"],
54
"extends": [
6-
5+
"eslint:recommended",
6+
"plugin:@typescript-eslint/recommended",
7+
"prettier",
8+
"plugin:node/recommended"
79
],
10+
"parserOptions": {
11+
"ecmaVersion": 2022,
12+
"sourceType": "module",
13+
"project": "./tsconfig.base.json"
14+
},
815
"overrides": [
916
{
10-
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
11-
"rules": {
12-
13-
"@nx/enforce-module-boundaries": [
14-
"error",
15-
{
16-
"enforceBuildableLibDependency": true,
17-
"allow": [],
18-
"depConstraints": [
19-
{
20-
"sourceTag": "*",
21-
"onlyDependOnLibsWithTags": ["*"]
22-
}
23-
]
24-
}
25-
]
26-
}
27-
},
28-
{
29-
"files": ["*.ts", "*.tsx"],
30-
"extends": ["plugin:@nx/typescript"],
31-
"rules": {}
32-
},
33-
{
34-
"files": ["*.js", "*.jsx"],
35-
"extends": ["plugin:@nx/javascript"],
36-
"rules": {}
37-
},
38-
{
39-
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
17+
"files": ["tests/**/*"],
18+
"plugins": ["jest"],
4019
"env": {
41-
"jest": true
42-
},
43-
"rules": {}
20+
"jest/globals": true
21+
}
4422
}
45-
]
23+
],
24+
"rules": {
25+
"indent": "off",
26+
"linebreak-style": ["error", "unix"],
27+
"quotes": ["error", "double"],
28+
"semi": "off",
29+
30+
"space-before-function-paren": "off",
31+
"@typescript-eslint/space-before-function-paren": "off",
32+
33+
"@typescript-eslint/indent": "off",
34+
"@typescript-eslint/semi": "off",
35+
"@typescript-eslint/member-delimiter-style": "off",
36+
"@typescript-eslint/strict-boolean-expressions": "off",
37+
"@typescript-eslint/explicit-function-return-type": "off",
38+
"@typescript-eslint/restrict-plus-operands": "off",
39+
"@typescript-eslint/restrict-template-expressions": "off",
40+
"@typescript-eslint/prefer-optional-chain": "off",
41+
"@typescript-eslint/no-misused-promises": "off",
42+
"@typescript-eslint/consistent-type-assertions": "off",
43+
44+
// plugin: node/recommended
45+
"node/exports-style": ["error", "module.exports"],
46+
"node/file-extension-in-import": "off",
47+
"node/no-missing-import": "off",
48+
"node/prefer-global/buffer": ["error", "always"],
49+
"node/prefer-global/console": ["error", "always"],
50+
"node/prefer-global/process": ["error", "always"],
51+
"node/prefer-global/url-search-params": ["error", "always"],
52+
"node/prefer-global/url": ["error", "always"],
53+
"node/prefer-promises/dns": "error",
54+
"node/prefer-promises/fs": "error",
55+
"node/no-unsupported-features/es-syntax": "off",
56+
"node/no-extraneous-import": "off",
57+
"node/no-unsupported-features/es-builtins": "off",
58+
59+
// plugin promise
60+
"promise/always-return": "error",
61+
"promise/no-return-wrap": "error",
62+
"promise/param-names": "error",
63+
"promise/catch-or-return": "error",
64+
"promise/no-native": "off",
65+
"promise/no-nesting": "warn",
66+
"promise/no-promise-in-callback": "off",
67+
"promise/no-callback-in-promise": "warn",
68+
"promise/avoid-new": "warn",
69+
"promise/no-new-statics": "error",
70+
"promise/no-return-in-finally": "warn",
71+
"promise/valid-params": "warn",
72+
73+
"n/no-callback-literal": "off",
74+
"security/detect-object-injection": "off",
75+
76+
"sort-imports": [
77+
"error",
78+
{ "ignoreDeclarationSort": true, "ignoreCase": true }
79+
]
80+
}
4681
}

.github/workflows/main_lyve-api.yml

Lines changed: 70 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,70 @@
1-
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
2-
# More GitHub Actions for Azure: https://github.com/Azure/actions
3-
4-
name: Build and deploy Node.js app to Azure Web App - lyve-api
5-
6-
on:
7-
push:
8-
branches:
9-
- main
10-
workflow_dispatch:
11-
12-
jobs:
13-
build:
14-
runs-on: ubuntu-latest
15-
16-
steps:
17-
- uses: actions/checkout@v4
18-
19-
- name: Set up Node.js version
20-
uses: actions/setup-node@v3
21-
with:
22-
node-version: '20.x'
23-
24-
- name: install, build, and test
25-
run: |
26-
yarn install
27-
npx nx build api --generatePackageJson
28-
# npx nx run api:test
29-
30-
- name: Zip artifact for deployment
31-
run: zip release.zip . -r
32-
33-
- name: Upload artifact for deployment job
34-
uses: actions/upload-artifact@v3
35-
with:
36-
name: node-app
37-
path: release.zip
38-
39-
deploy:
40-
runs-on: ubuntu-latest
41-
needs: build
42-
environment:
43-
name: 'Production'
44-
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
45-
permissions:
46-
id-token: write #This is required for requesting the JWT
47-
48-
steps:
49-
- name: Download artifact from build job
50-
uses: actions/download-artifact@v3
51-
with:
52-
name: node-app
53-
54-
- name: Unzip artifact for deployment
55-
run: unzip release.zip
56-
57-
- name: Login to Azure
58-
uses: azure/login@v1
59-
with:
60-
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_64A49D36372F4E32831D89BACF50CDC4 }}
61-
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_32B5337C09F4459CB1E78D1C57F5BE10 }}
62-
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_7F2CA69616024A5B92BE3972F09BF830 }}
63-
64-
- name: 'Deploy to Azure Web App'
65-
id: deploy-to-webapp
66-
uses: azure/webapps-deploy@v2
67-
with:
68-
app-name: 'lyve-api'
69-
slot-name: 'Production'
70-
package: './dist/apps/'
71-
1+
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
2+
# More GitHub Actions for Azure: https://github.com/Azure/actions
3+
4+
name: Build and deploy Node.js app to Azure Web App - lyve-api
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Node.js version
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: "20.x"
23+
24+
- name: install, build, and test
25+
run: |
26+
yarn install
27+
yarn build
28+
29+
30+
- name: Zip artifact for deployment
31+
run: zip release.zip . -r
32+
33+
- name: Upload artifact for deployment job
34+
uses: actions/upload-artifact@v3
35+
with:
36+
name: node-app
37+
path: release.zip
38+
39+
deploy:
40+
runs-on: ubuntu-latest
41+
needs: build
42+
environment:
43+
name: "Production"
44+
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
45+
permissions:
46+
id-token: write #This is required for requesting the JWT
47+
48+
steps:
49+
- name: Download artifact from build job
50+
uses: actions/download-artifact@v3
51+
with:
52+
name: node-app
53+
54+
- name: Unzip artifact for deployment
55+
run: unzip release.zip
56+
57+
- name: Login to Azure
58+
uses: azure/login@v1
59+
with:
60+
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_64A49D36372F4E32831D89BACF50CDC4 }}
61+
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_32B5337C09F4459CB1E78D1C57F5BE10 }}
62+
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_7F2CA69616024A5B92BE3972F09BF830 }}
63+
64+
- name: "Deploy to Azure Web App"
65+
id: deploy-to-webapp
66+
uses: azure/webapps-deploy@v2
67+
with:
68+
app-name: "lyve-api"
69+
slot-name: "Production"
70+
package: "./dist/apps/"

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ testem.log
3838
.DS_Store
3939
Thumbs.db
4040

41-
.nx/cache
4241

4342
# Expo
4443
node_modules/

.prettierignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
# Add files here to ignore them from prettier formatting
22
/dist
3-
/coverage
4-
/.nx/cache
3+
/coverage

.vscode/extensions.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
{
2-
"recommendations": [
3-
"nrwl.angular-console",
4-
"esbenp.prettier-vscode",
5-
"firsttris.vscode-jest-runner"
6-
]
2+
"recommendations": []
73
}

0 commit comments

Comments
 (0)