-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TypeScript + Sapphire Framework update.
- Loading branch information
Showing
30 changed files
with
1,113 additions
and
3,297 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
node_modules | ||
npm-debug.log | ||
.eslintrc.json | ||
pnpm-lock.yaml | ||
.env | ||
.config.json | ||
.gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/* | ||
!/src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"env": { | ||
"node": true, | ||
"es2022": true | ||
}, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:@typescript-eslint/recommended-requiring-type-checking", | ||
"plugin:@typescript-eslint/strict" | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": ["@typescript-eslint"], | ||
"root": true, | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"project": true | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
node_modules | ||
pnpm-lock.yaml | ||
dist | ||
.env | ||
config.json | ||
.history | ||
.history | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/* | ||
!/src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/prettierrc", | ||
"semi": false, | ||
"tabWidth": 2, | ||
"singleQuote": true, | ||
"printWidth": 100, | ||
"trailingComma": "none" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,50 @@ | ||
FROM node:18-alpine | ||
# Create app directory | ||
WORKDIR /usr/src/bot | ||
# Install app dependencies | ||
# A wildcard is used to ensure both package.json AND package-lock.json are copied | ||
# where available (npm@5+) | ||
COPY package*.json ./ | ||
# RUN npm install | ||
# If you are building your code for production | ||
RUN npm ci --only=production | ||
# Bundle app source | ||
COPY . . | ||
CMD [ "node", "./src/index.js" ] | ||
# ================ # | ||
# Base Stage # | ||
# ================ # | ||
|
||
FROM node:19-alpine as base | ||
|
||
RUN corepack enable pnpm | ||
RUN corepack prepare pnpm@latest --activate | ||
|
||
# ======================== # | ||
# Dependencies Stage # | ||
# ======================== # | ||
|
||
FROM base as dependencies | ||
|
||
WORKDIR /opt/app | ||
COPY package.json . | ||
COPY tsconfig.json . | ||
COPY src ./src | ||
RUN pnpm install | ||
|
||
# ================= # | ||
# Build Stage # | ||
# ================= # | ||
|
||
FROM base as build | ||
|
||
WORKDIR /opt/app | ||
COPY --from=dependencies /opt/app . | ||
RUN pnpm build | ||
RUN pnpm prune --prod | ||
|
||
# ================== # | ||
# Deploy Stage # | ||
# ================== # | ||
|
||
FROM base as deploy | ||
|
||
ENV NODE_ENV="production" | ||
|
||
WORKDIR /opt/app | ||
COPY --from=build /opt/app/dist ./dist | ||
COPY --from=build /opt/app/node_modules ./node_modules | ||
COPY --from=build /opt/app/package.json ./package.json | ||
|
||
RUN chown node:node . | ||
|
||
USER node | ||
|
||
CMD [ "node", "dist/index.js" ] |
Oops, something went wrong.