Skip to content

Commit

Permalink
feat: init
Browse files Browse the repository at this point in the history
  • Loading branch information
baran.wang committed Oct 12, 2023
0 parents commit 47d6e54
Show file tree
Hide file tree
Showing 52 changed files with 24,827 additions and 0 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
packages/api/src/utils/inflate.*
48 changes: 48 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/**
* @type {import('eslint').Linter.Config}
*/
module.exports = {
root: true,
extends: ['@modern-js'],
rules: {
'no-param-reassign': 'off',
'new-cap': 'off',
'no-new': 'off',
'no-implicit-coercion': 'off',
'spaced-comment': [
'error',
'always',
{
line: {
markers: ['#region', '#endregion', 'region', 'endregion'],
},
},
],
'@typescript-eslint/typedef': 'off',
'@typescript-eslint/no-parameter-properties': 'off',
'@typescript-eslint/consistent-type-imports': ['warn', { prefer: 'type-imports', disallowTypeAnnotations: false }],
'import/no-named-as-default-member': 'off',
'import/order': [
'warn',
{
pathGroups: [
{
pattern: '{@/**,@api}',
group: 'internal',
},
{
pattern: '{react,react-dom,homebridge}',
group: 'builtin',
},
],
pathGroupsExcludedImportTypes: ['type'],
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
'newlines-between': 'always',
groups: ['builtin', 'external', 'unknown', ['internal', 'sibling', 'parent', 'index'], 'object', 'type'],
},
],
},
};
34 changes: 34 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Create Release

on:
workflow_dispatch:

jobs:
create-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-node@v3
with:
node-version: 18
cache: npm

- run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
git checkout -b release/${{ github.sha }}
git push --set-upstream origin release/${{ github.sha }}
- run: npm ci

- run: npx lerna version --yes --conventional-commits --exact

- id: version
run: node -e 'process.stdout.write(`version=${require("./lerna.json").version}`)' >> "$GITHUB_OUTPUT"

- run: gh pr create --base main --title "Release ${{ steps.version.outputs.version }}" --body "Release ${{ steps.version.outputs.version }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27 changes: 27 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish
on:
pull_request:
branches: [main]
types: [closed]

jobs:
publish:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.title, 'Release')
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-node@v3
with:
node-version: 18
cache: npm

- run: npm ci

- run: npm run build

- run: npx lerna publish --yes
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
32 changes: 32 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.DS_Store

.pnp
.pnp.js
.env.local
.env.*.local
.history
*.log*

node_modules/
.yarn-integrity
.pnpm-store/
*.tsbuildinfo
.eslintcache
.changeset/pre.json

dist/
coverage/
release/
output/
output_resource/
log/

.vscode/**/*
!.vscode/settings.json
!.vscode/extensions.json
.idea/

modern.config.local.*

homebridge-ui/
.hb-haier
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry=https://registry.npmjs.org/
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"printWidth": 120,
"singleQuote": true,
"trailingComma": "all",
"arrowParens": "avoid"
}
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"files.eol": "\n",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"editor.rulers": [ 120 ],
"eslint.enable": true,
"cSpell.words": [
"Haier"
]
}
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<p align="center">

<img src="https://github.com/homebridge/branding/raw/master/logos/homebridge-wordmark-logo-vertical.png" width="150">

</p>

# WIP: 海尔智家 Homebridge 插件
11 changes: 11 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "0.0.0",
"packages": ["packages/*"],
"command": {
"version": {
"allowBranch": ["main", "release/*"],
"message": "chore(release): publish %s"
}
}
}
Loading

0 comments on commit 47d6e54

Please sign in to comment.