-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2e7638d
commit dd7be82
Showing
8 changed files
with
225 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
if [[ $(type -t use_flake) != function ]]; then | ||
echo "ERROR: use_flake function missing." | ||
echo "Please update direnv to v2.30.0 or later." | ||
exit 1 | ||
fi | ||
|
||
use flake |
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 |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
node_modules | ||
dist | ||
.env | ||
.direnv/ |
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,31 @@ | ||
# Copyright 2020 Hathor Labs | ||
# This software is provided ‘as-is’, without any express or implied | ||
# warranty. In no event will the authors be held liable for any damages | ||
# arising from the use of this software. | ||
# This software cannot be redistributed unless explicitly agreed in writing with the authors. | ||
|
||
# Build phase | ||
FROM node:18-alpine AS builder | ||
|
||
WORKDIR /app | ||
|
||
RUN apk update && apk add python3 g++ make | ||
|
||
COPY package.json ./ | ||
|
||
RUN npm install --production | ||
|
||
COPY . ./ | ||
|
||
RUN npm run build | ||
|
||
# Production phase | ||
FROM node:18-alpine | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=builder /app/dist/ ./ | ||
COPY --from=builder /app/package.json ./ | ||
COPY --from=builder /app/node_modules ./node_modules | ||
|
||
CMD ["node", "index.js"] |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 Hathor Labs | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
description = "virtual environments"; | ||
|
||
inputs.devshell.url = "github:numtide/devshell"; | ||
inputs.flake-utils.url = "github:numtide/flake-utils"; | ||
|
||
outputs = { self, flake-utils, devshell, nixpkgs }: | ||
|
||
flake-utils.lib.eachDefaultSystem (system: { | ||
devShell = | ||
let pkgs = import nixpkgs { | ||
inherit system; | ||
|
||
overlays = [ devshell.overlay ]; | ||
}; | ||
in | ||
pkgs.devshell.mkShell { | ||
commands = [ | ||
{ | ||
category = "i18n"; | ||
name = "mkpot"; | ||
help = "Update translation template"; | ||
command = "make update_pot"; | ||
} | ||
{ | ||
category = "i18n"; | ||
name = "mkpo"; | ||
help = "Build translations"; | ||
command = "make i18n"; | ||
} | ||
]; | ||
packages = with pkgs; [ | ||
nixpkgs-fmt | ||
nodejs-18_x | ||
ruby | ||
gnumake | ||
gettext | ||
]; | ||
}; | ||
}); | ||
} |
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,13 @@ | ||
module.exports = { | ||
roots: ["<rootDir>/__tests__"], | ||
testRegex: ".*\\.test\\.ts$", | ||
transform: { | ||
"^.+\\.ts$": ["ts-jest", { | ||
tsconfig: "./tsconfig.json", | ||
babelConfig: { | ||
sourceMaps: true, | ||
} | ||
}] | ||
}, | ||
moduleFileExtensions: ["ts", "js", "json", "node"] | ||
}; |
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 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ES2020", | ||
"module": "CommonJS", | ||
"sourceMap": true, | ||
"strict": true, | ||
"esModuleInterop": true, | ||
"skipLibCheck": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"outDir": "./dist", | ||
"types": ["node", "jest"] | ||
}, | ||
"include": [ | ||
"src/**/*.ts" | ||
], | ||
"exclude": [ | ||
"node_modules" | ||
] | ||
} |