Skip to content

Commit

Permalink
chore: update project architecture
Browse files Browse the repository at this point in the history
Signed-off-by: Lexus Drumgold <[email protected]>
  • Loading branch information
unicornware committed Dec 28, 2022
1 parent 0279edc commit 5b36f88
Show file tree
Hide file tree
Showing 14 changed files with 681 additions and 790 deletions.
7 changes: 5 additions & 2 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,22 @@
"**/.gitignore",
"**/.gitkeep",
"**/.npmignore",
"**/dist/",
".cspell.json",
".env*",
".eslintignore",
".git/",
".husky/_/",
".markdownlintignore",
".npmrc",
".nvmrc",
".prettierignore",
".vercel/",
".vscode/settings.json",
".yarn/",
"CHANGELOG.md",
"LICENSE.md",
"__tests__/report.json",
"dist/",
"patches/",
"yarn.lock"
],
Expand All @@ -46,5 +49,5 @@
"useGitignore": true,
"usePnP": false,
"version": "0.2",
"words": ["fldv", "flexdevelopmentllc"]
"words": ["fldv", "flexdevelopmentllc", "pathe"]
}
4 changes: 0 additions & 4 deletions .dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ dedupe
deduped
dessant
dohm
esbenp
esbuild
fbca
gpgsign
graphqlrc
hmarr
iife
keyid
Expand All @@ -24,7 +22,6 @@ nocheck
npmrc
nums
nvmrc
pathe
pkgs
pnpm
posix
Expand All @@ -33,5 +30,4 @@ seglen
sepidx
syncer
vates
vsicons
yarnrc
1 change: 1 addition & 0 deletions .env.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
#
# - https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/dotenv

