Skip to content

Commit

Permalink
Implement new monorepo structure for collecticons
Browse files Browse the repository at this point in the history
  • Loading branch information
danielfdsilva committed Jun 20, 2024
1 parent 26696e8 commit e6f9564
Show file tree
Hide file tree
Showing 298 changed files with 16,918 additions and 8,411 deletions.
110 changes: 85 additions & 25 deletions .eslintrc
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,36 +1,96 @@
{
"extends": ["standard"],
"env": {
"es6": true,
"browser": true
},
"parser": "@typescript-eslint/parser", // Specifies the ESLint parser
"plugins": [
"react"
"react",
"react-hooks",
"@typescript-eslint",
"inclusive-language"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:prettier/recommended"
],
"settings": {
"react": {
"version": "detect"
}
},
"env": {
"browser": true,
"node": true,
"es6": true
},
"parserOptions": {
"ecmaVersion": 6,
"requireConfigFile": false,
"babelOptions": {
"presets": [
"@babel/preset-env",
"@babel/preset-react",
"@babel/preset-typescript"
]
},
"ecmaFeatures": {
"jsx": true
}
},
"ecmaVersion": 2018, // Allows for the parsing of modern ECMAScript features
"sourceType": "module" // Allows for the use of imports
},
"rules": {
"prettier/prettier": [
"error",
{
"semi": true,
"singleQuote": true,
"jsxSingleQuote": true,
"parser": "flow"
}
],
"inclusive-language/use-inclusive-words": "error",
"semi": [2, "always"],
"jsx-quotes": [2, "prefer-single"],
"no-console": 2,
"no-extra-semi": 2,
"semi-spacing": [2, { "before": false, "after": true }],
"react/display-name": 1 ,
"react/jsx-no-duplicate-props": 2,
"react/jsx-no-undef": 2,
"react/jsx-uses-react": 2,
"react/jsx-uses-vars": 2,
"react/no-danger": 0,
"react/no-deprecated": 2,
"react/no-did-mount-set-state": 2,
"react/no-did-update-set-state": 2,
"react/no-direct-mutation-state": 2,
"react/no-is-mounted": 2,
"react/no-unknown-property": 2,
"react/prop-types": 2,
"react/react-in-jsx-scope": 2,
"prefer-promise-reject-errors": 0
}
}
"no-dupe-else-if": 0,
"no-setter-return": 0,
"prefer-promise-reject-errors": 0,
"react/button-has-type": 2,
"react/default-props-match-prop-types": 2,
"react/jsx-closing-bracket-location": 2,
"react/jsx-closing-tag-location": 2,
"react/jsx-curly-spacing": 2,
"react/jsx-curly-newline": 2,
"react/jsx-equals-spacing": 2,
"react/jsx-max-props-per-line": [2, { "maximum": 1, "when": "multiline" }],
"react/jsx-first-prop-new-line": 2,
"react/jsx-curly-brace-presence": [
2,
{ "props": "never", "children": "never" }
],
"react/jsx-pascal-case": 2,
"react/jsx-props-no-multi-spaces": 2,
"react/jsx-tag-spacing": [2, { "beforeClosing": "never" }],
"react/jsx-wrap-multilines": 2,
"react/no-array-index-key": 2,
"react/no-typos": 2,
"react/no-unsafe": 2,
"react/no-unused-prop-types": 2,
"react/no-unused-state": 2,
"react/self-closing-comp": 2,
"react/sort-comp": 2,
"react/style-prop-object": 2,
"react/void-dom-elements-no-children": 2,
"react-hooks/rules-of-hooks": "error", // Checks rules of Hooks
"react-hooks/exhaustive-deps": "warn" // Checks effect dependencies
},
"overrides": [
{
"files": ["*.tsx", "*.ts"],
"rules": {
"prettier/prettier": "off"
}
}
]
}
45 changes: 45 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This workflow performs basic checks:
#
# 1. run a preparation step to install and cache node modules
# 2. once prep succeeds, run lint and test in parallel
#
# The checks are skipped on the 'main' branch. The project relies on branch
# protection to avoid pushes straight to 'main'.

