Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
yenbekbay committed Oct 20, 2022
0 parents commit e005fa8
Show file tree
Hide file tree
Showing 74 changed files with 13,259 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
**/__generated__/**
**/vendor/**
/demo/.next/**
/demo/public/**
/packages/*/dist
pnpm-lock.yaml
93 changes: 93 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{
"root": true,
"settings": {
"import/resolver": {
"typescript": {
"project": ["demo/tsconfig.json", "packages/*/tsconfig.json"]
}
},
"next": {
"rootDir": "demo/"
},
"react": {
"version": "18.2.0"
},
"tailwindcss": {
"callees": ["twMerge"],
"config": "demo/tailwind.config.js",
"whitelist": ["rvn\\-.*"]
}
},
"plugins": ["codegen", "eslint-comments", "promise", "tailwindcss"],
"extends": [
"next/core-web-vitals",
"plugin:eslint-comments/recommended",
"plugin:promise/recommended",
"plugin:tailwindcss/recommended"
],
"rules": {
"arrow-body-style": "warn",
"object-shorthand": "warn",
"prefer-const": "warn",
"quotes": ["warn", "single", {"avoidEscape": true}],
"codegen/codegen": "warn",
"import/no-unresolved": ["error"],
"eslint-comments/disable-enable-pair": "off",
"eslint-comments/no-unlimited-disable": "off",
"eslint-comments/no-unused-disable": "warn",
"promise/always-return": "off",
"react/jsx-curly-brace-presence": "warn",
"react-hooks/exhaustive-deps": [
"warn",
{
"additionalHooks": "(useUpdateEffect)"
}
]
},
"overrides": [
{
"files": ["**/*.{ts,tsx}"],
"parserOptions": {
"project": ["demo/tsconfig.json", "packages/*/tsconfig.json"]
},
"plugins": ["@typescript-eslint"],
"extends": ["plugin:@typescript-eslint/strict"],
"rules": {
"@typescript-eslint/array-type": ["warn", {"default": "array-simple"}],
"@typescript-eslint/await-thenable": "warn",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/ban-tslint-comment": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/consistent-type-assertions": "warn",
"@typescript-eslint/consistent-type-imports": [
"warn",
{"disallowTypeAnnotations": false}
],
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-extra-semi": "off",
"@typescript-eslint/no-floating-promises": "warn",
"@typescript-eslint/no-for-in-array": "warn",
"no-implied-eval": "off",
"@typescript-eslint/no-implied-eval": "warn",
"@typescript-eslint/no-invalid-void-type": "off",
"@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/no-unnecessary-condition": "off",
"@typescript-eslint/no-unnecessary-type-assertion": "warn",
"@typescript-eslint/no-unsafe-argument": "warn",
"@typescript-eslint/no-unsafe-assignment": "warn",
"@typescript-eslint/no-unsafe-call": "warn",
"@typescript-eslint/no-unsafe-member-access": "warn",
"@typescript-eslint/no-unsafe-return": "warn",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-var-requires": "off",
"require-await": "off",
"@typescript-eslint/require-await": "warn",
"@typescript-eslint/restrict-plus-operands": "warn",
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/unbound-method": "warn"
}
}
]
}
50 changes: 50 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Release
on:
push:
branches:
- main
- next
jobs:
release:
name: Release
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '16.16.0'

- name: Install pnpm
uses: pnpm/[email protected]
id: pnpm-install
with:
version: '7.10.0'
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm run release
45 changes: 45 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
node_modules
.pnp
.pnp.js

# testing
/coverage

# next.js
/demo/.next/
/demo/out/

# production
/demo/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env*.local
.env

# vercel
.vercel

# tailwind
/demo/__generated__/tailwind.css

# package builds
/packages/*/dist

# typescript
*.tsbuildinfo

# eslint
.eslintcache
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16.16.0
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
public-hoist-pattern[]=*babel*
public-hoist-pattern[]=*eslint*
public-hoist-pattern[]=next
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
**/__generated__/**
**/vendor/**
/demo/.next/**
/demo/public/**
/packages/*/dist
pnpm-lock.yaml
40 changes: 40 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[tailwindcss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"css.validate": false,
"editor.insertSpaces": true,
"editor.quickSuggestions": {
"strings": true
},
"editor.rulers": [80],
"editor.tabSize": 2,
"files.associations": {
"*.css": "tailwindcss"
},
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false,
"js/ts.implicitProjectConfig.checkJs": true,
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false,
"typescript.tsdk": "./node_modules/typescript/lib"
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2022 Ayan Yenbekbay <[email protected]> (https://yenbekbay.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# react-visual-novel

[![npm version](https://img.shields.io/npm/v/react-visual-novel.svg)](https://www.npmjs.org/package/react-visual-novel)

🚧 WIP

## License

[MIT License](./LICENSE) © Ayan Yenbekbay
36 changes: 36 additions & 0 deletions demo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env*.local
.env

# vercel
.vercel

# tailwind
/__generated__/tailwind.css
Binary file added demo/assets/images/bg-solid.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions demo/assets/images/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// codegen:start {preset: barrel, include: "./*.{jpg,png,gif}", import: default}
import bgSolidJpg from './bg-solid.jpg'

export {bgSolidJpg}
// codegen:end
4 changes: 4 additions & 0 deletions demo/assets/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// codegen:start {preset: barrel, include: "./{*.{ts,tsx},!(internal)/index.{ts,tsx}}"}
export * from './images/index'
export * from './sounds/index'
// codegen:end
Binary file added demo/assets/sounds/click.mp3
Binary file not shown.
6 changes: 6 additions & 0 deletions demo/assets/sounds/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// codegen:start {preset: barrel, include: "./*.mp3", import: default}
import clickMp3 from './click.mp3'
import mouseoverMp3 from './mouseover.mp3'

export {clickMp3, mouseoverMp3}
// codegen:end
Binary file added demo/assets/sounds/mouseover.mp3
Binary file not shown.
4 changes: 4 additions & 0 deletions demo/custom-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare module '*.mp3' {
const src: string
export default src
}
Loading

0 comments on commit e005fa8

Please sign in to comment.