Skip to content

Commit

Permalink
init ts project
Browse files Browse the repository at this point in the history
  • Loading branch information
jimchen5209 committed Jul 29, 2021
1 parent 220908c commit cac16c1
Show file tree
Hide file tree
Showing 8 changed files with 1,496 additions and 124 deletions.
55 changes: 17 additions & 38 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
# Python CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-python/ for more details
#
version: 3.6

version: 2.1
jobs:
build:
docker:
# specify the version you desire here
# use `-browsers` prefix for selenium tests, e.g. `3.6.1-browsers`
- image: circleci/python:3.6.1
- image: circleci/node:14.17.3
# - image: mongo:4.2.1

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
Expand All @@ -20,43 +18,24 @@ jobs:
steps:
- checkout

- run:
name: checkout submodule
command: |
git submodule init
git submodule update
# - run:
# name: checkout submodule
# command: |
# git submodule init
# git submodule update
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "requirements.txt" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
key: dependency-cache-{{ checksum "yarn.lock" }}

- run:
name: install dependencies
command: |
python3 -m venv venv
. venv/bin/activate
pip install -r requirements.txt
name: install-dependencies
command: yarn install

- save_cache:
key: dependency-cache-{{ checksum "yarn.lock" }}
paths:
- ./venv
key: v1-dependencies-{{ checksum "requirements.txt" }}

# run tests!
# this example uses Django's built-in test-runner
# other common Python testing frameworks include pytest and nose
# https://pytest.org
# https://nose.readthedocs.io
- run:
name: run tests
command: |
. venv/bin/activate
python PillPosting.py test
- ./node_modules

- store_artifacts:
path: test-reports
destination: test-reports

- run:
name: build
command: yarn build:prod
10 changes: 10 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# don't ever lint node_modules
node_modules
# don't lint build output (make sure it's set to your correct build folder name)
dist
# don't lint nyc coverage output
coverage
# don't lint Lib
Libs
# dont' lint pm2 config file
ecosystem.config.js
37 changes: 37 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"env": {
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"indent": [
"warn",
4
],
"linebreak-style": [
"warn",
"unix"
],
"quotes": [
"warn",
"single"
],
"semi": [
"warn",
"always"
],
"@typescript-eslint/explicit-module-boundary-types": 0
}
}
187 changes: 101 additions & 86 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,109 +1,124 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Translations
*.mo
*.pot
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Django stuff:
*.log
local_settings.py
# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Flask stuff:
instance/
.webassets-cache
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# Scrapy stuff:
.scrapy
# TypeScript cache
*.tsbuildinfo

# Sphinx documentation
docs/_build/
# Optional npm cache directory
.npm

# PyBuilder
target/
# Optional eslint cache
.eslintcache

# Jupyter Notebook
.ipynb_checkpoints
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# pyenv
.python-version
# Optional REPL history
.node_repl_history

# celery beat schedule file
celerybeat-schedule
# Output of 'npm pack'
*.tgz

# SageMath parsed files
*.sage.py
# Yarn Integrity file
.yarn-integrity

# dotenv
# dotenv environment variables file
.env
.env.test

# virtualenv
.venv
venv/
ENV/
# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Spyder project settings
.spyderproject
.spyproject
# Serverless directories
.serverless/

# Rope project settings
.ropeproject
# FuseBox cache
.fusebox/

# mkdocs documentation
/site
# DynamoDB Local files
.dynamodb/

# mypy
.mypy_cache/
# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2

.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.pnp.*

#liveshare
.vsls.json

#config
config.json
post_classes.json
post_id.json
bak/

.vscode/
23 changes: 23 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "pill_posting",
"version": "1.0.0",
"main": "dist/index.js",
"repository": "https://github.com/jimchen5209/pill_posting.git",
"author": "jimchen5209 <jimchen5209@gmail.com>",
"license": "AGPL-3.0-only",
"scripts": {
"build": "tsc --pretty",
"build:prod": "tsc --pretty --sourceMap false"
},
"dependencies": {
"logging-ts": "https://github.com/jimchen5209/Logging-TS.git",
"mongodb": "^4.0.1",
"telegraf": "^4.4.1"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.28.5",
"@typescript-eslint/parser": "^4.28.5",
"eslint": "^7.31.0",
"typescript": "^4.3.5"
}
}
9 changes: 9 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export class Core {
constructor() {
// eslint-disable-next-line no-unused-expressions,@typescript-eslint/no-unused-expressions
// new Telegram();
}
}

// eslint-disable-next-line no-unused-expressions,@typescript-eslint/no-unused-expressions
new Core();

0 comments on commit cac16c1

Please sign in to comment.