Initial commit

master
Kuba Orlik 3 years ago
commit 3fcf393d59

@ -0,0 +1,8 @@
{
"phabricator.uri": "https://hub.sealcode.org/",
"arc.land.onto.default": "dev",
"load": ["arcanist-linters", "arc-unit-mocha/src"],
"unit.engine": "MochaEngine",
"unit.mocha.include": ["./lib/**/*.test.js"],
"unit.mocha.dockerRoot": "/opt/sealious"
}

@ -0,0 +1,13 @@
{
"linters": {
"prettier": {
"type": "prettier",
"bin": "./node_modules/.bin/prettier",
"include": ["(\\.ts$)", "(\\.css$)"]
},
"eslint": {
"type": "eslint",
"include": ["(src/.*\\.ts$)", "(src/.*\\.js$)"]
}
}
}

@ -0,0 +1,38 @@
module.exports = {
env: { node: true },
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint", "prettier"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:prettier/recommended",
],
parserOptions: {
sourceType: "module",
ecmaFeatures: {
modules: true,
},
project: "./tsconfig.json",
},
rules: {
"@typescript-eslint/require-await": 0,
"jsdoc/require-description": 2,
"no-await-in-loop": 2,
},
settings: { jsdoc: { mode: "typescript" } },
overrides: [
{
files: ["*.subtest.ts", "*.test.ts"],
rules: {
"@typescript-eslint/no-unsafe-member-access": 0,
"prefer-const": 0,
"@typescript-eslint/no-unsafe-call": 0,
"@typescript-eslint/no-unsafe-return": 0,
"@typescript-eslint/no-unsafe-assignment": 0,
"no-await-in-loop": 1, // sometimes it's easier to debug when requests run sequentially
},
},
],
};

23
.gitignore vendored

@ -0,0 +1,23 @@
.DS_Store
.idea
*.log
tmp/
*~
*.sublime-workspace
npm-debug.log
node_modules
db
coverage.html
\#*
.\#*
.npm
.config
.ash_history
cosealious
node_modules*
.cache
lib
@types
.xunit
coverage
.nyc_output

@ -0,0 +1,14 @@
{
useTabs: true,
tabWidth: 4,
trailingComma: "es5",
"overrides": [
{
"files": "*.yml",
"options": {
"tabWidth": 2,
"useTabs": false
}
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

@ -0,0 +1,16 @@
version: "3.2"
services:
db:
image: mongo:4.4-bionic
ports:
- "127.0.0.1:20723:27017"
test:
image: sealious-test:latest
build:
context: .
dockerfile: test.dockerfile
volumes:
- ./:/opt/app/
ports:
- "127.0.0.1:8080:8080"
user: ${UID:-1000}:${GID:-1000}

3284
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -0,0 +1,24 @@
{
"name": "sealious-playground",
"version": "1.0.1",
"description": "",
"main": "./dist/index.js",
"scripts": {
"start": "docker-compose up -d db && node .",
"test-cmd": "node test.js",
"test": "./npm.sh run test-cmd -- ",
"build": "tsc",
"watch": "npm run build -- --watch",
"test-reports": "npm run build && rm -fr .xunit coverage && docker-compose up -d db mailcatcher && npm run test -- --cover --test-report",
"cover-html": "npm run test-reports -- --cover-html && xdg-open coverage/lcov-report/index.html"
},
"author": "",
"license": "ISC",
"dependencies": {
"sealious": "^0.13.0"
},
"devDependencies": {
"prettier": "^2.2.1",
"typescript": "^4.1.3"
}
}

@ -0,0 +1,42 @@
import { resolve } from "path";
import { App, Collection, FieldTypes, Policies } from "sealious";
import _locreq from "locreq";
const locreq = _locreq(__dirname);
const app = new (class extends App {
config = {
upload_path: locreq.resolve("uploaded_files"),
datastore_mongo: {
host: "localhost",
port: 20723,
db_name: "sealious-playground",
},
email: {
from_address: "sealious-playground@example.com",
from_name: "Sealious playground app",
},
};
manifest = {
name: "Sealious Playground",
logo: resolve(__dirname, "../assets/logo.png"),
version: "0.0.1",
default_language: "en",
base_url: "localhost:8080",
admin_email: "admin@example.com",
colors: {
primary: "#5294a1",
},
};
collections = {
...App.BaseCollections,
tasks: new (class extends Collection {
fields = {
title: new FieldTypes.Text(),
done: new FieldTypes.Boolean(),
};
defaultPolicy = new Policies.Public();
})(),
};
})();
app.start();

@ -0,0 +1,24 @@
FROM node:15-alpine
LABEL maintainer="Jakub Pieńkowski <jakski@sealcode.org>"
ENV UID=node \
GID=node \
HOME=/opt/sealious
RUN sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/mirrors.dotsrc.org/g' /etc/apk/repositories
# Tini will ensure that any orphaned processes get reaped properly.
RUN apk add --no-cache tini
RUN apk --update add git
RUN apk --update add python
RUN apk --update add make
RUN apk --update add g++
VOLUME $HOME
WORKDIR $HOME
USER $UID:$GID
EXPOSE 8080
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["/usr/local/bin/node", "."]

@ -0,0 +1,20 @@
{
"compilerOptions": {
"module": "commonjs",
"moduleResolution": "node",
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"target": "ES2019",
"declaration": true,
"esModuleInterop": true,
"lib": ["es6", "esnext"],
"outDir": "dist",
"checkJs": true,
"allowJs": true,
"declarationDir": "@types",
"resolveJsonModule": true,
"sourceMap": true
},
"include": ["src/**/*"]
}
Loading…
Cancel
Save