name: Checks

on:
push:
branches-ignore:
- 'main'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

- name: Cache node_modules
uses: actions/cache@v4
id: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}

- name: Install
run: yarn install

- name: Lint
run: yarn lint
72 changes: 72 additions & 0 deletions .github/workflows/deploy-gh.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Deploy Github Pages

on:
push:
branches:
- 'main'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

- name: Cache node_modules
uses: actions/cache@v4
id: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}

- name: Cache dist
uses: actions/cache@v4
id: cache-dist
with:
path: showcase/public
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }}

- name: Install
run: yarn install

- name: Creat JSX icons from SVG
run: yarn icons

- name: Build libary & showcase
run: yarn build

deploy:
runs-on: ubuntu-latest
needs: build

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Restore dist cache
uses: actions/cache@v4
id: cache-dist
with:
path: showcase/public
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }}

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
clean: true
single-commit: true
folder: showcase/public
142 changes: 35 additions & 107 deletions .gitignore
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,118 +1,46 @@
################################################
############### .gitignore ##################
################################################
#
# This file is only relevant if you are using git.
#
# Files which match the splat patterns below will
# be ignored by git. This keeps random crap and
# and sensitive credentials from being uploaded to
# your repository. It allows you to configure your
# app for your machine without accidentally
# committing settings which will smash the local
# settings of other developers on your team.
#
# Some reasonable defaults are included below,
# but, of course, you should modify/extend/prune
# to fit your needs!
################################################


################################################
# Local Configuration
#
# Explicitly ignore files which contain:
#
# 1. Sensitive information you'd rather not push to
# your git repository.
# e.g., your personal API keys or passwords.
#
# 2. Environment-specific configuration
# Basically, anything that would be annoying
# to have to change every time you do a
# `git pull`
# e.g., your local development database, or
# the S3 bucket you're using for file uploads
# development.
#
################################################

app/assets/scripts/config/local.js
app/assets/fonts/
app/assets/styles/_icons.scss
app/catalog.json
app/collecticons.zip

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
_gi_*

################################################
# Dependencies
#
# When releasing a production app, you may
# consider including your node_modules and
# bower_components directory in your git repo,
# but during development, its best to exclude it,
# since different developers may be working on
# different kernels, where dependencies would
# need to be recompiled anyway.
#
# More on that here about node_modules dir:
# http://www.futurealoof.com/posts/nodemodules-in-git.html
# (credit Mikeal Rogers, @mikeal)
#
# About bower_components dir, you can see this:
# http://addyosmani.com/blog/checking-in-front-end-dependencies/
# (credit Addy Osmani, @addyosmani)
#
################################################
# Personal resources
.resources

node_modules
bower_components
.sass-cache
test/bower_components
# Dependency directories
node_modules/

# Optional npm cache directory
.npm

################################################
# Node.js / NPM
#
# Common files generated by Node, NPM, and the
# related ecosystem.
################################################
# Optional eslint cache
.eslintcache

lib-cov
*.seed
*.log
*.out
*.pid
npm-debug.log
yarn-error.log
# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

################################################
# Apidocs
#
# Common files generated by apidocs and other docs
################################################
# dotenv environment variable files
.env*

_README.md
# gatsby files
.cache/
public

# Mac files
.DS_Store

################################################
# Miscellaneous
#
# Common files generated by text editors,
# operating systems, file systems, etc.
################################################
# Yarn
yarn-error.log
.pnp/
.pnp.js
# Yarn Integrity file
.yarn-integrity
dist
dist_site
.parcel-cache

*~
*#
.DS_STORE
.DS_Store
.netbeans
nbproject
.idea
.resources
.node_history
temp
tmp
.tmp
dist
1 change: 1 addition & 0 deletions .nojekyll
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Loading

0 comments on commit e6f9564

Please sign in to comment.