Skip to content

Commit 62358dd

Browse files
author
craig
committed
1.0.0 / 2022-03-17
================== * Initial npm publish - @craigparra
1 parent be735ee commit 62358dd

File tree

14 files changed

+17499
-2
lines changed

14 files changed

+17499
-2
lines changed

.eslintrc.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"commonjs": true,
5+
"es2021": true,
6+
"mocha" : true
7+
},
8+
"plugins": [
9+
"cucumber"
10+
],
11+
"extends": [
12+
"airbnb-base"
13+
],
14+
"parserOptions": {
15+
"ecmaVersion": 12,
16+
"requireConfigFile": false
17+
},
18+
"parser": "@babel/eslint-parser",
19+
"rules": {
20+
"no-plusplus": ["error", { "allowForLoopAfterthoughts": true }],
21+
"cucumber/async-then": ["error", { "All": false, "words": [ ] }],
22+
"cucumber/expression-type": 2,
23+
"cucumber/no-restricted-tags": [2, "wip", "broken", "foo"],
24+
"cucumber/no-arrow-functions": 2,
25+
"import/no-extraneous-dependencies": ["error", { "devDependencies": ["test/**/*.js", "features/**/*.js"] }]
26+
}
27+
}

.github/workflows/node.js.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: Node.js CI
5+
6+
on:
7+
workflow_dispatch:
8+
push:
9+
branches: [ main ]
10+
pull_request:
11+
branches: [ main ]
12+
13+
jobs:
14+
build:
15+
16+
runs-on: ubuntu-latest
17+
18+
strategy:
19+
matrix:
20+
node-version: [16.x]
21+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
22+
23+
steps:
24+
- uses: actions/checkout@v2
25+
- name: Use Node.js ${{ matrix.node-version }}
26+
uses: actions/setup-node@v2
27+
with:
28+
node-version: ${{ matrix.node-version }}
29+
cache: 'npm'
30+
- run: npm ci
31+
- run: npm run lint
32+
- run: npm run build
33+

.github/workflows/npm-publish.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3+
4+
name: Node.js Package
5+
6+
on:
7+
workflow_dispatch:
8+
release:
9+
types: [created]
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- uses: actions/setup-node@v2
17+
with:
18+
node-version: 16
19+
- run: npm ci
20+
- run: npm run lint
21+
22+
publish-npm:
23+
needs: build
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v2
27+
- uses: actions/setup-node@v2
28+
with:
29+
node-version: 16
30+
registry-url: https://registry.npmjs.org/
31+
- run: npm ci
32+
- run: npm run build
33+
- run: npm publish --access public
34+
env:
35+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

.gitignore

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
6+
# Diagnostic reports (https://nodejs.org/api/report.html)
7+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
8+
9+
# Runtime data
10+
pids
11+
*.pid
12+
*.seed
13+
*.pid.lock
14+
15+
# Coverage directory used by tools like istanbul
16+
coverage
17+
*.lcov
18+
19+
# nyc test coverage
20+
.nyc_output
21+
22+
# node-waf configuration
23+
.lock-wscript
24+
25+
# Compiled binary addons (https://nodejs.org/api/addons.html)
26+
build/Release
27+
28+
# Dependency directories
29+
node_modules/
30+
31+
# Optional npm cache directory
32+
.npm
33+
34+
# Optional eslint cache
35+
.eslintcache
36+
37+
# Microbundle cache
38+
.rpt2_cache/
39+
.rts2_cache_cjs/
40+
.rts2_cache_es/
41+
.rts2_cache_umd/
42+
43+
# Optional REPL history
44+
.node_repl_history
45+
46+
# Output of 'npm pack'
47+
*.tgz
48+
/.idea/
49+
50+
test-treeshake/*-umd.js
51+
amd
52+
cjs
53+
/alt-javascript-logger-node-*-pre*

.npmignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/.nyc_output
2+
/config
3+
/coverage
4+
/features
5+
/test
6+
/node_modules
7+
.*

.nycrc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"cache": false,
3+
"check-coverage": true,
4+
"lines": 95,
5+
"statements": 95,
6+
"functions": 90,
7+
"branches": 90,
8+
"reporter": [
9+
"html",
10+
"text",
11+
"text-summary"
12+
],
13+
"all": true,
14+
"instrument": true,
15+
"exclude": [
16+
"dist/**/*.js",
17+
"coverage/**/*"
18+
]
19+
}

.webpack.config.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const path = require('path');
2+
3+
module.exports = {
4+
mode: 'production',
5+
entry: {
6+
index: './index.js'
7+
},
8+
devtool: 'inline-source-map',
9+
plugins: [
10+
],
11+
devServer: {
12+
allowedHosts: ['all'],
13+
port: 8080,
14+
},
15+
output: {
16+
filename: 'alt-javascript-es-iife.js',
17+
path: path.resolve(__dirname, 'dist'),
18+
assetModuleFilename: '[name][ext]',
19+
clean: true,
20+
},
21+
};

History.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
1.0.0 / 2022-03-17
2+
==================
3+
4+
* Initial npm publish - @craigparra

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021,2022 Craig Parravicini
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,37 @@
1-
# es6
2-
Fearture detection utilities for ECMAScript 6
1+
Simple utility to ease the use of browser cookies.
2+
===================================
3+
4+
[![NPM](https://nodei.co/npm/@alt-javascript/lang.svg?downloads=true&downloadRank=true)](https://nodei.co/npm/@alt-javascript/lang/)
5+
<br/>
6+
![Language Badge](https://img.shields.io/github/languages/top/alt-javascript/lang)
7+
![Package Badge](https://img.shields.io/npm/v/@alt-javascript/lang) <br/>
8+
[release notes](https://github.com/alt-javascript/lang/blob/main/History.md)
9+
10+
<a name="intro">Introduction</a>
11+
--------------------------------
12+
Language feature detection utilities for ECMAScript 6 and beyond, currently bundling the [es-feature-detection](https://www.npmjs.com/package/es-feature-detection) and
13+
[feature-detect-es6](https://www.npmjs.com/package/feature-detect-es6) npm packages.
14+
15+
<a name="usage">Usage</a>
16+
-------------------------
17+
18+
The module can be used directly in the browser, as an IIFE (Immediately Invoked Function Expression),
19+
using the global variable `lang` as follows:
20+
21+
```html
22+
<script src="https://cdn.jsdelivr.net/npm/@alt-javascript/lang/dist/alt-javascript-lang-iife.js"></script>
23+
24+
<script>
25+
if (!lang.allOk(lang.es2020)){
26+
console.error('We\'re sorry but the site requires JavaScript 11 (ECMAScript 2020). Please upgrade your browser to continue.')
27+
document.getElementById("require_es2020").style.display = "block"
28+
}
29+
</script>
30+
```
31+
32+
<a name="license">License</a>
33+
-----------------------------
34+
35+
May be freely distributed under the [MIT license](https://github.com/alt-javascript/lang/main/LICENSE).
36+
37+
Copyright (c) 2021-2022 Craig Parravicini

0 commit comments

Comments
 (0)