Skip to content

Commit

Permalink
🤖 chore: Setup repository.
Browse files Browse the repository at this point in the history
make-github-pseudonymous-again committed Apr 27, 2021

Verified

This commit was signed with the committer’s verified signature.
0 parents commit 5f1d7a0
Showing 23 changed files with 1,321 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
exclude_patterns:
- doc/**
- dist/**
- test/**
3 changes: 3 additions & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['@js-library']
};
55 changes: 55 additions & 0 deletions .esdoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"source": "./src",
"destination": "./gh-pages",
"debug": false,
"index": "./README.md",
"package": "./package.json",
"plugins": [
{
"name": "esdoc-standard-plugin",
"option": {
"accessor": {
"access": [
"public",
"protected",
"private"
],
"autoPrivate": true
},
"brand": {
"title": "@iterable-iterator/list"
},
"test": {
"type": "ava",
"source": "./test/src"
},
"manual": {
"files": [
"./doc/manual/overview.md",
"./doc/manual/installation.md",
"./doc/manual/usage.md",
"./doc/manual/example.md"
]
}
}
},
{
"name": "esdoc-inject-style-plugin",
"option": {
"enable": true,
"styles": [
"./doc/css/style.css"
]
}
},
{
"name": "esdoc-inject-script-plugin",
"option": {
"enable": true,
"scripts": [
"./doc/scripts/header.js"
]
}
}
]
}
73 changes: 73 additions & 0 deletions .fixpackrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"files": [
"package.json"
],
"quiet": false,
"required": [
"name",
"version"
],
"requiredOnPrivate": [],
"sortToTop": [
"name",
"description",
"version",
"license",
"author",
"homepage",
"repository",
"bugs",
"keywords",
"sideEffects",
"type",
"source",
"main",
"module",
"esmodule",
"umd:main",
"unpkg",
"exports",
"files",
"scripts",
"bundledDependencies",
"dependencies",
"optionalDependencies",
"peerDependencies",
"peerDependenciesMeta",
"devDependencies"
],
"sortedSubItems": [
"keywords",
"exports",
"files",
"scripts",
"bundledDependencies",
"dependencies",
"optionalDependencies",
"peerDependencies",
"peerDependenciesMeta",
"devDependencies"
],
"warn": [
"description",
"author",
"repository",
"keywords",
"main",
"bugs",
"homepage",
"license",
"files"
],
"warnOnPrivate": [
"name",
"version",
"description",
"main"
],
"dryRun": false,
"wipe": false,
"indent": null,
"newLine": null,
"finalNewLine": null
}
25 changes: 25 additions & 0 deletions .github/workflows/ci:test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: ci:test
on:
- push
- pull_request
jobs:
test:
name: Continuous integration (tests)
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2

- name: Install 🔧
uses: bahmutov/npm-install@v1
with:
install-command: yarn --frozen-lockfile --ignore-scripts
useRollingCache: true

- name: Test 🔬
run: yarn ci:test

- name: Publish coverage report 📃
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
23 changes: 23 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Build and Deploy GitHub pages
on:
release:
types:
- created
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/[email protected]

- name: Install 🔧
run: npm install

- name: Build 🏗️
run: npm run build-gh-pages

- name: Deploy 🚀
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: gh-pages
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# lock file
!yarn.lock

# Generated files
/dist

# Dependency directory
node_modules
jspm_packages

# Coverage directory used by nyc
/coverage
/.nyc_output

# Documentation
/gh-pages
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
52 changes: 52 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

function ask () {

# This is a general-purpose function to ask Yes/No questions in Bash, either
# with or without a default answer. It keeps repeating the question until it
# gets a valid answer.

# http://djm.me/ask

if [ "${2:-}" = "Y" ]; then
prompt="Y/n"
default=Y
elif [ "${2:-}" = "N" ]; then
prompt="y/N"
default=N
else
prompt="y/n"
default=
fi

while true; do

# Ask the question (not using "read -p" as it uses stderr not stdout)
echo -n "$1 [$prompt] "

# Read the answer (use /dev/tty in case stdin is redirected from somewhere else)
read REPLY </dev/tty

# Default?
if [ -z "$REPLY" ]; then
REPLY=$default
fi

# Check if the reply is valid
case "$REPLY" in
Y*|y*) return 0 ;;
N*|n*) return 1 ;;
esac

done

}

while ! npm run commit-msg -- "$1" ; do
if [ -t 1 ] && ask 'There was an error. Do you wish to amend your commit message?' Y ; then
${GIT_EDITOR:-$EDITOR} "$1" < /dev/tty
else
exit 1
fi
done
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run precommit
661 changes: 661 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
:oden: [@iterable-iterator/list](https://iterable-iterator.github.io/list)
==

Iterable to Array for JavaScript.
See [docs](https://iterable-iterator.github.io/list/index.html).

> :building_construction: Caveat emptor! This is work in progress. Code may be
> working. Documentation may be present. Coherence may be. Maybe.
> :warning: Depending on your environment, the code may require
> `regeneratorRuntime` to be defined, for instance by importing
> [regenerator-runtime/runtime](https://www.npmjs.com/package/regenerator-runtime).
[![License](https://img.shields.io/github/license/iterable-iterator/list.svg)](https://raw.githubusercontent.com/iterable-iterator/list/main/LICENSE)
[![Version](https://img.shields.io/npm/v/@iterable-iterator/list.svg)](https://www.npmjs.org/package/@iterable-iterator/list)
[![Tests](https://img.shields.io/github/workflow/status/iterable-iterator/list/ci:test?event=push&label=tests)](https://github.com/iterable-iterator/list/actions/workflows/ci:test.yml?query=branch:main)
[![Dependencies](https://img.shields.io/david/iterable-iterator/list.svg)](https://david-dm.org/iterable-iterator/list)
[![Dev dependencies](https://img.shields.io/david/dev/iterable-iterator/list.svg)](https://david-dm.org/iterable-iterator/list?type=dev)
[![GitHub issues](https://img.shields.io/github/issues/iterable-iterator/list.svg)](https://github.com/iterable-iterator/list/issues)
[![Downloads](https://img.shields.io/npm/dm/@iterable-iterator/list.svg)](https://www.npmjs.org/package/@iterable-iterator/list)

[![Code issues](https://img.shields.io/codeclimate/issues/iterable-iterator/list.svg)](https://codeclimate.com/github/iterable-iterator/list/issues)
[![Code maintainability](https://img.shields.io/codeclimate/maintainability/iterable-iterator/list.svg)](https://codeclimate.com/github/iterable-iterator/list/trends/churn)
[![Code coverage (cov)](https://img.shields.io/codecov/c/gh/iterable-iterator/list/main.svg)](https://codecov.io/gh/iterable-iterator/list)
[![Code technical debt](https://img.shields.io/codeclimate/tech-debt/iterable-iterator/list.svg)](https://codeclimate.com/github/iterable-iterator/list/trends/technical_debt)
[![Documentation](https://iterable-iterator.github.io/list/badge.svg)](https://iterable-iterator.github.io/list/source.html)
[![Package size](https://img.shields.io/bundlephobia/minzip/@iterable-iterator/list)](https://bundlephobia.com/result?p=@iterable-iterator/list)
52 changes: 52 additions & 0 deletions doc/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
h1,
h2,
.navigation,
.layout-container > header,
footer
{
border: none;
}

.project-name {
color: #FC913A;
font-weight: bold;
}

.layout-container > header > a.repo-url-github {
font-size: inherit;
display: inline;
background: none;
vertical-align: inherit;
}

.search-box img {
display: none;
}

.search-box::before{
content: "search";
}

.search-input-edge {
height: 0px;
}

.search-result {
width: 300px;
margin-left: 42px;
box-shadow: 1px 1px 13px rgba(0,0,0,0.2);
}

.search-input {
visibility: visible;
}

.search-result li.search-separator {
text-transform: capitalize;
background-color: #ccc;
}

span[data-ice="signature"] > span {
/*font-weight: bold;*/
font-style: italic;
}
3 changes: 3 additions & 0 deletions doc/manual/example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Examples

