Init newsletter-handler

This commit is contained in:
Hongbo Wu 2022-09-28 12:35:42 +08:00
parent f6cb7a279d
commit e4c847ac4c
11 changed files with 67 additions and 0 deletions

View file

@ -0,0 +1 @@
node_modules/

View file

@ -0,0 +1,6 @@
{
"extends": "../../.eslintrc",
"parserOptions": {
"project": "tsconfig.json"
}
}

View file

@ -0,0 +1,2 @@
node_modules
/lib

View file

@ -0,0 +1,7 @@
/test/
src
tsconfig.json
.eslintrc
.eslintignore
.gitignore
mocha-config.json

View file

View file

@ -0,0 +1,5 @@
{
"extension": ["ts"],
"spec": "test/**/*.test.ts",
"require": "test/babel-register.js"
}

View file

@ -0,0 +1,20 @@
{
"name": "@omnivore/newsletter-handler",
"version": "1.0.0",
"description": "A standalone version of newsletter handler to parse and format each newsletter",
"main": "build/src/index.js",
"types": "build/src/index.d.ts",
"files": [
"build/src"
],
"license": "Apache-2.0",
"scripts": {
"test": "yarn mocha -r ts-node/register --config mocha-config.json",
"lint": "eslint src --ext ts,js,tsx,jsx",
"compile": "tsc",
"build": "tsc"
},
"devDependencies": {
"eslint-plugin-prettier": "^4.0.0"
}
}

View file

View file

@ -0,0 +1,3 @@
const register = require('@babel/register').default
register({ extensions: ['.ts', '.tsx', '.js', '.jsx'] })

View file

@ -0,0 +1,13 @@
import 'mocha'
import * as chai from 'chai'
import { expect } from 'chai'
import 'chai/register-should'
import chaiString from 'chai-string'
chai.use(chaiString)
describe('Stub test', () => {
it('should pass', () => {
expect(true).to.be.true
})
})

View file

@ -0,0 +1,10 @@
{
"extends": "@tsconfig/node14/tsconfig.json",
"compilerOptions": {
"rootDir": ".",
"declaration": true,
"outDir": "build",
"lib": ["dom"]
},
"include": ["src", "test"]
}