Skip to content

Commit

Permalink
3.3.0 - Modernize codebase
Browse files Browse the repository at this point in the history
This release updates a few dependencies, deprecates a few old ones, and adds some extra niceties:

- Compile code with Typescript. Which allows for new code to be written in TS, as well as for modern JS to be transpiled into ES5.
Migrate to Jest. Which covers both browser and node based tests at once.
- Remove legacy linter.
- Update new-date in order to reduce overall bundle size
- Use modern export syntax, to allow for modern consumers of this library to use tree shaking.
  • Loading branch information
nettofarah committed Sep 23, 2020
1 parent 18ee996 commit a2963c2
Show file tree
Hide file tree
Showing 32 changed files with 9,469 additions and 5,983 deletions.
16 changes: 7 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
jobs:
test:
docker:
- image: circleci/node:8
- image: circleci/node:12
steps:
- checkout
- restore_cache:
Expand All @@ -17,11 +17,9 @@ jobs:
- run:
name: Run tests
command: make test
- store_artifacts:
path: coverage
- run:
name: Run coverage
command: yarn codecov
name: Compile
command: yarn build
publish:
docker:
- image: circleci/node:8
Expand All @@ -38,14 +36,14 @@ workflows:
test_and_publish:
jobs:
- test:
filters:
tags:
filters:
tags:
only: /.*/
- publish:
requires:
- test
filters:
tags:
tags:
only: /[0-9]+(\.[0-9]+)*(-.+)?/
branches:
ignore: /.*/
ignore: /.*/
8 changes: 8 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@

3.3.0 / 2020-09-23
==================

* Optimize bundle size
* Upgrade libraries
* Compile modern code with TypeScript

3.2.6 / 2019-05-21
==================

Expand Down
86 changes: 2 additions & 84 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,58 +1,3 @@
##
# Binaries
##

ESLINT := node_modules/.bin/eslint
ISTANBUL := node_modules/.bin/istanbul
KARMA := node_modules/.bin/karma
MOCHA := node_modules/.bin/mocha
_MOCHA := node_modules/.bin/_mocha

##
# Files
##

LIBS = $(shell find lib -type f -name "*.js")
TESTS = $(shell find test -type f -name "*.test.js")
SUPPORT = $(wildcard karma.conf*.js)
ALL_FILES = $(LIBS) $(TESTS) $(SUPPORT)

##
# Program options/flags
##

# A list of options to pass to Karma
# Overriding this overwrites all options specified in this file (e.g. BROWSERS)
KARMA_FLAGS ?=

# A list of Karma browser launchers to run
# http://karma-runner.github.io/0.13/config/browsers.html
BROWSERS ?=
ifdef BROWSERS
KARMA_FLAGS += --browsers $(BROWSERS)
endif

ifdef CI
KARMA_CONF ?= karma.conf.ci.js
else
KARMA_CONF ?= karma.conf.js
endif

# Mocha flags.
GREP ?= .
MOCHA_REPORTER ?= spec
MOCHA_FLAGS := \
--grep "$(GREP)" \
--reporter "$(MOCHA_REPORTER)" \
--ui bdd

# Istanbul flags.
COVERAGE_DIR ?= coverage
ISTANBUL_FLAGS := \
--root "./lib" \
--include-all-sources true \
--dir "$(COVERAGE_DIR)/Node $(shell node -v)"

##
# Tasks
##
Expand All @@ -61,37 +6,10 @@ ISTANBUL_FLAGS := \
install:
yarn install --frozen-lockfile

# Remove temporary files and build artifacts.
clean:
rm -rf *.log coverage
.PHONY: clean

# Remove temporary files, build artifacts, and vendor dependencies.
distclean: clean
rm -rf node_modules
.PHONY: distclean

# Lint JavaScript source files.
lint: install
@$(ESLINT) $(ALL_FILES)
.PHONY: lint

# Attempt to fix linting errors.
fmt: install
@$(ESLINT) --fix $(ALL_FILES)
.PHONY: fmt

# Run unit tests in node.
test-node: install
@NODE_ENV=test $(ISTANBUL) cover $(ISTANBUL_FLAGS) $(_MOCHA) -- $(MOCHA_FLAGS) $(TESTS)
.PHONY: test-node

# Run browser unit tests in a browser.
test-browser: install
@$(KARMA) start $(KARMA_FLAGS) $(KARMA_CONF)

# Default test target.
test: lint test-node test-browser
test:
yarn jest
.PHONY: test
.DEFAULT_GOAL = test

Expand Down
56 changes: 0 additions & 56 deletions bench.js

This file was deleted.

Loading

0 comments on commit a2963c2

Please sign in to comment.