Skip to content

Commit

Permalink
feat: ✨ Init
Browse files Browse the repository at this point in the history
  • Loading branch information
viarotel committed Oct 16, 2024
1 parent c2e4bd3 commit 170d767
Show file tree
Hide file tree
Showing 24 changed files with 6,981 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.js text eol=lf
*.md text eol=lf
26 changes: 26 additions & 0 deletions .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: autofix.ci

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

permissions:
contents: read

jobs:
autofix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- run: pnpm install
- name: Fix lint issues
run: pnpm lint:fix
- uses: autofix-ci/action@ff86a557419858bb967097bfc916833f5647fa8c
with:
commit-message: "chore: apply automated updates"
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: ci

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- run: pnpm install
- run: pnpm build
22 changes: 22 additions & 0 deletions .github/workflows/gitee.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: sync-gitee

on:
workflow_run:
workflows: ['release']
types:
- completed

jobs:
sync-to-gitee:
runs-on: ubuntu-latest
steps:
- name: gitee-mirror-action
uses: Yikun/hub-mirror-action@master
with:
src: github/viarotel-org
dst: gitee/viarotel-org
dst_key: ${{ secrets.GITEE_PRIVATE_KEY }}
dst_token: ${{ secrets.GITEE_TOKEN }}
account_type: org
white_list: 'cleants'
force_update: true
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

# Editor directories and files
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# User
node_modules
*.local
dist
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

find "src" -type f -exec git update-index --chmod=+x {} +
5 changes: 5 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
registry=https://registry.npmmirror.com/
shamefully-hoist=true
strict-peer-dependencies=false
auto-install-peers=true
virtual-store-dir-max-length=70
87 changes: 87 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
// Disable the default formatter, use eslint instead
"prettier.enable": false,
"editor.formatOnSave": false,
// Auto fix
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.organizeImports": "never"
},
// Silent the stylistic rules in you IDE, but still auto fix them
"eslint.rules.customizations": [
{
"rule": "style/*",
"severity": "off",
"fixable": true
},
{
"rule": "format/*",
"severity": "off",
"fixable": true
},
{
"rule": "*-indent",
"severity": "off",
"fixable": true
},
{
"rule": "*-spacing",
"severity": "off",
"fixable": true
},
{
"rule": "*-spaces",
"severity": "off",
"fixable": true
},
{
"rule": "*-order",
"severity": "off",
"fixable": true
},
{
"rule": "*-dangle",
"severity": "off",
"fixable": true
},
{
"rule": "*-newline",
"severity": "off",
"fixable": true
},
{
"rule": "*quotes",
"severity": "off",
"fixable": true
},
{
"rule": "*semi",
"severity": "off",
"fixable": true
}
],
// Enable eslint for all supported languages
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"html",
"markdown",
"json",
"jsonc",
"yaml",
"toml",
"xml",
"gql",
"graphql",
"astro",
"svelte",
"css",
"less",
"scss",
"pcss",
"postcss"
]
}
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog


## v0.0.1-0

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) 2024 viarotel
Copyright (c) 2024 viarotel-org

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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# cleants
Convert TypeScript to a cleaner JavaScript project
Convert TypeScript to a cleaner JavaScript project
11 changes: 11 additions & 0 deletions build.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineBuildConfig } from 'unbuild'

export default defineBuildConfig({
entries: ['./src/bin', './src/index'],
clean: true,
failOnWarn: false,
rollup: {
emitCJS: true,
inlineDependencies: true,
},
})
47 changes: 47 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import antfu from '@antfu/eslint-config'

export default antfu(
{
typescript: false,
markdown: false,
ignores: [
'.github',
'.vscode',
'node_modules',
'dist',
],
},
{
rules: {
'jsdoc/check-param-names': 'off',
'jsdoc/check-types': 'off',
'jsdoc/require-returns-description': 'off',

'antfu/consistent-list-newline': 'off',
'antfu/top-level-function': 'off',

'import/default': 'off',
'import/order': 'off',

'node/prefer-global/process': 'off',

'no-console': 'off',
'curly': 'off',
'eqeqeq': 'off',
'no-unused-vars': 'off',
'unused-imports/no-unused-vars': 'off',
'no-debugger': 'off',
'no-restricted-syntax': 'off',
'no-new': 'off',
'prefer-promise-reject-errors': 'off',
'no-unused-expressions': 'off',
'sort-imports': 'off',

'unicorn/consistent-function-scoping': 'off',
'regexp/no-unused-capturing-group': 'off',
'regexp/no-dupe-disjunctions': 'off',
'perfectionist/sort-imports': 'off',
'antfu/no-top-level-await': 'off',
},
},
)
28 changes: 28 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"moduleResolution": "node",
"jsx": "preserve",
"sourceMap": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"lib": [
"esnext",
"dom"
],
"baseUrl": ".",
"paths": {
"@/*": [
"src/*"
]
}
},
"include": [
"src"
],
"exclude": [
"node_modules",
"dist"
]
}
59 changes: 59 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"name": "cleants",
"type": "module",
"version": "0.0.1-0",
"packageManager": "[email protected]",
"description": "Convert TypeScript to a cleaner JavaScript project",
"author": "viarotel",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/viarotel-org/cleants.git"
},
"keywords": [
"typescript",
"javascript",
"converter",
"electron",
"vue"
],
"publishConfig": {
"registry": "https://registry.npmjs.org/",
"access": "public"
},
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
}
},
"main": "./dist/index.cjs",
"bin": {
"cleants": "dist/bin.mjs"
},
"files": [
"dist"
],
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"dev": "unbuild && npx .",
"build": "unbuild",
"release": "changelogen --release --prerelease && npm publish && git push --follow-tags",
"prepare": "husky install"
},
"dependencies": {
"@vue/compiler-sfc": "^3.5.12",
"citty": "^0.1.6",
"fs-extra": "^11.2.0",
"glob": "^11.0.0",
"typescript": "^5.6.3"
},
"devDependencies": {
"@antfu/eslint-config": "^3.7.3",
"changelogen": "^0.5.7",
"eslint": "^9.12.0",
"husky": "^9.1.6",
"unbuild": "latest"
}
}
Loading

0 comments on commit 170d767

Please sign in to comment.