Skip to content

Commit

Permalink
refactor: turborepo with cli and www (#320)
Browse files Browse the repository at this point in the history
* docs: add docs site built with Astro (#300)

* docs: add docs site built with Astro

* docs: prettier

Co-authored-by: Shoubhit Dash <shoubhit2005@gmail.com>

* refactor: make monorepo

* chore(fix): tailwindcss/typography peer deps

* refactor: docusaurus migration

* docs: styling

* fix: linting

* fix: typecheck

* fix: no typecheck www

* fix: restore tsconfig

* fix(ci): cache all node_modules

* fix: more caching

* fix: missing lint plugin

* fix(ci): cwd

* fix(ci): path

* docs: start on collection

* docs: headers

Co-authored-by: Kroucher <99768034+kroucher@users.noreply.github.com>
Co-authored-by: Shoubhit Dash <shoubhit2005@gmail.com>
Co-authored-by: sir-mr-bean <kroucher.1019@gmail.com>
  • Loading branch information
4 people authored Aug 16, 2022
1 parent a9e7621 commit 3bd4482
Show file tree
Hide file tree
Showing 117 changed files with 10,572 additions and 2,606 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
"ignore": ["@ct3a/www"]
}
65 changes: 24 additions & 41 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,54 +1,37 @@
{
"$schema": "http://json.schemastore.org/eslintrc",
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
},
"plugins": ["@typescript-eslint", "import"],
"parser": "@typescript-eslint/parser", // Specifies the ESLint parser
"plugins": ["no-only-tests", "unicorn"],
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:@typescript-eslint/strict",
"plugin:import/recommended",
"plugin:import/typescript",
"prettier"
"plugin:@typescript-eslint/recommended", // Uses the recommended rules from the @typescript-eslint/eslint-plugin
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:prettier/recommended"
],
"env": {
"node": true,
"es6": true
"parserOptions": {
"ecmaVersion": 2018, // Allows for the parsing of modern ECMAScript features
"sourceType": "module", // Allows for the use of import
"project": "./tsconfig.eslint.json" // Allows for the use of rules which require parserServices to be generated
},
"rules": {
"no-shadow": 1,
"import/no-named-as-default": 0,
"import/no-named-as-default-member": 0,
"import/order": [
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"react/react-in-jsx-scope": "off",
"react/prop-types": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-floating-promises": "error",
"no-only-tests/no-only-tests": "error",
"unicorn/filename-case": [
"error",
{
"groups": [
"type",
"builtin",
"external",
"internal",
["parent", "sibling", "index"],
"unknown"
],
"newlines-between": "never",
"alphabetize": {
"order": "asc",
"caseInsensitive": true
},
"warnOnUnassignedImports": true
"case": "camelCase",
"ignore": ["\\.d\\.ts$"]
}
]
},
"settings": {
"import/resolver": {
"typescript": {
"alwaysTryTypes": true,
"project": "./tsconfig.json"
}
"react": {
"version": "18.2.0"
}
},
"ignorePatterns": ["node_modules/", "build/", "dist/"]
}
}
12 changes: 6 additions & 6 deletions .github/workflows/PR-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/cache@v3
id: pnpm-cache
with:
path: node_modules
path: "**/node_modules"
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-node-
Expand All @@ -40,7 +40,7 @@ jobs:
- name: Load node_modules
uses: actions/cache@v3
with:
path: node_modules
path: "**/node_modules"
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Restore ESLint Cache
uses: actions/cache@v3
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:
- name: Load node_modules
uses: actions/cache@v3
with:
path: node_modules
path: "**/node_modules"
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}
- uses: pnpm/action-setup@v2.2.2
with:
Expand All @@ -93,7 +93,7 @@ jobs:
- name: Load node_modules
uses: actions/cache@v3
with:
path: node_modules
path: "**/node_modules"
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}
- uses: pnpm/action-setup@v2.2.2
with:
Expand All @@ -112,7 +112,7 @@ jobs:
- name: Load node_modules
uses: actions/cache@v3
with:
path: node_modules
path: "**/node_modules"
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}
- uses: pnpm/action-setup@v2.2.2
with:
Expand All @@ -123,5 +123,5 @@ jobs:
- run: pnpm build
# has to be scaffolded outside the CLI project so that no lint/tsconfig are leaking
# through. this way it ensures that it is the app's configs that are being used
- run: pnpm start -y ../ci-test-app
- run: cd cli && pnpm start -y ../../ci-test-app
- run: cd ../ci-test-app && pnpm build
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ yarn-error.log*
tmp/
temp/
.eslintcache
.docusaurus

