Skip to content

Commit

Permalink
feat: optimize config (#1)
Browse files Browse the repository at this point in the history
* feat: optimize config

* feat: optimize config

* feat: optimize config

* fix: ts error
  • Loading branch information
winchesHe committed Mar 26, 2024
1 parent 716f910 commit 4fad8a4
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 45 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/script.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Script
name: Build

on:
push:
branches: [main, next]
branches: [main]
pull_request:
branches: [main, next]
branches: [main]

jobs:
next:
Expand All @@ -28,5 +28,5 @@ jobs:
node-version-file: '.nvmrc'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run script
- name: Run build script
run: pnpm ${{ matrix.script }}
4 changes: 2 additions & 2 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Commitlint

on:
push:
branches: [main, next]
branches: [main]
pull_request:
branches: [main, next]
branches: [main]

jobs:
commitlint:
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: lint

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
commitlint:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout codebase
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
run_install: false
- name: Setup node
uses: actions/setup-node@v3
with:
cache: 'pnpm'
check-latest: true
node-version-file: '.nvmrc'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Check eslint
run: pnpm lint
- name: Check Prettier
run: pnpm check:prettier
- name: Check type
run: pnpm check:types
Empty file modified .husky/commit-msg
100644 → 100755
Empty file.
Empty file modified .husky/pre-commit
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.17.1
v18.16.1
2 changes: 1 addition & 1 deletion license
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Next UI
Copyright (c) 2024 Next UI

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,24 @@
"build": "tsup",
"lint": "eslint . --max-warnings=0",
"lint:fix": "eslint . -max-warnings=0 --fix",
"check:prettier": "prettier --check .",
"check:types": "tsc --noEmit",
"prepare": "husky install"
},
"dependencies": {
"commander": "11.0.0",
"chalk": "5.3.0",
"gradient-string": "2.0.2",
"prompts": "2.4.2"
},
"devDependencies": {
"@commitlint/cli": "17.7.1",
"@commitlint/config-conventional": "17.7.0",
"@types/gradient-string": "1.1.3",
"@types/node": "20.6.3",
"@typescript-eslint/eslint-plugin": "6.7.2",
"@typescript-eslint/parser": "6.7.2",
"chalk": "5.3.0",
"clean-package": "2.2.0",
"commander": "11.0.0",
"commitlint-plugin-function-rules": "2.0.2",
"eslint": "8.50.0",
"eslint-config-prettier": "9.0.0",
Expand All @@ -67,16 +73,14 @@
"eslint-plugin-sort-destructure-keys": "1.5.0",
"eslint-plugin-sort-keys-fix": "1.1.2",
"eslint-plugin-unused-imports": "3.0.0",
"gradient-string": "2.0.2",
"husky": "8.0.3",
"lint-staged": "14.0.1",
"prompts": "2.4.2",
"tsup": "7.2.0",
"typescript": "5.2.2"
},
"engines": {
"pnpm": ">=8.7.x",
"node": ">=18.17.x"
"node": ">=18.16.x"
},
"packageManager": "pnpm@8.7.6"
}
47 changes: 20 additions & 27 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { default as chalk } from 'chalk';
import { Command } from 'commander';

import { Logger } from '@helpers/logger';
import { getPackageManager } from '@helpers/package-manager';

import pkg from '../package.json';

Expand Down Expand Up @@ -58,7 +57,3 @@ nextui.parseAsync(process.argv).catch(async (reason) => {
// Logger.log(chalk.bold('Hello, world!'));
// Logger.gradient('Beautiful, fast and modern React UI library.');
// Logger.gradient(chalk.bold('Beautiful, fast and modern React UI library.'));

const packageManager = getPackageManager();

console.log('package manager:', packageManager);

0 comments on commit 4fad8a4

Please sign in to comment.