Skip to content

Commit

Permalink
✨ feat: Init
Browse files Browse the repository at this point in the history
  • Loading branch information
canisminor1990 committed Nov 2, 2023
0 parents commit 9961d3a
Show file tree
Hide file tree
Showing 18 changed files with 513 additions and 0 deletions.
1 change: 1 addition & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@lobehub/lint').commitlint;
32 changes: 32 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Eslintignore for LobeHub
################################################################

# dependencies
node_modules

# ci
coverage
.coverage

# test
jest*
_test_
__test__
*.test.ts

# umi
.umi
.umi-production
.umi-test
.dumi/tmp*
!.dumirc.ts

# production
dist
es
lib
logs

# misc
# add other ignore file below
.next
7 changes: 7 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const config = require('@lobehub/lint').eslint;

config.rules['no-param-reassign'] = 0;
config.rules['unicorn/no-array-callback-reference'] = 0;
config.rules['unicorn/no-array-for-each'] = 0;

module.exports = config;
58 changes: 58 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Gitignore for LobeHub
################################################################

# general
.DS_Store
.idea
.vscode
.history
.temp
.env.local
venv
temp
tmp

# dependencies
node_modules
*.log
*.lock
package-lock.json

# ci
coverage
.coverage
.eslintcache
.stylelintcache

# production
dist
es
lib
logs
test-output

# umi
.umi
.umi-production
.umi-test
.dumi/tmp*

# husky
.husky/prepare-commit-msg

# misc
# add other ignore file below

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
.next
.env
public/*.js
bun.lockb
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"

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

npm run type-check
npx --no-install lint-staged
11 changes: 11 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
lockfile=false
resolution-mode=highest
public-hoist-pattern[]=*@umijs/lint*
public-hoist-pattern[]=*changelog*
public-hoist-pattern[]=*commitlint*
public-hoist-pattern[]=*eslint*
public-hoist-pattern[]=*postcss*
public-hoist-pattern[]=*prettier*
public-hoist-pattern[]=*remark*
public-hoist-pattern[]=*semantic-release*
public-hoist-pattern[]=*stylelint*
63 changes: 63 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Prettierignore for LobeHub
################################################################

# general
.DS_Store
.editorconfig
.idea
.vscode
.history
.temp
.env.local
.husky
.npmrc
.gitkeep
venv
temp
tmp
LICENSE

# dependencies
node_modules
*.log
*.lock
package-lock.json

# ci
coverage
.coverage
.eslintcache
.stylelintcache
test-output
__snapshots__
*.snap

# production
dist
es
lib
logs

# umi
.umi
.umi-production
.umi-test
.dumi/tmp*

# ignore files
.*ignore

# docker
docker
Dockerfile*

# image
*.webp
*.gif
*.png
*.jpg
*.svg

# misc
# add other ignore file below
.next
1 change: 1 addition & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@lobehub/lint').prettier;
1 change: 1 addition & 0 deletions .releaserc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@lobehub/lint').semanticRelease;
1 change: 1 addition & 0 deletions .remarkrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@lobehub/lint').remarklint;
Empty file added README.md
Empty file.
16 changes: 16 additions & 0 deletions api/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import qs from 'query-string';

import cors from '../src/cors';
import { SsmlOptions } from '../src/genSSML';
import { postMicrosoftSpeech } from '../src/postMicrosoftSpeech';

export const config = {
runtime: 'edge',
};

export default async (req: Request) => {
const { text, ...options }: SsmlOptions & { text: string } = qs.parseUrl(req.url).query as any;

const res = await fetch(...postMicrosoftSpeech(text, options));
return cors(req, res);
};
65 changes: 65 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"name": "lobe-tts",
"version": "0.0.1",
"homepage": "https://github.com/lobehub/lobe-tts",
"bugs": {
"url": "https://github.com/lobehub/lobe-tts/issues/new/choose"
},
"repository": {
"type": "git",
"url": "https://github.com/lobehub/lobe-tts.git"
},
"license": "MIT",
"author": "LobeHub <i@lobehub.com>",
"sideEffects": false,
"scripts": {
"lint": "eslint \"{src,tests}/**/*.{js,jsx,ts,tsx}\" --fix",
"lint:md": "remark . --quiet --frail --output",
"lint:style": "stylelint \"{src,tests}/**/*.{js,jsx,ts,tsx}\" --fix",
"prepare": "husky install",
"prettier": "prettier -c --write \"**/**\"",
"release": "semantic-release",
"type-check": "tsc --noEmit"
},
"lint-staged": {
"*.md": [
"remark --quiet --output --",
"prettier --write --no-error-on-unmatched-pattern"
],
"*.json": [
"prettier --write --no-error-on-unmatched-pattern"
],
"*.{js,jsx}": [
"prettier --write",
"eslint --fix"
],
"*.{ts,tsx}": [
"prettier --parser=typescript --write",
"eslint --fix"
]
},
"dependencies": {
"query-string": "^8",
"ssml-document": "^1"
},
"devDependencies": {
"@commitlint/cli": "^18",
"@lobehub/lint": "latest",
"@types/node": "^20",
"@types/query-string": "^6",
"@types/uuid": "^9",
"@vercel/node": "^3.0.7",
"commitlint": "^18",
"eslint": "^8",
"husky": "^8",
"lint-staged": "^15",
"prettier": "^3",
"remark-cli": "^11",
"semantic-release": "^21",
"typescript": "^5"
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org"
}
}
Loading

0 comments on commit 9961d3a

Please sign in to comment.