> More examples in [the test files](https://github.com/iterable-iterator/list/tree/main/test/src).
22 changes: 22 additions & 0 deletions doc/manual/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Installation

Can be managed using
[yarn](https://yarnpkg.com/en/docs),
[npm](https://docs.npmjs.com),
or [jspm](https://jspm.org/docs).


### yarn
```terminal
yarn add @iterable-iterator/list
```

### npm
```terminal
npm install @iterable-iterator/list --save
```

### jspm
```terminal
jspm install npm:@iterable-iterator/list
```
1 change: 1 addition & 0 deletions doc/manual/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Overview
19 changes: 19 additions & 0 deletions doc/manual/usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Usage

> :warning: Depending on your environment, the code may require
> `regeneratorRuntime` to be defined, for instance by importing
> [regenerator-runtime/runtime](https://www.npmjs.com/package/regenerator-runtime).
First, require the polyfill at the entry point of your application
```js
require( 'regenerator-runtime/runtime' ) ;
// or
import 'regenerator-runtime/runtime.js' ;
```

Then, import the library where needed
```js
const list = require( '@iterable-iterator/list' ) ;
// or
import * as list from '@iterable-iterator/list' ;
```
30 changes: 30 additions & 0 deletions doc/scripts/header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const domReady = function (callback) {
const state = document.readyState;
if (state === 'interactive' || state === 'complete') {
callback();
} else {
document.addEventListener('DOMContentLoaded', callback);
}
};

domReady(() => {
const projectname = document.createElement('a');
projectname.classList.add('project-name');
projectname.text = 'iterable-iterator/list';
projectname.href = './index.html';

const header = document.querySelector('header');
header.insertBefore(projectname, header.firstChild);

const testlink = document.querySelector('header > a[data-ice="testLink"]');
testlink.href = 'https://coveralls.io/github/iterable-iterator/list';
testlink.target = '_BLANK';

const searchBox = document.querySelector('.search-box');
const input = document.querySelector('.search-input');

// Active search box when focus on searchBox.
input.addEventListener('focus', () => {
searchBox.classList.add('active');
});
});
221 changes: 221 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
{
"name": "@iterable-iterator/list",
"description": "Iterable to Array for JavaScript",
"version": "0.0.0",
"license": "AGPL-3.0",
"author": "make-github-pseudonymous-again",
"homepage": "https://iterable-iterator.github.io/list",
"repository": {
"url": "https://github.com/iterable-iterator/list",
"type": "git"
},
"bugs": {
"url": "https://github.com/iterable-iterator/list/issues"
},
"keywords": [
"array",
"iter",
"iterable",
"iterator",
"list",
"toArray"
],
"sideEffects": false,
"source": "src/index.js",
"main": "dist/index.js",
"module": "dist/index.module.js",
"esmodule": "dist/index.modern.js",
"umd:main": "dist/index.umd.js",
"unpkg": "dist/index.umd.js",
"exports": {
".": {
"browser": "./dist/index.module.js",
"umd": "./dist/index.umd.js",
"require": "./dist/index.js",
"default": "./dist/index.modern.js"
}
},
"files": [
"dist"
],
"scripts": {
"build": "NODE_ENV=production microbundle",
"build-docs": "esdoc",
"build-gh-pages": "npm run build-docs",
"ci:test": "npm run lint-config && npm run lint && npm run cover",
"commit-msg": "commitlint --edit",
"cover": "NODE_ENV=cover c8 --all --src src --reporter lcov --reporter text-summary --reporter text npm test",
"debug": "NODE_ENV=debug npm run test -- -st --fail-fast",
"dev": "npm run lint-config-and-fix && npm run lint-and-fix && npm run cover -- -- -st --fail-fast",
"install-hooks": "husky install",
"lint": "xo",
"lint-and-fix": "npm run lint -- --fix",
"lint-config": "fixpack --dryRun",
"lint-config-and-fix": "fixpack || fixpack",
"postinstall": "npm run install-hooks",
"postpublish": "pinst --enable",
"precommit": "lint-staged",
"prepare": "npm run build",
"prepublishOnly": "pinst --disable",
"release": "np --message ':hatching_chick: release: Bumping to v%s.'",
"test": "ava"
},
"dependencies": {},
"devDependencies": {
"@babel/core": "7.13.15",
"@babel/preset-env": "7.13.15",
"@babel/register": "7.13.14",
"@commitlint/cli": "12.1.1",
"@js-library/commitlint-config": "0.0.4",
"ava": "3.15.0",
"babel-plugin-transform-remove-console": "6.9.4",
"babel-plugin-unassert": "3.0.1",
"babel-preset-power-assert": "3.0.0",
"c8": "7.7.1",
"coveralls": "3.1.0",
"esdoc": "1.1.0",
"esdoc-ecmascript-proposal-plugin": "1.0.0",
"esdoc-inject-script-plugin": "1.0.0",
"esdoc-inject-style-plugin": "1.0.0",
"esdoc-standard-plugin": "1.0.0",
"fixpack": "4.0.0",
"husky": "6.0.0",
"lint-staged": "10.5.4",
"microbundle": "0.13.0",
"np": "7.4.0",
"pinst": "2.1.6",
"power-assert": "1.6.1",
"regenerator-runtime": "0.13.7",
"xo": "0.38.2"
},
"ava": {
"files": [
"test/src/**/*"
],
"require": [
"regenerator-runtime/runtime",
"@babel/register"
],
"timeout": "1m"
},
"babel": {
"sourceMaps": true,
"presets": [
[
"@babel/preset-env",
{
"targets": "current node"
}
]
],
"plugins": [
[
"transform-remove-console",
{
"exclude": [
"log",
"error",
"warn"
]
}
]
],
"env": {
"debug": {
"presets": [
"babel-preset-power-assert"
],
"plugins": [
[
"transform-remove-console",
{
"exclude": [
"debug",
"log",
"error",
"warn"
]
}
]
]
},
"test": {
"presets": [
"babel-preset-power-assert"
]
},
"cover": {
"sourceMaps": "both",
"presets": [
"babel-preset-power-assert"
]
},
"development": {
"presets": [
[
"@babel/preset-env",
{
"targets": [
"defaults",
"maintained node versions"
]
}
],
"babel-preset-power-assert"
]
},
"production": {
"presets": [
[
"@babel/preset-env",
{
"targets": [
"defaults",
"maintained node versions"
]
}
]
],
"plugins": [
"babel-plugin-unassert"
]
}
}
},
"lint-staged": {
"*.js": [
"npm run lint-and-fix"
],
"package.json": [
"npm run lint-config-and-fix"
]
},
"prettier": {
"trailingComma": "all"
},
"xo": {
"prettier": true,
"plugins": [
"unicorn"
],
"rules": {
"unicorn/filename-case": [
"error",
{
"cases": {
"camelCase": true,
"pascalCase": true
}
}
]
},
"overrides": [
{
"files": [
"doc/**"
],
"env": "browser"
}
]
}
}
5 changes: 5 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": [
"github>make-github-pseudonymous-again/renovate-config-js-library"
]
}
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const answer = 42;
export default answer;
5 changes: 5 additions & 0 deletions test/src/api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import test from 'ava';

test('API', (t) => {
t.fail();
});
17 changes: 17 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"allowJs": true,
"emitDeclarationOnly": true,
"declaration": true,
"outDir": "types",
"checkJs": true,
"target": "es2020",
"module": "es2020",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true
},
"include": [
"src/**/*"
]
}

0 comments on commit 5f1d7a0

Please sign in to comment.