# MAC
._*
.DS_Store
Thumbs.db
Thumbs.db

.vscode
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions cli/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Create T3 App CLI

This is the actual CLI which bootstraps the T3 App.
56 changes: 56 additions & 0 deletions cli/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"name": "create-t3-app",
"version": "5.7.0",
"description": "Create web application with the t3 stack",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/t3-oss/create-t3-app.git",
"directory": "cli"
},
"keywords": [
"create-t3-app",
"init.tips",
"next.js",
"t3-stack",
"tailwind",
"tRPC",
"typescript"
],
"type": "module",
"exports": "./dist/index.js",
"bin": {
"create-t3-app": "./dist/index.js"
},
"engines": {
"node": ">=14.16"
},
"scripts": {
"typecheck": "tsc",
"build": "tsup src/index.ts --format esm --clean --sourcemap --minify --metafile",
"dev": "tsup src/index.ts --format esm --watch --clean --onSuccess \"node dist/index.js\"",
"start": "node dist/index.js",
"check": "pnpm lint && pnpm format:check && pnpm typecheck",
"release": "changeset version",
"pub:beta": "pnpm build && npm publish --tag beta",
"pub:next": "pnpm build && npm publish --tag next",
"pub:release": "pnpm build && npm publish"
},
"dependencies": {
"chalk": "5.0.1",
"commander": "^9.3.0",
"fs-extra": "^10.1.0",
"gradient-string": "^2.0.1",
"inquirer": "^9.0.0",
"ora": "6.1.1"
},
"devDependencies": {
"@types/fs-extra": "^9.0.13",
"@types/gradient-string": "^1.1.2",
"@types/inquirer": "^8.2.1",
"@types/node": "^18.0.0",
"tsup": "^6.1.2",
"type-fest": "^2.14.0",
"typescript": "^4.7.4"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/index.ts → cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import path from "path";
import fs from "fs-extra";
import { PackageJson } from "type-fest";
import { getVersion } from "./utils/getT3Version.js";
import { runCli } from "~/cli/index.js";
import { createProject } from "~/helpers/createProject.js";
import { initializeGit } from "~/helpers/initGit.js";
Expand All @@ -10,7 +11,6 @@ import { buildPkgInstallerMap } from "~/installers/index.js";
import { logger } from "~/utils/logger.js";
import { parseNameAndPath } from "~/utils/parseNameAndPath.js";
import { renderTitle } from "~/utils/renderTitle.js";
import { getVersion } from "./utils/getT3Version.js";

type CT3APackageJSON = PackageJson & {
ct3aMetadata?: {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/installers/index.ts → cli/src/installers/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { PackageManager } from "~/utils/getUserPkgManager.js";
import type { CurriedRunPkgManagerInstallOptions } from "~/utils/runPkgManagerInstall.js";
import { envVariablesInstaller as envVariablesInstaller } from "~/installers/envVars.js";
import { nextAuthInstaller } from "~/installers/next-auth.js";
import { nextAuthInstaller } from "~/installers/nextAuth.js";
import { prismaInstaller } from "~/installers/prisma.js";
import { tailwindInstaller } from "~/installers/tailwind.js";
import { trpcInstaller } from "~/installers/trpc.js";
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions cli/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"baseUrl": "./",
"paths": {
"~/*": ["./src/*"]
}
},
"include": ["src"]
}
58 changes: 22 additions & 36 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-t3-app",
"version": "5.7.0",
"name": "@ct3a/root",
"version": "0.0.0",
"description": "Create web application with the t3 stack",
"author": "Shoubhit Dash <shoubhit2005@gmail.com>",
"maintainers": [
Expand All @@ -20,57 +20,43 @@
"tRPC",
"typescript"
],
"type": "module",
"exports": "./dist/index.js",
"bin": {
"create-t3-app": "./dist/index.js"
},
"engines": {
"node": ">=14.16"
},
"scripts": {
"typecheck": "tsc",
"build": "tsup src/index.ts --format esm --clean --sourcemap --minify --metafile",
"dev": "tsup src/index.ts --format esm --watch --clean --onSuccess \"node dist/index.js\"",
"start": "node dist/index.js",
"lint": "eslint src/ --cache --cache-strategy content",
"lint:fix": "eslint src/ --fix",
"format": "prettier --write \"**/*.{ts,tsx,md,mdx,json,js,mjs,cjs}\"",
"format:check": "prettier --check \"**/*.{ts,tsx,md,mdx,json,js,mjs,cjs}\"",
"typecheck": "turbo run typecheck",
"build": "turbo run build",
"dev": "turbo run dev",
"start": "turbo run start",
"lint": "eslint . --cache --cache-strategy content",
"lint:fix": "pnpm lint --fix",
"format": "prettier --write --plugin-search-dir=. \"**/*.{ts,tsx,md,mdx,json,js,mjs,cjs,astro}\"",
"format:check": "prettier --check --plugin-search-dir=. \"**/*.{ts,tsx,md,mdx,json,js,mjs,cjs,astro}\"",
"check": "pnpm lint && pnpm format:check && pnpm typecheck",
"prepare": "husky install",
"release": "changeset version",
"pub:beta": "pnpm build && npm publish --tag beta",
"pub:next": "pnpm build && npm publish --tag next",
"pub:release": "pnpm build && npm publish"
},
"dependencies": {
"chalk": "5.0.1",
"commander": "^9.3.0",
"fs-extra": "^10.1.0",
"gradient-string": "^2.0.1",
"inquirer": "^9.0.0",
"ora": "6.1.1"
"pub:beta": "cd cli && pnpm pub:bete",
"pub:next": "cd cli && pnpm pub:next",
"pub:release": "cd cli && pnpm pub:release"
},
"devDependencies": {
"@changesets/cli": "^2.24.2",
"@commitlint/cli": "^17.0.3",
"@commitlint/config-conventional": "^17.0.3",
"@types/fs-extra": "^9.0.13",
"@types/gradient-string": "^1.1.2",
"@types/inquirer": "^8.2.1",
"@types/node": "^18.0.0",
"@typescript-eslint/eslint-plugin": "^5.30.0",
"@typescript-eslint/parser": "^5.30.0",
"@typescript-eslint/parser": "^5.33.1",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-import-resolver-typescript": "^3.1.1",
"eslint-plugin-import": "^2.26.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-no-only-tests": "^2.6.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.25.1",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-unicorn": "40.1.0",
"husky": "^8.0.1",
"lint-staged": "^13.0.3",
"prettier": "^2.7.1",
"tsup": "^6.1.2",
"type-fest": "^2.14.0",
"typescript": "^4.7.4"
"prettier-plugin-astro": "^0.5.0",
"turbo": "^1.4.3"
}
}
Loading

1 comment on commit 3bd4482

@vercel
Copy link

@vercel vercel bot commented on 3bd4482 Aug 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

create-t3-app – ./

create-t3-app-git-main-t3-oss.vercel.app
create-t3-app-t3-oss.vercel.app
create-t3-app-nu.vercel.app

Please sign in to comment.