Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#root = true

[*]
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 100
indent_size = 2

[*.md]
trim_trailing_whitespace = false
12 changes: 10 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
node_modules/
dist/
yarn.lock
*-lock.json
.nyc_output
.nyc_output
coverage
.DS_Store
*.log
.vscode
.idea
compiled
.awcache
.rpt2_cache
docs
18 changes: 18 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
language: node_js
cache:
directories:
- ~/.npm
notifications:
email: false
node_js:
- '10'
- '11'
- '8'
script:
- npm run test:prod && npm run build
after_success:
- npm run travis-deploy-once "npm run report-coverage"
- if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then npm run travis-deploy-once "npm run semantic-release"; fi
branches:
except:
- /^v\d+\.\d+\.\d+$/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<p align="center">
<a href="https://www.npmjs.org/package/format-string-by-pattern"><img src="https://img.shields.io/npm/v/format-string-by-pattern.svg?style=flat" alt="npm"></a>
<a href="https://david-dm.org/arthurdenner/format-string-by-pattern"><img src="https://david-dm.org/arthurdenner/format-string-by-pattern/status.svg" alt="dependencies Status"></a>
<a href="https://unpkg.com/format-string-by-pattern/dist/format-string-by-pattern.umd.js"><img src="http://img.badgesize.io/https://unpkg.com/format-string-by-pattern/dist/format-string-by-pattern.umd.js?compression=gzip" alt="gzip size"></a>
<a href="https://unpkg.com/format-string-by-pattern/dist/format-string-by-pattern.umd.js"><img src="https://img.badgesize.io/https://unpkg.com/format-string-by-pattern/dist/format-string-by-pattern.umd.js?compression=gzip" alt="gzip size"></a>
<a href="https://packagephobia.now.sh/result?p=format-string-by-pattern"><img src="https://packagephobia.now.sh/badge?p=format-string-by-pattern" alt="install size"></a>
</p>

Expand Down
18 changes: 18 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
transform: {
'.(ts|tsx)': 'ts-jest',
},
testEnvironment: 'node',
testRegex: '(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$',
moduleFileExtensions: ['ts', 'tsx', 'js'],
coveragePathIgnorePatterns: ['/node_modules/', '/test/'],
coverageThreshold: {
global: {
branches: 90,
functions: 95,
lines: 95,
statements: 95,
},
},
collectCoverageFrom: ['src/*.{js,ts}'],
};
88 changes: 67 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
{
"name": "format-string-by-pattern",
"version": "1.0.0",
"version": "0.0.0-semantically-released",
"description": "A module that formats a string based on a pattern",
"main": "dist/format-string-by-pattern.js",
"umd:main": "dist/format-string-by-pattern.umd.js",
"module": "dist/format-string-by-pattern.m.js",
"source": "src/format-string-by-pattern.js",
"main": "dist/format-string-by-pattern.umd.js",
"module": "dist/format-string-by-pattern.es5.js",
"typings": "dist/types/format-string-by-pattern.d.ts",
"author": {
"name": "Arthur Denner",
"email": "[email protected]"
},
"license": "MIT",
"scripts": {
"build": "npm run test && microbundle -o dist -i src",
"prepublishOnly": "git push && git push --tags",
"preversion": "npm run build",
"test": "xo && nyc ava",
"test:watch": "npm test -- --watch"
"lint": "tslint --project tsconfig.json -t codeFrame 'src/**/*.ts' 'test/**/*.ts'",
"prebuild": "rimraf dist docs",
"build": "tsc --module commonjs && rollup -c rollup.config.ts && npm run typedoc",
"start": "rollup -c rollup.config.ts -w",
"test": "jest --coverage",
"test:watch": "jest --coverage --watch",
"test:prod": "npm run lint && npm run test -- --no-cache",
"typedoc": "typedoc src",
"report-coverage": "cat ./coverage/lcov.info | codecov",
"commit": "git-cz",
"semantic-release": "semantic-release",
"semantic-release-prepare": "ts-node tools/semantic-release-prepare",
"precommit": "lint-staged",
"travis-deploy-once": "travis-deploy-once"
},
"files": [
"dist"
Expand All @@ -26,22 +34,60 @@
"string",
"pattern"
],
"xo": {
"prettier": true,
"space": true
},
"devDependencies": {
"ava": "1.0.0-beta.4",
"microbundle": "^0.4.4",
"nyc": "^11.7.1",
"xo": "^0.21.0"
},
"repository": {
"type": "git",
"url": "https://github.com/arthurdenner/format-string-by-pattern.git"
},
"bugs": {
"url": "https://github.com/arthurdenner/format-string-by-pattern/issues"
},
"homepage": "https://github.com/arthurdenner/format-string-by-pattern#readme"
"homepage": "https://github.com/arthurdenner/format-string-by-pattern#readme",
"engines": {
"node": ">=6.0.0"
},
"lint-staged": {
"{src,test}/**/*.ts": [
"prettier --write",
"git add"
]
},
"config": {
"commitizen": {
"path": "node_modules/cz-conventional-changelog"
}
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"devDependencies": {
"@commitlint/cli": "^7.1.2",
"@commitlint/config-conventional": "^7.1.2",
"@types/jest": "^23.3.2",
"@types/node": "^10.11.0",
"codecov.io": "^0.1.6",
"commitizen": "^3.0.0",
"cross-env": "^5.2.0",
"cz-conventional-changelog": "^2.1.0",
"husky": "^1.0.1",
"jest": "^23.6.0",
"jest-config": "^23.6.0",
"lint-staged": "^8.0.0",
"prettier": "^1.14.3",
"rimraf": "^2.6.2",
"rollup": "^0.67.0",
"rollup-plugin-sourcemaps": "^0.4.2",
"rollup-plugin-terser": "^4.0.4",
"rollup-plugin-typescript2": "^0.18.0",
"semantic-release": "^15.13.3",
"travis-deploy-once": "^5.0.9",
"ts-jest": "^23.10.2",
"ts-node": "^7.0.1",
"tslint": "^5.11.0",
"tslint-config-prettier": "^1.15.0",
"tslint-config-standard": "^8.0.1",
"typedoc": "^0.12.0",
"typescript": "^3.0.3"
}
}
17 changes: 17 additions & 0 deletions rollup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { terser } from 'rollup-plugin-terser';
import sourceMaps from 'rollup-plugin-sourcemaps';
import typescript from 'rollup-plugin-typescript2';

const pkg = require('./package.json');

export default {
input: 'src/index.ts',
output: [
{ file: pkg.main, name: 'format-string-by-pattern', format: 'umd', sourcemap: true },
{ file: pkg.module, format: 'es', sourcemap: true },
],
watch: {
include: 'src/**',
},
plugins: [typescript({ useTsconfigDeclarationDir: true }), sourceMaps(), terser()],
};
138 changes: 0 additions & 138 deletions src/index.test.js

This file was deleted.

Loading