Skip to content

Commit

Permalink
Merge pull request #77 from jgable/enhancement/trigen-scripts
Browse files Browse the repository at this point in the history
Use trigen-scripts
  • Loading branch information
dangreen authored Jun 8, 2019
2 parents cf9aeb5 + 4fcdac7 commit a16b1c0
Show file tree
Hide file tree
Showing 15 changed files with 3,602 additions and 2,858 deletions.
13 changes: 9 additions & 4 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@
"env": {
"test": {
"presets": [
["babel-preset-trigen", {
"targets": { "node": "current" },
"commonjs": true
}]
[
"babel-preset-trigen",
{
"targets": {
"node": "current"
},
"commonjs": true
}
]
]
}
}
Expand Down
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[package.json]
[{package.json,manifest.json,*.yml}]
indent_style = space
indent_size = 2

Expand Down
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,16 @@ node_modules
# Optional REPL history
.node_repl_history

# OS X stuff
# OS stuff
._*
.DS_Store

# Some caches
.eslintcache
.*cache

# Compiled dist
lib
package
build

.env
5 changes: 4 additions & 1 deletion .lintstagedrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"src/**/*.js": ["eslint --cache", "git add"]
"src/**/*.{js,jsx}": [
"trigen-scripts lint:js",
"git add"
]
}
13 changes: 8 additions & 5 deletions .size-limit
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
[{
path: "lib/index.js",
limit: "20 KB",
webpack: false
}]
[
{
"path": "lib/index.js",
"limit": "20 KB",
"webpack": false,
"running": false
}
]
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ branches:
except: /^v\d/
language: node_js
node_js:
- "node"
- "6"
- "lts/*"
- "8"
cache:
directories:
- node_modules
Expand Down
8 changes: 8 additions & 0 deletions .trigenscriptsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[
"@trigen/scripts-plugin-babel",
"@trigen/scripts-plugin-eslint",
"@trigen/scripts-plugin-jest",
"@trigen/scripts-plugin-rollup",
"@trigen/scripts-preset-lib",
"@trigen/scripts-plugin-size-limit"
]
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

<!--
DO NOT TOUCH. SAVE IT ON TOP.
## [semver] - date
### Added
- ...
### Changed
- ...
### Fixed
- ...
### Removed
- ...
-->

