-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ESLint, rollup powered build, Travis CI
- building cjs, esm and umd-min flavours - removing `dist` from git repo - updating example - fine tuning `.npmignore` to reduce tarball size
- Loading branch information
Showing
16 changed files
with
1,933 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** @type {import('eslint').Linter.Config} */ | ||
const config = { | ||
extends: 'semistandard', | ||
rules: { | ||
'prefer-const': 'error', | ||
'space-before-function-paren': ['error', { | ||
anonymous: 'always', | ||
named: 'never' | ||
}] | ||
}, | ||
env: { | ||
browser: true | ||
} | ||
}; | ||
|
||
module.exports = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,6 @@ yarn-debug.log* | |
yarn-error.log* | ||
node_modules/ | ||
.npm | ||
|
||
# Build artifacts | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
.editorconfig | ||
.travis.yml | ||
.eslint* | ||
*.config.js | ||
index.test-d.ts | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
language: node_js | ||
node_js: | ||
- '8' | ||
- '10' | ||
- lts/* | ||
- node | ||
|
||
script: | ||
- yarn run lint | ||
- yarn test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
presets: ['@babel/preset-env'] | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
declare function isIncognito(): Promise<boolean>; | ||
export = isIncognito; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { expectType } from 'tsd'; | ||
import isIncognito from '.'; | ||
|
||
expectType<boolean>(await isIncognito()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
'use strict'; | ||
|
||
const babel = require('rollup-plugin-babel'); | ||
const { builtinModules } = require('module'); | ||
const commonjs = require('rollup-plugin-commonjs'); | ||
const path = require('path'); | ||
const pkg = require('./package.json'); | ||
const resolve = require('rollup-plugin-node-resolve'); | ||
const { terser } = require('rollup-plugin-terser'); | ||
|
||
/** @type {import('rollup').RollupOptions} */ | ||
const baseConfig = { | ||
input: './index.js', | ||
external: Object.keys(pkg.dependencies).concat(builtinModules), | ||
plugins: [ | ||
resolve(), | ||
commonjs(), | ||
babel({ | ||
exclude: ['node_modules/**'] | ||
}) | ||
] | ||
}; | ||
|
||
/** @type {Array<import('rollup').RollupOptions>} */ | ||
const config = [{ | ||
...baseConfig, | ||
output: { | ||
format: 'esm', | ||
file: path.join(__dirname, './dist/isIncognito.esm.js') | ||
} | ||
}, { | ||
...baseConfig, | ||
output: { | ||
format: 'cjs', | ||
file: path.join(__dirname, './dist/isIncognito.js') | ||
} | ||
}, { | ||
...baseConfig, | ||
output: { | ||
format: 'umd', | ||
name: 'isIncognito', | ||
file: path.join(__dirname, './dist/isIncognito.umd.min.js') | ||
}, | ||
external: [], | ||
plugins: baseConfig.plugins.concat(terser()) | ||
}]; | ||
|
||
module.exports = config; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.