Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.

Commit 811c1dc

Browse files
authored
BREAKING: v2 (#9)
1 parent e12c19a commit 811c1dc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+15491
-2416
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[core]
4+
autocrlf = false
5+
6+
[*]
7+
charset = utf-8
8+
end_of_line = lf
9+
indent_size = 2
10+
indent_style = space
11+
insert_final_newline = true
12+
trim_trailing_whitespace = true

.eslintignore

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
typings.d.ts
2+
index.d.ts
3+
lib
4+
cypress/e2e/build
5+
logs
6+
*.log
7+
npm-debug.log*
8+
yarn-debug.log*
9+
yarn-error.log*
10+
pids
11+
*.pid
12+
*.seed
13+
*.pid.lock
14+
lib-cov
15+
coverage
16+
node_modules
17+
jspm_packages
18+
typings/
19+
.npm
20+
.env
21+
.env.*
22+
.cache
23+
public
24+
.idea
25+
.vscode
26+
.DS_Store
27+
*.png
28+
*.jpg
29+
*.ico
30+
*.md
31+
*.mdx
32+
*.json
33+
LICENSE
34+
*.txt
35+
*.toml

.eslintrc

Lines changed: 0 additions & 68 deletions
This file was deleted.

.eslintrc.js

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
module.exports = {
2+
parser: `@typescript-eslint/parser`, // Specifies the ESLint parser
3+
extends: [`airbnb`, `plugin:import/typescript`, `plugin:prettier/recommended`],
4+
plugins: [`@typescript-eslint`, `prettier`, `react-hooks`],
5+
parserOptions: {
6+
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
7+
sourceType: `module`, // Allows for the use of imports
8+
ecmaFeatures: {
9+
jsx: true,
10+
},
11+
},
12+
env: {
13+
browser: true,
14+
jest: true,
15+
node: true,
16+
},
17+
globals: {
18+
__PATH_PREFIX__: true,
19+
graphql: false,
20+
},
21+
rules: {
22+
"@typescript-eslint/no-unused-vars": [
23+
1,
24+
{
25+
argsIgnorePattern: `res|next|stage|^err|on|config|e|_`,
26+
},
27+
],
28+
"arrow-body-style": [2, `as-needed`],
29+
"no-param-reassign": [
30+
2,
31+
{
32+
props: false,
33+
},
34+
],
35+
"no-unused-expressions": [
36+
1,
37+
{
38+
allowTaggedTemplates: true,
39+
},
40+
],
41+
quotes: `off`,
42+
"@typescript-eslint/quotes": [
43+
2,
44+
`backtick`,
45+
{
46+
avoidEscape: true,
47+
},
48+
],
49+
"@typescript-eslint/prefer-interface": 0,
50+
"@typescript-eslint/explicit-function-return-type": 0,
51+
"@typescript-eslint/no-use-before-define": 0,
52+
"@typescript-eslint/camelcase": 0,
53+
"@typescript-eslint/no-var-requires": 0,
54+
"@typescript-eslint/no-non-null-assertion": 0,
55+
"@typescript-eslint/no-empty-function": 0,
56+
"@typescript-eslint/explicit-module-boundary-types": 0,
57+
"@typescript-eslint/ban-ts-comment": 0,
58+
"no-console": [`warn`, { allow: [`warn`] }],
59+
"spaced-comment": [2, `always`, { exceptions: [`-`, `+`], markers: [`/`] }],
60+
"no-use-before-define": 0,
61+
"no-plusplus": 0,
62+
"no-continue": 0,
63+
"linebreak-style": 0,
64+
"consistent-return": 0,
65+
import: 0,
66+
camelcase: 1,
67+
"import/no-unresolved": 0,
68+
"func-names": 0,
69+
"import/no-extraneous-dependencies": 0,
70+
"import/prefer-default-export": 0,
71+
"import/no-cycle": 0,
72+
"space-before-function-paren": 0,
73+
"import/extensions": 0,
74+
"import/no-anonymous-default-export": 2,
75+
"react/jsx-one-expression-per-line": 0,
76+
"react/no-danger": 0,
77+
"react/display-name": 0,
78+
"react/react-in-jsx-scope": 0,
79+
"react/jsx-uses-react": 1,
80+
"react/require-default-props": 0,
81+
"react/forbid-prop-types": 0,
82+
"react/no-unescaped-entities": 0,
83+
"react/prop-types": 0,
84+
"react/jsx-props-no-spreading": 0,
85+
"react/jsx-fragments": 0,
86+
"react/jsx-curly-brace-presence": 0,
87+
"react/jsx-pascal-case": 0,
88+
"react/jsx-filename-extension": [
89+
1,
90+
{
91+
extensions: [`.js`, `.jsx`, `.tsx`],
92+
},
93+
],
94+
"react-hooks/rules-of-hooks": `error`,
95+
"react-hooks/exhaustive-deps": `warn`,
96+
indent: [`error`, 2, { SwitchCase: 1 }],
97+
"prettier/prettier": [
98+
`error`,
99+
{
100+
trailingComma: `es5`,
101+
semi: false,
102+
singleQuote: false,
103+
printWidth: 120,
104+
},
105+
],
106+
"jsx-a11y/href-no-hash": `off`,
107+
"jsx-a11y/anchor-is-valid": [
108+
`warn`,
109+
{
110+
aspects: [`invalidHref`],
111+
},
112+
],
113+
},
114+
}

.github/FUNDING.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# These are supported funding model platforms
2+
3+
github: [LekoArts]
4+
patreon: lekoarts
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: lekoarts
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
custom: # Replace with a single custom sponsorship URL
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM node:12-slim
2+
3+
LABEL com.github.actions.name="Publish starter"
4+
LABEL com.github.actions.description="Automatically push subdirectories in a monorepo to their own repositories"
5+
LABEL com.github.actions.icon="package"
6+
LABEL com.github.actions.color="purple"
7+
8+
RUN apt-get update && \
9+
apt-get upgrade -y && \
10+
apt-get install -y git && \
11+
apt-get install -y jq
12+
13+
COPY "entrypoint.sh" "/entrypoint.sh"
14+
ENTRYPOINT ["/entrypoint.sh"]
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
FOLDER=$1
6+
GITHUB_USERNAME=$2
7+
STARTER_NAME="${3:-name}"
8+
BRANCH_NAME="${4:-main}"
9+
BASE=$(pwd)
10+
11+
git config --global user.email "lekoarts@gmail.com"
12+
git config --global user.name "$GITHUB_USERNAME"
13+
14+
echo "Cloning $FOLDER and pushing to $GITHUB_USERNAME"
15+
echo "Using $STARTER_NAME as the package.json key"
16+
17+
cd $BASE
18+
19+
NAME=$(cat $FOLDER/package.json | jq --arg name "$STARTER_NAME" -r '.[$name]')
20+
echo " Name: $NAME"
21+
IS_WORKSPACE=$(cat $FOLDER/package.json | jq -r '.workspaces')
22+
CLONE_DIR="__${NAME}__clone__"
23+
echo " Clone dir: $CLONE_DIR"
24+
25+
# clone, delete files in the clone, and copy (new) files over
26+
# this handles file deletions, additions, and changes seamlessly
27+
git clone --depth 1 https://$API_TOKEN_GITHUB@github.com/$GITHUB_USERNAME/$NAME.git $CLONE_DIR &> /dev/null
28+
cd $CLONE_DIR
29+
find . | grep -v ".git" | grep -v "^\.*$" | xargs rm -rf # delete all files (to handle deletions in monorepo)
30+
cp -r $BASE/$FOLDER/. .
31+
32+
# generate a new yarn.lock file based on package-lock.json unless you're in a workspace
33+
if [ "$IS_WORKSPACE" = null ]; then
34+
echo " Regenerating yarn.lock"
35+
rm -rf yarn.lock
36+
yarn
37+
fi
38+
39+
# Commit if there is anything to
40+
if [ -n "$(git status --porcelain)" ]; then
41+
echo " Committing $NAME to $GITHUB_REPOSITORY"
42+
git add .
43+
git commit --message "Update $NAME from $GITHUB_REPOSITORY"
44+
git push origin $BRANCH_NAME
45+
echo " Completed $NAME"
46+
else
47+
echo " No changes, skipping $NAME"
48+
fi

.github/workflows/publish-starter.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Publish Starter
2+
on:
3+
workflow_dispatch:
4+
jobs:
5+
publish-starter:
6+
name: Publish Starter
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- name: Setup Node.js 12.x
11+
uses: actions/setup-node@v1
12+
with:
13+
node-version: '12'
14+
- name: Publish Starter
15+
uses: ./.github/actions/publish-starter
16+
env:
17+
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
with:
20+
args: example LekoArts starter-name main

.github/workflows/testing.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Testing
2+
on: pull_request
3+
jobs:
4+
testing:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
- uses: actions/cache@v2
9+
with:
10+
path: "**/node_modules"
11+
key: ${{ runner.os }}-12.x-modules-${{ hashFiles('**/yarn.lock') }}
12+
- name: Install dependencies
13+
run: yarn install
14+
- name: Run Jest
15+
run: yarn test:ci

0 commit comments

Comments
 (0)