Skip to content

Commit f2d9c5c

Browse files
committed
Initial commit
0 parents  commit f2d9c5c

File tree

13 files changed

+346
-0
lines changed

13 files changed

+346
-0
lines changed

.babelrc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"presets": [
3+
[
4+
"@babel/preset-env",
5+
{
6+
"targets": {
7+
"node": "current"
8+
}
9+
}
10+
],
11+
"@babel/preset-react",
12+
],
13+
"plugins": [
14+
"@babel/plugin-proposal-class-properties"
15+
]
16+
}
17+

.eslintrc.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"extends": ["airbnb", "prettier", "eslint:recommended"],
3+
"settings": {
4+
"import/resolver": {
5+
"node": {
6+
"paths": ["src"]
7+
}
8+
}
9+
},
10+
"parser": "@babel/eslint-parser",
11+
"env": {
12+
"browser": true,
13+
"node": true,
14+
"mocha": true
15+
},
16+
"plugins": ["prettier", "simple-import-sort", "jsdoc"],
17+
"rules": {
18+
"prettier/prettier": "error",
19+
"comma-dangle": ["error", "always-multiline"],
20+
"array-element-newline": ["error", "consistent"],
21+
"no-plusplus": ["error", { "allowForLoopAfterthoughts": true }],
22+
"one-var": ["error", { "uninitialized": "always", "initialized": "never" }],
23+
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
24+
"prefer-template": "off",
25+
"camelcase": "off",
26+
"max-len": "off",
27+
"no-console": "off",
28+
"no-unused-expressions": "warn",
29+
"no-confusing-arrow": "off",
30+
"no-underscore-dangle": "off",
31+
"no-return-assign": "off",
32+
"consistent-return": "off",
33+
"arrow-body-style": "off",
34+
"import/prefer-default-export": "off",
35+
"import/no-named-as-default-member": "warn",
36+
"no-param-reassign": ["warn", { "props": false }],
37+
"max-classes-per-file": "warn",
38+
"simple-import-sort/imports": [
39+
"warn",
40+
{
41+
"groups": [
42+
// Side effect imports.
43+
["^\\u0000"],
44+
// Packages.
45+
// Things that start with a letter (or digit or underscore), or `@` followed by a letter.
46+
["^@?\\w"],
47+
// Absolute imports
48+
[
49+
"^(components|configs|constants|containers|domain|enhancers|hocs|libs|pages|reducers|services|store|modules|dictionaries)(/.*|$)"
50+
],
51+
// Relative imports.
52+
// Anything that starts with a dot.
53+
["^\\."]
54+
]
55+
}
56+
]
57+
}
58+
}
59+

.github/workflows/cicd.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Continuous testing and publication to NPM from 'main'
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
9+
cancel-in-progress: true
10+
11+
12+
jobs:
13+
14+
run-js-tests:
15+
runs-on: ubuntu-latest
16+
if: github.repository != 'Exabyte-io/template-definitions'
17+
strategy:
18+
matrix:
19+
node-version: [12.x, 14.x, 16.x]
20+
21+
steps:
22+
- name: Checkout this repository
23+
uses: actions/checkout@v2
24+
25+
- name: Checkout actions repository
26+
uses: actions/checkout@v2
27+
with:
28+
repository: Exabyte-io/actions
29+
token: ${{ secrets.BOT_GITHUB_TOKEN }}
30+
path: actions
31+
32+
- name: Run JS tests
33+
uses: ./actions/js/test
34+
with:
35+
node-version: ${{ matrix.node-version }}
36+
37+
publish-js-package:
38+
needs: [run-js-tests]
39+
runs-on: ubuntu-latest
40+
if: (github.repository != 'Exabyte-io/template-definitions') && (github.ref_name == 'main')
41+
42+
steps:
43+
- name: Checkout this repository
44+
uses: actions/checkout@v2
45+
46+
- name: Checkout actions repository
47+
uses: actions/checkout@v2
48+
with:
49+
repository: Exabyte-io/actions
50+
token: ${{ secrets.BOT_GITHUB_TOKEN }}
51+
path: actions
52+
53+
- name: Publish JS release
54+
uses: ./actions/js/publish
55+
with:
56+
node-version: 12.21.x
57+
npm-token: ${{ secrets.NPM_TOKEN }}
58+
github-token: ${{ secrets.BOT_GITHUB_TOKEN }}
59+

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
dist/
2+
build/
3+
node_modules/
4+
.eslintcache
5+
.nyc_output/
6+
.idea/
7+

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx lint-staged

.nycrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"all": true,
3+
"include": [
4+
"src/**/*.js",
5+
"src/**/*.jsx"
6+
]
7+
}
8+

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"singleQuote": false,
3+
"printWidth": 100,
4+
"trailingComma": "all",
5+
"tabWidth": 4
6+
}
7+

LICENSE.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# LICENSE
2+
3+
Copyright 2022 Exabyte Inc.
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# template-definitions
2+
3+
Template repository for entity definition libraries in Javascript
4+
5+
See [here](https://docs.github.com/en/github-ae@latest/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template)
6+
for details on how to use this repository.
7+
8+
Included is a simple `template.py` analog to `cookiecutter` which will prompt
9+
the user for some information and then write out templated values in select files.
10+
After usage, the `template.py` file can be removed and the `README.md` and associated
11+
`files` can be committed.
12+

package.json

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"name": "@exabyte-io/PROJECT_NAME",
3+
"version": "0.0.0",
4+
"description": "PROJECT_DESCRIPTION",
5+
"scripts": {
6+
"test": "nyc --reporter=text mocha --recursive --bail --require @babel/register/lib --require tests/setup.js tests",
7+
"lint": "eslint src tests && prettier --write src tests",
8+
"lint:fix": "eslint --fix --cache src tests && prettier --write src tests",
9+
"transpile": "babel --out-dir dist src",
10+
"postinstall": "npm run transpile",
11+
"prettier": "prettier --check src tests",
12+
"prepare": "husky install"
13+
},
14+
"repository": {
15+
"type": "git",
16+
"url": "https://github.com/Exabyte-io/PROJECT_NAME.git"
17+
},
18+
"main": "dist/index.js",
19+
"files": [
20+
"/dist",
21+
"/src",
22+
".babelrc"
23+
],
24+
"author": "Exabyte Inc.",
25+
"bugs": {
26+
"url": "https://github.com/Exabyte-io/PROJECT_NAME/issues"
27+
},
28+
"license": "Apache-2.0",
29+
"homepage": "https://github.com/Exabyte-io/PROJECT_NAME",
30+
"dependencies": {
31+
"@babel/cli": "7.16.0",
32+
"@babel/core": "7.16.0",
33+
"@babel/eslint-parser": "7.16.3",
34+
"@babel/plugin-proposal-class-properties": "7.16.0",
35+
"@babel/preset-env": "7.16.4",
36+
"@babel/preset-react": "7.16.7",
37+
"@babel/register": "^7.16.0",
38+
"@babel/runtime-corejs3": "7.16.8"
39+
},
40+
"devDependencies": {
41+
"chai": "^4.3.4",
42+
"eslint": "7.32.0",
43+
"eslint-config-airbnb": "19.0.2",
44+
"eslint-config-prettier": "8.3.0",
45+
"eslint-plugin-react": "7.30.0",
46+
"eslint-plugin-import": "2.25.3",
47+
"eslint-plugin-jsdoc": "37.1.0",
48+
"eslint-plugin-jsx-a11y": "6.5.1",
49+
"eslint-plugin-prettier": "4.2.1",
50+
"eslint-plugin-simple-import-sort": "7.0.0",
51+
"husky": "^7.0.4",
52+
"lint-staged": "^12.1.2",
53+
"mocha": "^9.1.3",
54+
"nyc": "^15.1.0",
55+
"prettier": "^2.7.1"
56+
},
57+
"engines": {
58+
"node": ">=12.0.0"
59+
},
60+
"lint-staged": {
61+
"*.js": "eslint --cache --fix",
62+
"*.{js,css}": "prettier --write"
63+
}
64+
}
65+

0 commit comments

Comments
 (0)