Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

色々変えた #17

Merged
merged 3 commits into from
Dec 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist
vite.config.ts
**/*.ai.js
129 changes: 129 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
{
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": ["eslint:recommended", "plugin:svelte/recommended", "plugin:prettier/recommended"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json",
"ecmaVersion": "latest",
"sourceType": "module",
"extraFileExtensions": [".svelte"],
"ecmaFeatures": {
"globalReturn": false,
"impliedStrict": true
}
},
"plugins": ["@typescript-eslint"],
"overrides": [
{
"files": ["web/**/*.svelte"],
"parser": "svelte-eslint-parser",
"parserOptions": {
"parser": "@typescript-eslint/parser",
"project": "./web/tsconfig.json"
},
"rules": {
"brace-style": ["warn", "1tbs"]
}
},
{
"files": ["web/**/*.ts", "web/*.ts"],
"parserOptions": {
"project": "./web/tsconfig.json"
}
}
],
"rules": {
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/ban-types": "error",
"@typescript-eslint/no-duplicate-enum-values": "error",
"@typescript-eslint/no-duplicate-type-constituents": "warn",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-extra-non-null-assertion": "error",
"@typescript-eslint/no-misused-promises": [
"error",
{
"checksConditionals": false,
"checksSpreads": true,
"checksVoidReturn": false
}
],
"@typescript-eslint/no-for-in-array": "warn",
"no-implied-eval": "off",
"@typescript-eslint/no-implied-eval": "error",
"no-loss-of-precision": "off",
"@typescript-eslint/no-loss-of-precision": "warn",
"@typescript-eslint/no-redundant-type-constituents": "warn",
"@typescript-eslint/no-this-alias": [
"warn",
{
"allowDestructuring": true
}
],
"@typescript-eslint/no-unnecessary-type-constraint": "warn",
"@typescript-eslint/no-unsafe-call": "error",
"@typescript-eslint/no-unsafe-declaration-merging": "error",
"@typescript-eslint/no-unsafe-enum-comparison": "warn",
"@typescript-eslint/no-unsafe-member-access": "error",
"@typescript-eslint/no-unsafe-return": "error",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{
"vars": "all",
"args": "all",
"ignoreRestSiblings": false,
"argsIgnorePattern": "_"
}
],
"@typescript-eslint/no-var-requires": "warn",
"@typescript-eslint/prefer-as-const": "warn",
"require-await": "off",
"@typescript-eslint/require-await": "error",
"@typescript-eslint/triple-slash-reference": "error",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/no-empty-interface": "error",
"no-empty-function": "off",
"@typescript-eslint/no-empty-function": [
"error",
{
"allow": [
"private-constructors",
"protected-constructors",
"constructors",
"decoratedFunctions",
"overrideMethods"
]
}
],
"no-dupe-class-members": "off",
"@typescript-eslint/no-dupe-class-members": "error",
"object-curly-newline": [
"error",
{
"ObjectExpression": { "multiline": true },
"ObjectPattern": { "multiline": true },
"ImportDeclaration": "never",
"ExportDeclaration": "never"
}
],
"brace-style": ["warn", "stroustrup"],
"lines-between-class-members": [
"error",
{
"enforce": [
{ "blankLine": "never", "prev": "field", "next": "field" },
{ "blankLine": "always", "prev": "*", "next": "*" }
]
}
],
"curly": "error",
"semi": ["error", "always"],
"prettier/prettier": "warn",
"no-undef": "off"
}
}
15 changes: 15 additions & 0 deletions .github/workflows/addtag.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

CURRENT=$(curl -s "https://api.github.com/repos/${REPO}/tags" | jq ".[0] | .name" | tr -d '"')
TAG=$(cat package.json | jq ".version" | tr -d '"')
if [ "$CURRENT" == "$TAG" ] ; then
exit 255
fi
echo "add tag: ${TAG}"

curl -s -X POST "https://api.github.com/repos/${REPO}/git/refs" -H "Authorization: token $GITHUB_TOKEN" -d @- << EOS
{
"ref": "refs/tags/${TAG}",
"sha": "${COMMIT}"
}
EOS
62 changes: 62 additions & 0 deletions .github/workflows/deploy-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Deploy npm

on:
push:
branches:
- main
tags:
- '!*'

jobs:
build:
name: Build
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'
always-auth: true

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: latest
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
env:
NODE_ENV: dev
run: pnpm install --frozen-lockfile

- name: Check Lint
run: pnpm lint

- name: add tag
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
REPO: ${{github.repository}}
COMMIT: ${{github.sha}}
run: ./.github/workflows/addtag.sh

- name: publish
run: pnpm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
14 changes: 14 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.DS_Store
node_modules
dist
pnpm-lock.yaml
package.json
package-lock.json
pnpm-workspace.yaml
yarn.lock
tsconfig.json
tsconfig.node.json
.github
.vscode
**/*.ai.js
**/*.ai
28 changes: 28 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"printWidth": 150,
"tabWidth": 2,
"useTabs": true,
"semi": true,
"singleQuote": true,
"quoteProps": "as-needed",
"trailingComma": "es5",
"bracketSpacing": true,
"arrowParens": "always",
"svelteSortOrder": "options-scripts-markup-styles",
"svelteStrictMode": false,
"svelteAllowShorthand": true,
"svelteIndentScriptAndStyle": true,
"plugins": [
"prettier-plugin-svelte",
"prettier-plugin-brace-style"
],
"braceStyle": "stroustrup",
"overrides": [
{
"files": "*.svelte",
"options": {
"parser": "svelte"
}
}
]
}
14 changes: 14 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"prettier.configPath": "./.prettierrc",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"eslint.validate": [
"javascript",
"typescript",
"svelte"
],
"[svelte][typescript]": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
}
}
24 changes: 18 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,28 @@
],
"scripts": {
"test": "cd test && node index.js",
"build": "tsc"
"build": "tsc",
"lint": "eslint --ext .ts,.svelte .",
"fix": "eslint --ext .ts,.svelte --fix .",
"prepublish": "pnpm build"
},
"keywords": [],
"author": "",
"license": "",
"author": "(Fairy)Phy.Secineralyr",
"license": "MIT",
"devDependencies": {
"typescript": "^5.3.2"
"@prettier/sync": "0.3.0",
"@typescript-eslint/eslint-plugin": "6.16.0",
"@typescript-eslint/parser": "6.16.0",
"eslint": "8.56.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-prettier": "5.1.2",
"prettier": "3.1.1",
"prettier-plugin-brace-style": "0.3.2",
"prettier-plugin-merge": "0.4.0",
"typescript": "5.3.2"
},
"dependencies": {
"meriyah": "^4.3.8",
"terser": "^5.24.0"
"acorn": "8.11.2",
"terser": "5.24.0"
}
}
Loading