Skip to content

Commit

Permalink
chore: Standardization (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoArregui authored Feb 1, 2023
1 parent 2004eac commit 6bbd6c0
Show file tree
Hide file tree
Showing 23 changed files with 7,799 additions and 21,019 deletions.
8 changes: 5 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
coverage/
test/
dist/
node_modules/
jest.config.js
*.js
*.d.ts
*.json
src/index.ts
18 changes: 11 additions & 7 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
{
"extends": "@dcl/eslint-config",
"parser": "@typescript-eslint/parser",
"extends": "@dcl/eslint-config/sdk",
"parserOptions": {
"ecmaVersion": 2020, // Allows for the parsing of modern ECMAScript features
"sourceType": "module", // Allows for the use of imports
"project": [
// Specify it only for TypeScript files
"./tsconfig.json",
"./test/tsconfig.json"
"tsconfig.json"
]
},
"rules": {
"prettier/prettier": ["error", {
"printWidth": 120,
"semi": false,
"singleQuote": true,
"trailingComma": "none",
"tabWidth": 2
}]
}
}
14 changes: 12 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,15 @@ updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
interval: weekly
day: monday
time: "09:00"
timezone: "America/Buenos_Aires"
allow:
- dependency-name: "@dcl/*"
- dependency-name: "@catalyst/*"
- dependency-name: "@well-known-components/*"
- dependency-name: "dcl-*"
versioning-strategy: auto
commit-message:
prefix: "chore: "
16 changes: 16 additions & 0 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Publish 'latest' image

on:
release:
types:
- "created"

jobs:
cd:
uses: decentraland/actions/.github/workflows/build-quay-main.yml@main
with:
service-name: worlds-content-server
docker-tag: latest ${{ github.event.release.tag_name }}
secrets:
QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }}
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }}
8 changes: 4 additions & 4 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ jobs:
node-version: 16.x
cache: npm
- name: install
run: npm ci
run: yarn install --frozen-lockfile
- name: check code lint
run: npm run lint:check
run: yarn lint:check
- name: build
run: make build
run: yarn build
- name: create .env
run: echo "" >> .env
- name: test
run: npm run test:coverage
run: yarn test:coverage
14 changes: 14 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: CI/CD on PR

on:
pull_request:

jobs:
cd-dev:
uses: decentraland/actions/.github/workflows/build-quay-main.yml@main
with:
service-name: words-content-service
docker-tag: '${{ github.sha }}'
secrets:
QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }}
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ node_modules/
coverage
contents
.env
*.gen.ts
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ RUN chmod +x /tini

# install dependencies
COPY package.json /app/package.json
COPY package-lock.json /app/package-lock.json
RUN npm ci
COPY yarn.lock /app/yarn.lock
RUN yarn install --frozen-lockfile

# build the app
COPY . /app
RUN make build
RUN npm run test
RUN yarn test
RUN yarn build

# remove devDependencies, keep only used dependencies
RUN npm ci --only=production
RUN yarn install --prod --frozen-lockfile

ARG COMMIT_HASH
RUN echo "COMMIT_HASH=$COMMIT_HASH" >> .env
Expand Down
13 changes: 1 addition & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
src/proto/http-endpoints.gen.ts: node_modules/@dcl/protocol/bff/http-endpoints.proto
mkdir -p src/proto
node_modules/.bin/protoc \
--plugin=./node_modules/.bin/protoc-gen-ts_proto \
--ts_proto_opt=esModuleInterop=true,returnObservable=false,outputServices=generic-definitions,oneof=unions \
--ts_proto_opt=fileSuffix=.gen \
--ts_proto_out="$(PWD)/src/proto" \
-I="$(PWD)/node_modules/@dcl/protocol/bff" \
-I="$(PWD)/node_modules/protobufjs" \
"$(PWD)/node_modules/@dcl/protocol/bff/http-endpoints.proto"

build: src/proto/http-endpoints.gen.ts
build:
@rm -rf dist || true
@mkdir -p dist
@./node_modules/.bin/tsc -p tsconfig.json
Loading

0 comments on commit 6bbd6c0

Please sign in to comment.