Skip to content

Commit

Permalink
chore: initial project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
andreabadesso committed Sep 25, 2023
1 parent 2e7638d commit dd7be82
Show file tree
Hide file tree
Showing 8 changed files with 225 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .envrc
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
node_modules
dist
.env
.direnv/
31 changes: 31 additions & 0 deletions Dockerfile
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"]
21 changes: 21 additions & 0 deletions LICENSE
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.
92 changes: 92 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 41 additions & 0 deletions flake.nix
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
];
};
});
}
13 changes: 13 additions & 0 deletions jest.config.js
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"]
};
19 changes: 19 additions & 0 deletions tsconfig.json
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"
]
}

0 comments on commit dd7be82

Please sign in to comment.