Skip to content

Commit

Permalink
chore: contain code style configs in a package
Browse files Browse the repository at this point in the history
refs #223
  • Loading branch information
ygrishajev committed Jun 5, 2024
1 parent a5ad0cc commit 34e076e
Show file tree
Hide file tree
Showing 44 changed files with 252 additions and 91,421 deletions.
24 changes: 24 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const path = require("path");
const baseConfig = require("@akashnetwork/dev-config/.eslintrc.base");
const tsConfig = require("@akashnetwork/dev-config/.eslintrc.ts");
const nextConfig = require("@akashnetwork/dev-config/.eslintrc.next");

module.exports = {
...baseConfig,
settings: {
next: {
rootDir: "apps/*"
}
},
overrides: [
...baseConfig.overrides,
...tsConfig.overrides,
...nextConfig.overrides.map(override => ({
...override,
files: ["apps/*-web/**/*.{ts,tsx}", "apps/landing/**/*.{ts,tsx}"],
rules: {
"@next/next/no-html-link-for-pages": ["error", ["deploy-web", "landing"].map(app => path.resolve(__dirname, `apps/${app}/src/pages`))]
}
}))
]
};
70 changes: 0 additions & 70 deletions .eslintrc.json

This file was deleted.

22 changes: 14 additions & 8 deletions .github/workflows/validate-n-build-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,25 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 18.20.2
cache: npm
cache-dependency-path: package-lock.json

- name: Setup Local Deps
- name: Restore root node_modules cache
if: steps.filter.outputs.api == 'true'
uses: actions/setup-node@v4
uses: martijnhols/actions-cache@v3
id: cache-root
with:
node-version: 18.20.2
cache: npm
cache-dependency-path: apps/api/package-lock.json
path: node_modules
key: ${{ runner.os }}-${{ hashFiles('package-lock.json') }}

- name: Install dependencies
- name: Restore api node_modules cache
if: steps.filter.outputs.api == 'true'
uses: martijnhols/actions-cache@v3
id: cache-api
with:
path: apps/api/node_modules
key: ${{ runner.os }}-${{ hashFiles('apps/api/package-lock.json') }}

- name: Install dependencies
if: steps.filter.outputs.api == 'true' && (steps.cache-root.outputs.cache-hit != 'true' || steps.cache-api.outputs.cache-hit != 'true')
run: npm ci

- name: Run static code analysis
Expand Down
31 changes: 0 additions & 31 deletions .prettierrc

This file was deleted.

19 changes: 19 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const config = require("@akashnetwork/dev-config/.prettierrc");

module.exports = {
...config,
overrides: [
{
files: "./apps/deploy-web/**",
options: {
tailwindConfig: "./apps/deploy-web/tailwind.config.ts"
}
},
{
files: "./apps/stats-web/**",
options: {
tailwindConfig: "./apps/stats-web/tailwind.config.ts"
}
}
]
};
3 changes: 1 addition & 2 deletions Dockerfile.api
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ COPY package-lock.json /app

RUN apk add --no-cache python3 make g++ libc6-compat postgresql-dev

RUN npm ci --workspace apps/api
RUN npm ci
RUN npm run build --workspace apps/api

FROM node:18-alpine
Expand All @@ -22,7 +22,6 @@ COPY --from=builder /app/package-lock.json /app/package-lock.json

COPY --from=builder /app/apps/api/dist /app/apps/api/dist
COPY --from=builder /app/apps/api/package.json /app/apps/api/package.json
COPY --from=builder /app/apps/api/package-lock.json /app/apps/api/package-lock.json

RUN apk add --no-cache python3 make g++ libc6-compat postgresql-dev

Expand Down
1 change: 1 addition & 0 deletions apps/api/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@akashnetwork/dev-config/.eslintrc.ts');
17 changes: 0 additions & 17 deletions apps/api/.eslintrc.json

This file was deleted.

1 change: 1 addition & 0 deletions apps/api/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("@akashnetwork/dev-config/.prettierrc");
Loading

0 comments on commit 34e076e

Please sign in to comment.