## [1.1.1] - 2019-01-23
### Fixed
- [#75](https://github.com/jgable/gulp-cache/issues/75)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014 - 2015 Jacob Gable
Copyright (c) 2014 - present Jacob Gable

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,4 +212,4 @@ const outputFiles = [

[The MIT License (MIT)](./LICENSE)

Copyright (c) 2014 - 2017 [Jacob Gable](http://jacobgable.com)
Copyright (c) 2014 - present [Jacob Gable](http://jacobgable.com)
8 changes: 6 additions & 2 deletions jest.config.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
{
"testEnvironment": "node",
"testRegex": "/test/.*\\.spec\\.js$",
"testRegex": "/test/.*\\.spec\\.(jsx?|tsx?)$",
"transform": {
"^.+\\.(jsx?|tsx?)$": "babel-jest"
},
"collectCoverage": true,
"collectCoverageFrom": [
"src/**/*.js",
"src/**/*.{js,jsx,ts,tsx}",
"!**/*.d.ts",
"!**/node_modules/**"
],
"coverageReporters": [
Expand Down
55 changes: 23 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/jgable/gulp-cache.git"
"url": "https://github.com/jgable/gulp-cache"
},
"bugs": {
"url": "https://github.com/jgable/gulp-cache/issues"
},
"main": "lib/index.js",
"engines": {
"node": ">=6.0.0"
"node": ">=8.0.0"
},
"scripts": {
"lint": "eslint --cache 'src/**/*.js' 'test/**/*.js'",
"jest": "NODE_ENV=test jest -c jest.config.json",
"checkSize": "size-limit",
"test": "npm run lint && npm run jest && npm run build && npm run checkSize",
"build": "rollup -c",
"watch": "rollup -c -w",
"cleanPublish": "npm run test && clean-publish",
"lint": "trigen-scripts lint",
"jest": "trigen-scripts jest",
"checkSize": "trigen-scripts checkSize",
"test": "trigen-scripts test",
"start": "trigen-scripts start",
"build": "trigen-scripts build",
"cleanPublish": "trigen-scripts cleanPublish",
"coverage": "cat ./coverage/lcov.info | coveralls"
},
"keywords": [
Expand All @@ -36,35 +36,26 @@
"cache"
],
"dependencies": {
"@babel/runtime": "^7.2.0",
"@babel/runtime": "^7.4.5",
"cache-swap": "^0.3.0",
"core-js": "3",
"object.pick": "^1.3.0",
"plugin-error": "^1.0.1",
"through2": "3.0.0",
"through2": "3.0.1",
"vinyl": "^2.2.0"
},
"devDependencies": {
"@babel/core": "^7.2.2",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^23.6.0",
"babel-preset-trigen": "^1.8.0",
"browserslist-config-trigen": "^1.1.0",
"clean-publish": "^1.1.0",
"coveralls": "^3.0.2",
"eslint": "^5.12.0",
"eslint-config-trigen": "^3.2.1",
"eslint-plugin-jest": "^22.1.2",
"husky": "^1.3.1",
"jest": "^23.6.0",
"lint-staged": "^8.1.0",
"rollup": "^1.0.2",
"rollup-plugin-babel": "^4.2.0",
"rollup-plugin-commonjs": "^9.2.0",
"rollup-plugin-eslint": "^5.0.0",
"rollup-plugin-json": "^3.1.0",
"should": "^13.2.3",
"sinon": "7.2.2",
"size-limit": "^0.21.1"
"@trigen/scripts": "2",
"@trigen/scripts-plugin-babel": "2",
"@trigen/scripts-plugin-eslint": "2",
"@trigen/scripts-plugin-jest": "2",
"@trigen/scripts-plugin-rollup": "2",
"@trigen/scripts-plugin-size-limit": "2",
"@trigen/scripts-preset-lib": "2",
"eslint-plugin-jest": "^22.6.4",
"rollup-plugin-eslint": "^6.0.0",
"rollup-plugin-json": "^4.0.0",
"sinon": "7.3.2"
},
"files": [
"lib"
Expand Down
25 changes: 9 additions & 16 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import {
external
} from '@trigen/scripts-plugin-rollup/helpers';
import { eslint } from 'rollup-plugin-eslint';
import json from 'rollup-plugin-json';
import commonjs from 'rollup-plugin-commonjs';
import babel from 'rollup-plugin-babel';
import json from 'rollup-plugin-json';
import { eslint } from 'rollup-plugin-eslint';
import pkg from './package.json';

const plugins = [
eslint({
exclude: ['**/*.json', 'node_modules/**'],
throwOnError: process.env.ROLLUP_WATCH != 'true'
throwOnError: true
}),
json({
preferConst: true
Expand All @@ -17,22 +20,12 @@ const plugins = [
runtimeHelpers: true
})
];
const dependencies = [].concat(
['crypto', 'stream', 'events', 'buffer', 'util'],
Object.keys(pkg.dependencies)
);

function external(id) {
return dependencies.some(_ =>
_ == id || id.indexOf(`${_}/`) == 0
);
}

export default {
input: 'src/index.js',
input: 'src/index.js',
plugins,
external,
output: {
external: external(pkg, true),
output: {
file: pkg.main,
format: 'cjs',
sourcemap: 'inline'
Expand Down
5 changes: 4 additions & 1 deletion test/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{
"plugins": ["jest"],
"plugins": [
"jest"
],
"env": {
"jest/globals": true
},
"rules": {
"no-magic-numbers": "off",
"max-nested-callbacks": "off"
}
}
Loading

0 comments on commit a16b1c0

Please sign in to comment.