Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jviide committed Jul 29, 2021
1 parent af8ae96 commit 7292a17
Show file tree
Hide file tree
Showing 12 changed files with 3,390 additions and 1 deletion.
44 changes: 44 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
module.exports = {
root: true,
extends: ["plugin:prettier/recommended"],
parserOptions: {
ecmaVersion: 2018,
sourceType: "module",
},
rules: {
"prettier/prettier": "warn",
"linebreak-style": ["error", "unix"],
"no-console": "error",
eqeqeq: ["error", "smart"],
},
overrides: [
{
files: ["*.ts", "*.tsx"],
parser: "@typescript-eslint/parser",
parserOptions: {
project: "./tsconfig.json",
},
extends: ["plugin:@typescript-eslint/recommended"],
rules: {
"@typescript-eslint/no-for-in-array": ["error"],
"@typescript-eslint/explicit-member-accessibility": [
"error",
{ accessibility: "no-public" },
],
"@typescript-eslint/explicit-function-return-type": [
"error",
{ allowExpressions: true, allowTypedFunctionExpressions: true },
],
"@typescript-eslint/no-unused-vars": [
"error",
{
varsIgnorePattern: "^_",
argsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
"@typescript-eslint/no-namespace": "off",
},
},
],
};
31 changes: 31 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: publish

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "14"
cache: npm
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run lint
- run: npm run typecheck
- run: npm test
- run: npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- uses: actions/setup-node@v2
with:
registry-url: https://npm.pkg.github.com/
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
17 changes: 17 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: tests

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "14"
cache: npm
- run: npm ci
- run: npm run lint
- run: npm run typecheck
- run: npm test
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
}
21 changes: 21 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"files.exclude": {
"**/node_modules": true,
"dist": true
},
"typescript.tsdk": "node_modules/typescript/lib",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"eslint.format.enable": true,
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[javascriptreact]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[typescriptreact]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
}
}
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,24 @@
# libapp
# libapp

TypeScript helpers for creating Badrap apps.

## Installation

```
npm i @badrap/libapp
```

## Enabling JSX/TSX support

Modify your tsconfig.json file by adding in the following lines:

```
{
"compilerOptions": {
...
"jsx": "react-jsx",
"jsxImportSource": "@badrap/app/ui"
},
...
}
```
Loading

0 comments on commit 7292a17

Please sign in to comment.