Skip to content

Commit

Permalink
ci: initialization (#19)
Browse files Browse the repository at this point in the history
* chore: remove unnecessary settings

Signed-off-by: Urban Vidovič <[email protected]>

* chore: add .nvmrc

Signed-off-by: Urban Vidovič <[email protected]>

* chore: bump engines versions

Signed-off-by: Urban Vidovič <[email protected]>

* chore: bump deps versions

Signed-off-by: Urban Vidovič <[email protected]>

* ci: create linting

* chore: update monorepo configs

Signed-off-by: Urban Vidovič <[email protected]>

* fix: eslint

Signed-off-by: Urban Vidovič <[email protected]>

* chore: update .gitignore

Signed-off-by: Urban Vidovič <[email protected]>

* chore: setup nx

Signed-off-by: Urban Vidovič <[email protected]>

* chore: deps versioning

Signed-off-by: Urban Vidovič <[email protected]>

* chore: husky setup

Signed-off-by: Urban Vidovič <[email protected]>

* chore: lint project

Signed-off-by: Urban Vidovič <[email protected]>

* chore: add lint-staged config

* chore: lint staged configs

* chore: downgrade pnpm version due to vercel

* chore: update nx

* chore: update nx

* ci: update main

* chore: update vercel deployment

* ci: downgrade to v0.13

* ci: updates

* chore: update nx config

---------

Signed-off-by: Urban Vidovič <[email protected]>
  • Loading branch information
pseudobun authored Dec 25, 2023
1 parent 1498373 commit c2c542a
Show file tree
Hide file tree
Showing 52 changed files with 6,131 additions and 3,167 deletions.
7 changes: 7 additions & 0 deletions .ci.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
libs
packages
pnpm-lock.yaml
.vercel
.changeset
CHANGELOG.md
.nx
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
coverage
public
dist
pnpm-lock.yaml
pnpm-workspace.yaml
109 changes: 109 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
module.exports = {
root: true,
extends: [
'airbnb-base',
'airbnb-typescript/base',
'plugin:@typescript-eslint/recommended-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked',
'prettier',
],
overrides: [
{
files: [
'**/*.spec.ts',
'**/*.e2e-spec.ts',
'**/test/**',
'**/tests/**',
'**/__tests__/**',
'**/*.spec.ts',
],
rules: {
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
},
},
],
plugins: ['@typescript-eslint', 'unused-imports'],
parser: '@typescript-eslint/parser',
rules: {
// other rules
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'variable',
format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
leadingUnderscore: 'allow',
trailingUnderscore: 'allow',
},

{
selector: 'typeLike',
format: ['PascalCase'],
},
],
'@typescript-eslint/prefer-nullish-coalescing': 'off',
// FIXME: Turn this on and fix in separate PR
'no-unused-vars': [
'off',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
},
],
'no-underscore-dangle': 'off',
'no-restricted-syntax': [
'error',
'ForInStatement',
'LabeledStatement',
'WithStatement',
],
'no-param-reassign': [2, { props: false }],
'no-await-in-loop': 'off',
'no-nested-ternary': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/require-await': 'off',
// for unused-imports library
'@typescript-eslint/no-unused-vars': 'off',
'unused-imports/no-unused-imports': 'error',
'import/prefer-default-export': 0,
'class-methods-use-this': 'off',
// for tests
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: [
'**/*.spec.ts',
'**/*.e2e-spec.ts',
'**/webpack.config.ts',
'**/test/**/*.ts',
'**/tests/**/*.ts',
'**/tsup.config.ts',
'**/jest.d.ts',
'**/test/**',
'**/tests/**',
'**/vite.config.ts',
],
},
],
'import/extensions': 'off',
},
ignorePatterns: [
'**/node_modules/**',
'**/dist/**',
'**/!.eslintrc.cjs',
'**/coverage/**',
'**/build/**',
'**/.docusaurus/**',
'**/next.config.js',
'**/out',
'**/.next',
'tsup.config.ts',
'templates',
'external',
'.nx',
],
};
6 changes: 0 additions & 6 deletions .eslintrc.json

This file was deleted.

39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

