mirror of
https://github.com/movie-web/native-app.git
synced 2025-09-13 11:23:24 +00:00
refactor to turbo
This commit is contained in:
43
tooling/eslint/base.js
Normal file
43
tooling/eslint/base.js
Normal file
@@ -0,0 +1,43 @@
|
||||
/** @type {import("eslint").Linter.Config} */
|
||||
const config = {
|
||||
extends: [
|
||||
"turbo",
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/recommended-type-checked",
|
||||
"plugin:@typescript-eslint/stylistic-type-checked",
|
||||
"prettier",
|
||||
],
|
||||
env: {
|
||||
es2022: true,
|
||||
node: true,
|
||||
},
|
||||
parser: "@typescript-eslint/parser",
|
||||
parserOptions: { project: true },
|
||||
plugins: ["@typescript-eslint", "import"],
|
||||
rules: {
|
||||
"turbo/no-undeclared-env-vars": "off",
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"error",
|
||||
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
|
||||
],
|
||||
"@typescript-eslint/consistent-type-imports": [
|
||||
"warn",
|
||||
{ prefer: "type-imports", fixStyle: "separate-type-imports" },
|
||||
],
|
||||
"@typescript-eslint/no-misused-promises": [
|
||||
2,
|
||||
{ checksVoidReturn: { attributes: false } },
|
||||
],
|
||||
"import/consistent-type-specifier-style": ["error", "prefer-top-level"],
|
||||
},
|
||||
ignorePatterns: [
|
||||
"**/*.config.js",
|
||||
"**/*.config.cjs",
|
||||
"**/.eslintrc.cjs",
|
||||
"dist",
|
||||
"pnpm-lock.yaml",
|
||||
],
|
||||
reportUnusedDisableDirectives: true,
|
||||
};
|
||||
|
||||
module.exports = config;
|
41
tooling/eslint/package.json
Normal file
41
tooling/eslint/package.json
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"name": "@movie-web/eslint-config",
|
||||
"version": "0.2.0",
|
||||
"private": true,
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"./base.js",
|
||||
"./react.js"
|
||||
],
|
||||
"scripts": {
|
||||
"clean": "rm -rf .turbo node_modules",
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"lint": "eslint .",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "^6.19.1",
|
||||
"@typescript-eslint/parser": "^6.19.1",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-config-turbo": "^1.11.3",
|
||||
"eslint-plugin-import": "^2.29.1",
|
||||
"eslint-plugin-jsx-a11y": "^6.8.0",
|
||||
"eslint-plugin-react": "^7.33.2",
|
||||
"eslint-plugin-react-hooks": "^4.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@movie-web/prettier-config": "workspace:^0.1.0",
|
||||
"@movie-web/tsconfig": "workspace:^0.1.0",
|
||||
"@types/eslint": "^8.56.2",
|
||||
"eslint": "^8.56.0",
|
||||
"prettier": "^3.1.1",
|
||||
"typescript": "^5.3.3"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
"extends": [
|
||||
"./base.js"
|
||||
]
|
||||
},
|
||||
"prettier": "@movie-web/prettier-config"
|
||||
}
|
24
tooling/eslint/react.js
vendored
Normal file
24
tooling/eslint/react.js
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
/** @type {import('eslint').Linter.Config} */
|
||||
const config = {
|
||||
extends: [
|
||||
"plugin:react/recommended",
|
||||
"plugin:react-hooks/recommended",
|
||||
"plugin:jsx-a11y/recommended",
|
||||
],
|
||||
rules: {
|
||||
"react/prop-types": "off",
|
||||
},
|
||||
globals: {
|
||||
React: "writable",
|
||||
},
|
||||
settings: {
|
||||
react: {
|
||||
version: "detect",
|
||||
},
|
||||
},
|
||||
env: {
|
||||
browser: true,
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = config;
|
8
tooling/eslint/tsconfig.json
Normal file
8
tooling/eslint/tsconfig.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "@movie-web/tsconfig/base.json",
|
||||
"compilerOptions": {
|
||||
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
|
||||
},
|
||||
"include": ["."],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
3
tooling/github/package.json
Normal file
3
tooling/github/package.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"name": "@movie-web/github"
|
||||
}
|
17
tooling/github/setup/action.yml
Normal file
17
tooling/github/setup/action.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
name: "Setup and install"
|
||||
description: "Common setup steps for Actions"
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- uses: pnpm/action-setup@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
cache: "pnpm"
|
||||
|
||||
- shell: bash
|
||||
run: pnpm add -g turbo
|
||||
|
||||
- shell: bash
|
||||
run: pnpm install
|
35
tooling/prettier/index.js
Normal file
35
tooling/prettier/index.js
Normal file
@@ -0,0 +1,35 @@
|
||||
import { fileURLToPath } from "url";
|
||||
|
||||
/** @typedef {import("prettier").Config} PrettierConfig */
|
||||
/** @typedef {import("prettier-plugin-tailwindcss").PluginOptions} TailwindConfig */
|
||||
/** @typedef {import("@ianvs/prettier-plugin-sort-imports").PluginConfig} SortImportsConfig */
|
||||
|
||||
/** @type { PrettierConfig | SortImportsConfig | TailwindConfig } */
|
||||
const config = {
|
||||
plugins: [
|
||||
"@ianvs/prettier-plugin-sort-imports",
|
||||
"prettier-plugin-tailwindcss",
|
||||
],
|
||||
tailwindConfig: fileURLToPath(
|
||||
new URL("../../tooling/tailwind/web.ts", import.meta.url),
|
||||
),
|
||||
tailwindFunctions: ["cn", "cva"],
|
||||
importOrder: [
|
||||
"<TYPES>",
|
||||
"^(react/(.*)$)|^(react$)|^(react-native(.*)$)",
|
||||
"^(expo(.*)$)|^(expo$)",
|
||||
"<THIRD_PARTY_MODULES>",
|
||||
"",
|
||||
"<TYPES>^@movie-web",
|
||||
"^@movie-web/(.*)$",
|
||||
"",
|
||||
"<TYPES>^[.|..|~]",
|
||||
"^~/",
|
||||
"^[../]",
|
||||
"^[./]",
|
||||
],
|
||||
importOrderParserPlugins: ["typescript", "jsx", "decorators-legacy"],
|
||||
importOrderTypeScriptVersion: "4.4.0",
|
||||
};
|
||||
|
||||
export default config;
|
24
tooling/prettier/package.json
Normal file
24
tooling/prettier/package.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "@movie-web/prettier-config",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": "./index.js"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rm -rf .turbo node_modules",
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ianvs/prettier-plugin-sort-imports": "^4.1.1",
|
||||
"prettier": "^3.1.1",
|
||||
"prettier-plugin-tailwindcss": "^0.5.10"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@movie-web/tsconfig": "workspace:^0.1.0",
|
||||
"typescript": "^5.3.3"
|
||||
},
|
||||
"prettier": "@movie-web/prettier-config"
|
||||
}
|
8
tooling/prettier/tsconfig.json
Normal file
8
tooling/prettier/tsconfig.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "@movie-web/tsconfig/base.json",
|
||||
"compilerOptions": {
|
||||
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
|
||||
},
|
||||
"include": ["."],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
12
tooling/tailwind/base.ts
Normal file
12
tooling/tailwind/base.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import type { Config } from "tailwindcss";
|
||||
|
||||
import colors from "./colors";
|
||||
|
||||
export default {
|
||||
content: ["src/**/*.{ts,tsx}"],
|
||||
theme: {
|
||||
extend: {
|
||||
colors,
|
||||
},
|
||||
},
|
||||
} satisfies Config;
|
14
tooling/tailwind/colors.ts
Normal file
14
tooling/tailwind/colors.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
export default {
|
||||
primary: {
|
||||
100: "#C082FF",
|
||||
300: "#8D44D6",
|
||||
400: "#7831BF",
|
||||
},
|
||||
secondary: {
|
||||
50: "#676790",
|
||||
200: "#3F3F60",
|
||||
300: "#32324F",
|
||||
700: "#131322",
|
||||
},
|
||||
background: "#0a0a12",
|
||||
};
|
9
tooling/tailwind/native.ts
Normal file
9
tooling/tailwind/native.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import type { Config } from "tailwindcss";
|
||||
|
||||
import base from "./base";
|
||||
|
||||
export default {
|
||||
content: base.content,
|
||||
presets: [base],
|
||||
theme: {},
|
||||
} satisfies Config;
|
39
tooling/tailwind/package.json
Normal file
39
tooling/tailwind/package.json
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"name": "@movie-web/tailwind-config",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"exports": {
|
||||
"./native": "./native.ts",
|
||||
"./web": "./web.ts",
|
||||
"./colors": "./colors.ts"
|
||||
},
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"clean": "rm -rf .turbo node_modules",
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"lint": "eslint .",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"autoprefixer": "^10.4.17",
|
||||
"postcss": "^8.4.32",
|
||||
"tailwindcss": "^3.4.0",
|
||||
"tailwindcss-animate": "^1.0.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@movie-web/eslint-config": "workspace:^0.2.0",
|
||||
"@movie-web/prettier-config": "workspace:^0.1.0",
|
||||
"@movie-web/tsconfig": "workspace:^0.1.0",
|
||||
"eslint": "^8.56.0",
|
||||
"prettier": "^3.1.1",
|
||||
"typescript": "^5.3.3"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
"extends": [
|
||||
"@movie-web/eslint-config/base"
|
||||
]
|
||||
},
|
||||
"prettier": "@movie-web/prettier-config"
|
||||
}
|
8
tooling/tailwind/tsconfig.json
Normal file
8
tooling/tailwind/tsconfig.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "@movie-web/tsconfig/base.json",
|
||||
"compilerOptions": {
|
||||
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
|
||||
},
|
||||
"include": ["."],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
40
tooling/tailwind/web.ts
Normal file
40
tooling/tailwind/web.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import type { Config } from "tailwindcss";
|
||||
import animate from "tailwindcss-animate";
|
||||
|
||||
import base from "./base";
|
||||
|
||||
export default {
|
||||
content: base.content,
|
||||
presets: [base],
|
||||
theme: {
|
||||
container: {
|
||||
center: true,
|
||||
padding: "2rem",
|
||||
screens: {
|
||||
"2xl": "1400px",
|
||||
},
|
||||
},
|
||||
extend: {
|
||||
borderRadius: {
|
||||
lg: "var(--radius)",
|
||||
md: "calc(var(--radius) - 2px)",
|
||||
sm: "calc(var(--radius) - 4px)",
|
||||
},
|
||||
keyframes: {
|
||||
"accordion-down": {
|
||||
from: { height: "0" },
|
||||
to: { height: "var(--radix-accordion-content-height)" },
|
||||
},
|
||||
"accordion-up": {
|
||||
from: { height: "var(--radix-accordion-content-height)" },
|
||||
to: { height: "0" },
|
||||
},
|
||||
},
|
||||
animation: {
|
||||
"accordion-down": "accordion-down 0.2s ease-out",
|
||||
"accordion-up": "accordion-up 0.2s ease-out",
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [animate],
|
||||
} satisfies Config;
|
21
tooling/typescript/base.json
Normal file
21
tooling/typescript/base.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"lib": ["dom", "dom.iterable", "ES2022"],
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
"strict": true,
|
||||
"noEmit": true,
|
||||
"esModuleInterop": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "Bundler",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"moduleDetection": "force",
|
||||
"jsx": "preserve",
|
||||
"incremental": true,
|
||||
"noUncheckedIndexedAccess": true
|
||||
},
|
||||
"exclude": ["node_modules", "build", "dist", ".expo"]
|
||||
}
|
8
tooling/typescript/package.json
Normal file
8
tooling/typescript/package.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"name": "@movie-web/tsconfig",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"files": [
|
||||
"base.json"
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user