Skip to content

Commit

Permalink
Major refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Pingid committed Oct 15, 2021
1 parent 28401c9 commit db6ff3f
Show file tree
Hide file tree
Showing 23 changed files with 1,895 additions and 3,038 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/create-release.yml
@@ -0,0 +1,37 @@
name: Create release

on:
push:
branches:
- master

jobs:
create_release:
name: Create release
runs-on: ubuntu-20.04
steps:
- name: checkout
uses: actions/checkout@v2
- name: setup node version
uses: actions/setup-node@v2
with:
cache: 'yarn'
node-version: '16'
- name: install dependencies
run: yarn install
- name: transpile typescript
run: yarn build
- name: run tests
run: yarn test
- name: Get latest release tag
id: latest_release_tag
uses: InsonusK/get-latest-release@v1.0.1
with:
myToken: ${{ github.token }}
view_top: 1
- name: Get current version
id: current_version
run: echo "::set-output name=version::$(node -e 'console.log(require(\"./package.json\").version)')"
- name: Create a new release
uses: softprops/action-gh-release@v1
if: ${{ steps.latest_release_tag.outputs.tag_name != steps.current_version.outputs.version }}
25 changes: 25 additions & 0 deletions .github/workflows/plublish.yml
@@ -0,0 +1,25 @@
name: Publish package

on:
release:
types: [created]

jobs:
npm:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: setup node version
uses: actions/setup-node@v2
with:
cache: 'yarn'
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- name: install dependencies
run: yarn install
- name: transpile typescript
run: yarn build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
18 changes: 0 additions & 18 deletions .github/workflows/publish-npm.yml

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/test.yml
@@ -0,0 +1,25 @@
name: Test

on:
push:
branches:
- '*'
- '!master'

jobs:
run_tests:
runs-on: ubuntu-20.04
steps:
- name: checkout
uses: actions/checkout@v2
- name: setup node version
uses: actions/setup-node@v2
with:
cache: 'yarn'
node-version: '16'
- name: install dependencies
run: yarn install
- name: transpile typescript
run: yarn build
- name: run tests
run: yarn test
1 change: 1 addition & 0 deletions .gitignore
@@ -1,3 +1,4 @@
lib
es6
node_modules
tsconfig.tsbuildinfo
7 changes: 4 additions & 3 deletions .npmignore
@@ -1,5 +1,6 @@
.github
node_modules
src
.vscode
tsconfig.tsbuildinfo
tsconfig.json
tsconfig.json
node_modules
src
75 changes: 54 additions & 21 deletions package.json
@@ -1,25 +1,65 @@
{
"name": "shears",
"version": "0.0.0-alpha.7.1",
"version": "0.0.0-alpha.8",
"main": "lib/index.js",
"license": "Public",
"module": "es6/index.js",
"typings": "lib/index.d.ts",
"license": "MIT",
"author": "Dan Beaven <dm.beaven@gmail.com>",
"description": "Functional web scraping in typescript",
"sideEffects": false,
"repository": {
"type": "git",
"url": "https://github.com/Pingid/shears.git"
},
"bugs": {
"url": "https://github.com/Pingid/shears/issues"
},
"homepage": "https://github.com/Pingid/shears",
"tags": [
"functional-programming",
"typescript",
"selector",
"crawler",
"scraper",
"parser",
"fp-ts",
"html"
],
"keywords": [
"functional-programming",
"typescript",
"selector",
"crawler",
"scraper",
"parser",
"fp-ts",
"html"
],
"scripts": {
"build": "tsc",
"watch": "yarn build --watch",
"build": "yarn build:es5 && yarn build:es6",
"build:es5": "tsc",
"build:es6": "tsc -p ./tsconfig-es6.json",
"test": "jest",
"prettier": "prettier --write \"src/**/*.{js,jsx,ts,tsx}\"",
"clean": "rm tsconfig.tsbuildinfo || true && rm -R ./lib || true",
"postversion": "git push --tags",
"postinstall": "yarn build"
"clean": "tsc --build --clean",
"format": "prettier --write ./src/*.ts",
"postversion": "git push --tags"
},
"dependencies": {
"css-select": "^4.1.3",
"domhandler": "^4.2.2",
"domutils": "^2.8.0",
"fp-ts": "^2.11.4",
"htmlparser2": "^7.1.2"
},
"devDependencies": {
"@types/domhandler": "^2.4.1",
"@types/jest": "^26.0.9",
"@types/node": "^14.6.0",
"jest": "^26.1.0",
"ts-jest": "^26.3.0",
"typescript": "^4.1.3"
"@types/domhandler": "^2.4.2",
"@types/jest": "^27.0.2",
"@types/node": "^16.11.0",
"jest": "^27.2.5",
"prettier": "^2.4.1",
"ts-jest": "^27.0.6",
"typescript": "^4.4.4"
},
"jest": {
"preset": "ts-jest",
Expand All @@ -30,12 +70,5 @@
"singleQuote": true,
"printWidth": 120,
"trailingComma": "none"
},
"dependencies": {
"css-select": "^3.1.2",
"domhandler": "^4.0.0",
"domutils": "^2.4.4",
"fp-ts": "^2.9.5",
"htmlparser2": "^6.0.0"
}
}
115 changes: 0 additions & 115 deletions src/crawler.test.ts

This file was deleted.

0 comments on commit db6ff3f

Please sign in to comment.