[ -f $PWD/.env.local ] && source $PWD/.env.local
NODE_NO_WARNINGS=1
12 changes: 7 additions & 5 deletions .eslintrc.base.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ const config = {
'no-array-constructor': 0,
'no-case-declarations': 0,
'no-duplicate-imports': 0,
'no-empty': [2, { allowEmptyCatch: true }],
'no-empty-function': 0,
'no-ex-assign': 0,
'no-invalid-this': 0,
Expand Down Expand Up @@ -679,7 +680,7 @@ const config = {
'@typescript-eslint/no-base-to-string': [
2,
{
ignoredTypeNames: ['RegExp']
ignoredTypeNames: ['Error', 'RegExp', 'URL', 'URLSearchParams']
}
],
'@typescript-eslint/no-floating-promises': [
Expand Down Expand Up @@ -799,7 +800,7 @@ const config = {
}
},
{
files: ['*.cjs', '*.md/*.cjs', '*.js', '*.jsx', '*.mjs'],
files: ['*.cjs', '*.md/*.cjs', '*.mjs'],
rules: {
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/no-implicit-any-catch': 0
Expand Down Expand Up @@ -848,7 +849,7 @@ const config = {
}
},
{
files: ['*.json', '*.json5', '*.jsonc'],
files: ['*.json', '*.jsonc'],
extends: ['plugin:jsonc/prettier'],
parser: 'jsonc-eslint-parser',
plugins: ['jsonc'],
Expand Down Expand Up @@ -924,7 +925,7 @@ const config = {
}
},
{
files: ['*.json5', '*.jsonc'],
files: ['*.jsonc'],
rules: {
'jsonc/no-comments': 0
}
Expand Down Expand Up @@ -995,7 +996,7 @@ const config = {
}
},
{
files: ['**/__tests__/*.spec.*', '**/__tests__/*.spec-d.ts'],
files: ['**/__tests__/*.spec.*', '**/__tests__/*.spec-d.*'],
globals: {
afterAll: true,
afterEach: true,
Expand Down Expand Up @@ -1036,6 +1037,7 @@ const config = {
'promise/prefer-await-to-callbacks': 0,
'promise/valid-params': 0,
'unicorn/consistent-destructuring': 0,
'unicorn/error-message': 0,
'unicorn/explicit-length-check': 0,
'unicorn/no-array-for-each': 0,
'unicorn/no-useless-undefined': 0,
Expand Down
13 changes: 6 additions & 7 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,32 @@
#
# - https://docs.github.com/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates

---
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
commit-message:
prefix: ci
include: scope
directory: /
labels:
- scope:dependencies
- type:ci
reviewers:
- flex-development/dependabot-review
- flexdevelopment
- package-ecosystem: npm
directory: /
schedule:
interval: daily
- package-ecosystem: npm
commit-message:
prefix: build
include: scope
ignore:
- dependency-name: typescript
directory: /
labels:
- scope:dependencies
- type:build
reviewers:
- flex-development/dependabot-review
- flexdevelopment
schedule:
interval: daily
13 changes: 8 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
# - https://docs.github.com/actions/using-workflows/events-that-trigger-workflows#push
# - https://docs.github.com/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch
# - https://github.com/actions/checkout
# - https://github.com/actions/setup-node
# - https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#yarn2-configuration
# - https://github.com/actions/upload-artifact
# - https://github.com/codecov/codecov-action
# - https://github.com/hmarr/debug-action
Expand Down Expand Up @@ -58,13 +60,14 @@ jobs:
uses: actions/[email protected]
with:
cache: yarn
cache-dependency-path: yarn.lock
node-version: ${{ matrix.node-version }}
- id: debug
name: Print environment variables and event payload
uses: hmarr/[email protected]
- id: yarn
name: Install dependencies
run: yarn --no-immutable
run: yarn ${{ github.actor == 'dependabot[bot]' && '--no-immutable' || '--immutable' }}
- id: format
name: Check code formatting
run: yarn check:format
Expand All @@ -76,7 +79,7 @@ jobs:
run: yarn check:spelling
- id: typecheck
name: Run typecheck
run: yarn typecheck
run: yarn typecheck && yarn check:types:build
- id: test
name: Run tests
run: yarn test:cov --segfault-retry=3
Expand All @@ -85,15 +88,15 @@ jobs:
run: yarn pack -o %s-%v.tgz
env:
NODE_ENV: production
- id: package-version
- id: version
name: Get package version
run: echo "result=$(jq .version package.json -r)" >> $GITHUB_OUTPUT
- id: package-archive
- id: archive
name: Archive production artifacts
uses: actions/[email protected]
with:
name: |
${{ format('@{0}-{1}-{2}', github.repository_owner, github.event.repository.name, steps.package-version.outputs.result) }}
${{ format('@{0}-{1}-{2}', github.repository_owner, github.event.repository.name, steps.version.outputs.result) }}
path: '*.tgz'
- id: codecov
name: Upload coverage report to Codecov
Expand Down
17 changes: 16 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
},
"eslint.validate": [
"graphql",
"javascript",
"json",
"jsonc",
"markdown",
Expand Down Expand Up @@ -162,7 +163,11 @@
"typescript.suggest.completeJSDocs": true,
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.updateImportsOnFileMove.enabled": "always",
"versionlens.npm.dependencyProperties": ["dependencies", "devDependencies"],
"versionlens.npm.dependencyProperties": [
"dependencies",
"devDependencies",
"resolutions"
],
"vsicons.associations.files": [
{
"extensions": [".eslintrc.base.cjs"],
Expand All @@ -184,6 +189,11 @@
"format": "svg",
"icon": "vitest"
},
{
"extensions": ["spec-d.ts"],
"format": "svg",
"icon": "testts"
},
{
"extensions": ["yarnrc.yml"],
"format": "svg",
Expand All @@ -201,6 +211,11 @@
"format": "svg",
"icon": "temp"
},
{
"extensions": ["internal"],
"format": "svg",
"icon": "private"
},
{
"extensions": ["patches"],
"format": "svg",
Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ Follow the steps below to setup your local development environment:
git config --global user.username <username>
```

See [`.gitconfig`](.github/.gitconfig) for a global Git config example.

6. Install dependencies

```sh
Expand Down Expand Up @@ -74,9 +76,7 @@ Follow the steps below to setup your local development environment:

# LOAD ENVIRONMENT VARIABLES IN CURRENT WORKING DIRECTORY
# 1. $GITHUB_WORKSPACE
# 2. environment variables (local)
[ -d $PWD/.git ] && export GITHUB_WORKSPACE=$(git rev-parse --show-toplevel)
[ -f $PWD/.env.local ] && source $PWD/.env.local
```

9. Load `dotenv` plugin via `$ZDOTDIR/.zshrc`:
Expand All @@ -97,11 +97,11 @@ Follow the steps below to setup your local development environment:

| name |
| ----------------------- |
| `CI` |
| `CODECOV_TOKEN` |
| `GITHUB_TOKEN` |
| `NODE_ENV` |
| `NODE_NO_WARNINGS` |
| `NODE_OPTIONS` |
| `PAT_BOT` |
| `ZSH_DOTENV_FILE` |

#### GitHub Actions
Expand Down
14 changes: 0 additions & 14 deletions __tests__/setup/chai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,7 @@
*/

import chai from 'chai'
import chaiEach from 'chai-each'
import chaiQuantifiers from 'chai-quantifiers'
import chaiString from 'chai-string'

// configure chai
chai.config.includeStack = true
chai.config.truncateThreshold = 0

/**
* initialize chai plugins.
*
* @see https://github.com/jamesthomasonjr/chai-each
* @see https://github.com/funny-bytes/chai-quantifiers
* @see https://github.com/onechiporenko/chai-string
*/
chai.use(chaiEach)
chai.use(chaiQuantifiers)
chai.use(chaiString)
Loading

0 comments on commit 5b36f88

Please sign in to comment.