Skip to content

Commit

Permalink
🔀 Merge branch 'release/3.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Pustur committed Apr 2, 2021
2 parents fad6205 + 5bd8d95 commit 402acfe
Show file tree
Hide file tree
Showing 34 changed files with 900 additions and 10,600 deletions.
31 changes: 0 additions & 31 deletions .circleci/config.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
dist/

*.d.ts
15 changes: 14 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
{
"extends": ["airbnb-base", "plugin:prettier/recommended"],
"extends": [
"airbnb-base",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"env": {
"jest": true
},
"settings": {
"import/resolver": {
"node": {
"extensions": [".js", ".ts"]
}
}
},
"rules": {
"import/extensions": "off",
"import/prefer-default-export": "off",
"no-param-reassign": ["error", { "props": false }]
}
}
46 changes: 46 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Continuous Integration

on:
push:
branches:
- master
- develop

pull_request:
branches:
- develop

jobs:
ci:
name: Continuous Integration
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 14

- name: Cache npm dependencies
uses: actions/cache@v2
with:
path: '~/.npm'
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci

- name: Lint
run: npm run lint

- name: Test
run: npm run test:coverage

- name: Upload coverage
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/
dist/
coverage/
types/
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
6 changes: 6 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run format:staged
npm run lint
npm t
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
coverage/
dist/
types/

package-lock.json
3 changes: 1 addition & 2 deletions .renovaterc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"extends": ["config:js-lib", "schedule:monthly"],
"baseBranches": ["develop"],
"circleci": { "enabled": false }
"baseBranches": ["develop"]
}
17 changes: 13 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.1.1] - 2021-04-02

### Changed

- Complete rewrite of the package in TypeScript
- Migrated from CircleCI to GitHub Actions
- Upgraded dev dependencies

## [3.1.0] - 2021-01-12

### Added
Expand All @@ -13,7 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Improved typescript types
- Improved TypeScript types
- Updated readme with info on new `parseAttachments` option
- Upgraded dev dependencies

Expand All @@ -39,7 +47,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Codecov badge in readme (collect coverage info in Circleci)
- Codecov badge in readme (collect coverage info in CircleCI)

### Changed

Expand Down Expand Up @@ -83,7 +91,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Typescript types definition file
- TypeScript types definition file

### Changed

Expand Down Expand Up @@ -180,7 +188,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Circleci for continuous integration
- CircleCI for continuous integration
- Install instructions in readme

### Fixed
Expand All @@ -191,6 +199,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Initial release

[3.1.1]: https://github.com/Pustur/whatsapp-chat-parser/compare/3.1.0...3.1.1
[3.1.0]: https://github.com/Pustur/whatsapp-chat-parser/compare/3.0.2...3.1.0
[3.0.2]: https://github.com/Pustur/whatsapp-chat-parser/compare/3.0.1...3.0.2
[3.0.1]: https://github.com/Pustur/whatsapp-chat-parser/compare/3.0.0...3.0.1
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# WhatsApp Chat Parser

[![CircleCI](https://circleci.com/gh/Pustur/whatsapp-chat-parser/tree/master.svg?style=svg)](https://circleci.com/gh/Pustur/whatsapp-chat-parser/tree/master)
[![Continuous Integration](https://github.com/Pustur/whatsapp-chat-parser/actions/workflows/ci.yml/badge.svg)](https://github.com/Pustur/whatsapp-chat-parser/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/Pustur/whatsapp-chat-parser/branch/master/graph/badge.svg)](https://codecov.io/gh/Pustur/whatsapp-chat-parser)
[![npm version](https://img.shields.io/npm/v/whatsapp-chat-parser.svg)](https://www.npmjs.com/package/whatsapp-chat-parser)
[![minified size](https://img.shields.io/bundlephobia/min/whatsapp-chat-parser.svg)](https://bundlephobia.com/result?p=whatsapp-chat-parser)
Expand Down Expand Up @@ -64,7 +64,7 @@ You can also use the [jsDelivr CDN](https://www.jsdelivr.com/package/npm/whatsap
```html
<script src="https://cdn.jsdelivr.net/npm/whatsapp-chat-parser/dist/whatsapp-chat-parser.min.js"></script>
<!-- Or use a specific version -->
<script src="https://cdn.jsdelivr.net/npm/whatsapp-chat-parser@3.1.0/dist/whatsapp-chat-parser.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/whatsapp-chat-parser@3.1.1/dist/whatsapp-chat-parser.min.js"></script>
```

&nbsp;
Expand Down Expand Up @@ -134,7 +134,7 @@ A configuration object, more details below
<!-- prettier-ignore-start -->
| Name | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| daysFirst | `Boolean` | `undefined` | Specify if the dates in your log file start with a day (`true`) or a month (`false`). Manually specifying this may improve performance. By default the program will try to infer this information using 3 different methods (look at [`date.js`](src/date.js) for the implementation), if all fails it defaults to interpret the first digit as the day. |
| daysFirst | `Boolean` | `undefined` | Specify if the dates in your log file start with a day (`true`) or a month (`false`). Manually specifying this may improve performance. By default the program will try to infer this information using 3 different methods (look at [`date.ts`](src/date.ts) for the implementation), if all fails it defaults to days first. |
| parseAttachments | `Boolean` | `false` | Specify if attachments should be parsed. If set to `true`, messages with attachments will include an `attachment` property with information about the attachment. |
<!-- prettier-ignore-end -->

Expand All @@ -145,6 +145,7 @@ A configuration object, more details below

## Technologies used

- Language: [TypeScript](https://www.typescriptlang.org/)
- Testing: [Jest](https://jestjs.io/)
- Code formatting: [Prettier](https://prettier.io/)
- Linting: [ESLint](https://eslint.org/) (with [Airbnb rules](https://www.npmjs.com/package/eslint-config-airbnb-base))
Expand All @@ -157,7 +158,7 @@ A configuration object, more details below

### Browser

This package is written in ES6.
This package is written in TypeScript with target compilation to ES6.
It should work in all relevant browsers from ~2017 onwards.

## Changelog
Expand Down
1 change: 1 addition & 0 deletions global-setup.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable import/no-extraneous-dependencies */
const setTZ = require('set-tz');

Expand Down
3 changes: 2 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const config = {
preset: 'ts-jest',
testEnvironment: 'node',
collectCoverageFrom: ['src/*.js'],
collectCoverageFrom: ['src/*.ts'],
globalSetup: './global-setup.js',
};

Expand Down
Loading

0 comments on commit 402acfe

Please sign in to comment.