on:
workflow_dispatch:
push:
branches:
- main
- develop
pull_request:
types: [opened, synchronize, reopened]
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true
jobs:
main:
name: Nx Cloud
uses: nrwl/ci/.github/workflows/[email protected]
secrets:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
with:
pnpm-version: 8.11
node-version: 20.10.0
number-of-agents: 3
main-branch-name: 'main'
init-commands: |
npx nx-cloud record -- pnpm exec prettier . --ignore-path .ci.prettierignore --check
parallel-commands-on-agents: |
pnpm exec nx run-many --target=lint --parallel=3
pnpm exec nx run-many --target=build --parallel=3
agents:
name: Nx Cloud - Agents
uses: nrwl/ci/.github/workflows/[email protected]
secrets:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
with:
number-of-agents: 3
pnpm-version: 8.11
node-version: 20.10.0
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# nx
.nx

# next.js
.next/

Expand Down Expand Up @@ -36,3 +39,6 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts


.nx/cache
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm commitlint --edit $1
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm exec lint-staged
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
strict-peer-dependencies=false
auto-install-peers=true
public-hoist-pattern[]=*@nextui-org/*
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.10.0
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
coverage
public
dist
pnpm-lock.yaml
pnpm-workspace.yaml
33 changes: 33 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"endOfLine": "lf",
"trailingComma": "es5",
"tabWidth": 2,
"semi": true,
"singleQuote": true,
"importOrder": [
"^(react/(.*)$)|^(react$)",
"^(next/(.*)$)|^(next$)",
"<THIRD_PARTY_MODULES>",
"^types$",
"^@local/(.*)$",
"^@/lib/(.*)$",
"^@/components/(.*)$",
"^@/styles/(.*)$",
"^@/utils/(.*)$",
"^@/pages/(.*)$",
"^@/stores",
"^[./]"
],
"importOrderParserPlugins": [
"typescript",
"jsx",
"decorators-legacy",
"importAssertions"
],
"importOrderTypeScriptVersion": "5.2.2",
"plugins": [
"prettier-plugin-packagejson",
"@ianvs/prettier-plugin-sort-imports",
"prettier-plugin-tailwindcss"
]
}
20 changes: 10 additions & 10 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
module.exports = {
extends: ["stylelint-config-standard-scss", "stylelint-config-css-modules"],
extends: ['stylelint-config-standard-scss', 'stylelint-config-css-modules'],
rules: {
"at-rule-no-unknown": null,
"scss/at-rule-no-unknown": [
'at-rule-no-unknown': null,
'scss/at-rule-no-unknown': [
true,
{
ignoreAtRules: [
"apply",
"layer",
"responsive",
"screen",
"tailwind",
"variants",
'apply',
'layer',
'responsive',
'screen',
'tailwind',
'variants',
],
},
],
"no-descending-specificity": null,
'no-descending-specificity': null,
},
};
5 changes: 3 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"typescript.tsdk": "../../node_modules/.pnpm/typescript@5.0.3/node_modules/typescript/lib",
"typescript.tsdk": "../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"editor.formatOnSave": true
"editor.formatOnSave": true,
"json.format.enable": true
}
1 change: 1 addition & 0 deletions commitlint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] };
41 changes: 41 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"tasksRunnerOptions": {
"default": {
"options": {
"cacheableOperations": ["build", "test", "lint", "test:ci", "test:cron"]
}
}
},
"extends": "nx/presets/npm.json",
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"affected": {
"defaultBase": "origin/main"
},
"targetDefaults": {
"build": {
"dependsOn": ["^build"],
"cache": true
},
"lint": {
"dependsOn": ["^build"],
"cache": true
},
"lint:fix": {
"dependsOn": ["^build"],
"cache": true
},
"lint:next": {
"cache": true
},
"lint:prettier": {
"cache": true
},
"lint:stylelint": {
"cache": true
},
"lint:tsc": {
"cache": true
}
},
"nxCloudAccessToken": "Y2M2OWVmODMtNzY3OC00MDFmLTkyMDYtNWQ3YTNkOGE0YmJlfHJlYWQ="
}
Loading

1 comment on commit c2c542a

@vercel
Copy link

@vercel vercel bot commented on c2c542a Dec 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.