feat: add initial turbo cli

This commit is contained in:
ndom91 2024-07-01 18:47:43 +02:00
parent b8e51eeeee
commit b46c2c4d5b
No known key found for this signature in database
21 changed files with 112 additions and 61 deletions

1
.gitignore vendored
View File

@ -23,6 +23,7 @@ dist
dist-ssr dist-ssr
*.local *.local
.turbo
build build
.svelte-kit .svelte-kit
package package

View File

@ -8,7 +8,8 @@
}, },
"packageManager": "pnpm@9.2.0", "packageManager": "pnpm@9.2.0",
"scripts": { "scripts": {
"dev": "vite dev", "dev": "tauri dev",
"vite:dev": "vite dev",
"test": "vitest run --mode development", "test": "vitest run --mode development",
"test:watch": "vitest --watch --mode development", "test:watch": "vitest --watch --mode development",
"test:e2e": "playwright test -c ./playwright.config.ts", "test:e2e": "playwright test -c ./playwright.config.ts",

View File

@ -19,7 +19,8 @@
getRemoteCommits getRemoteCommits
} from '$lib/vbranches/contexts'; } from '$lib/vbranches/contexts';
import { BaseBranch, Branch } from '$lib/vbranches/types'; import { BaseBranch, Branch } from '$lib/vbranches/types';
import { LineManagerFactory, LineGroup } from '@gitbutler/ui'; import LineGroup from '@gitbutler/ui/CommitLines/LineGroup.svelte';
import { LineManagerFactory } from '@gitbutler/ui/CommitLines/lineManager';
import { goto } from '$app/navigation'; import { goto } from '$app/navigation';
export let isUnapplied: boolean; export let isUnapplied: boolean;

View File

@ -1,5 +1,5 @@
import type { AnyCommit } from '$lib/vbranches/types'; import type { AnyCommit } from '$lib/vbranches/types';
import type { CommitData, Author } from '@gitbutler/ui'; import type { CommitData, Author } from '@gitbutler/ui/CommitLines/types';
export function transformAnyCommit(anyCommit: AnyCommit): CommitData { export function transformAnyCommit(anyCommit: AnyCommit): CommitData {
const output = pullCommitDetails(anyCommit); const output = pullCommitDetails(anyCommit);

View File

@ -22,7 +22,7 @@
import { createKeybind } from '$lib/utils/hotkeys'; import { createKeybind } from '$lib/utils/hotkeys';
import { initTheme } from '$lib/utils/theme'; import { initTheme } from '$lib/utils/theme';
import { unsubscribe } from '$lib/utils/unsubscribe'; import { unsubscribe } from '$lib/utils/unsubscribe';
import { LineManagerFactory } from '@gitbutler/ui'; import { LineManagerFactory } from '@gitbutler/ui/CommitLines/lineManager';
import { onMount, setContext } from 'svelte'; import { onMount, setContext } from 'svelte';
import { Toaster } from 'svelte-french-toast'; import { Toaster } from 'svelte-french-toast';
import type { LayoutData } from './$types'; import type { LayoutData } from './$types';

View File

@ -11,7 +11,7 @@ import { GitHubService } from '$lib/github/service';
import { RemotesService } from '$lib/remotes/service'; import { RemotesService } from '$lib/remotes/service';
import { UserService } from '$lib/stores/user'; import { UserService } from '$lib/stores/user';
import { mockTauri } from '$lib/testing/index'; import { mockTauri } from '$lib/testing/index';
import { LineManagerFactory } from '@gitbutler/ui'; import { LineManagerFactory } from '@gitbutler/ui/CommitLines/lineManager';
import lscache from 'lscache'; import lscache from 'lscache';
import { BehaviorSubject, config } from 'rxjs'; import { BehaviorSubject, config } from 'rxjs';
import { env } from '$env/dynamic/public'; import { env } from '$env/dynamic/public';

View File

@ -5,9 +5,10 @@
"engines": { "engines": {
"node": ">=20.11" "node": ">=20.11"
}, },
"type": "module",
"packageManager": "pnpm@9.2.0", "packageManager": "pnpm@9.2.0",
"scripts": { "scripts": {
"dev": "pnpm --filter @gitbutler/app run dev", "dev": "turbo run dev",
"dev:ui": "pnpm --filter @gitbutler/ui dev", "dev:ui": "pnpm --filter @gitbutler/ui dev",
"dev:tauri": "pnpm tauri dev", "dev:tauri": "pnpm tauri dev",
"test": "pnpm --filter @gitbutler/app run test", "test": "pnpm --filter @gitbutler/app run test",
@ -18,7 +19,7 @@
"build:app:development": "pnpm --filter @gitbutler/app run build:development", "build:app:development": "pnpm --filter @gitbutler/app run build:development",
"check": "pnpm --filter @gitbutler/app run check", "check": "pnpm --filter @gitbutler/app run check",
"tauri": "tauri", "tauri": "tauri",
"lint": "prettier --check . && eslint .", "lint": "turbo run lint",
"format": "prettier --write .", "format": "prettier --write .",
"fix": "eslint --fix .", "fix": "eslint --fix .",
"prepare": "pnpm --filter @gitbutler/app run prepare", "prepare": "pnpm --filter @gitbutler/app run prepare",
@ -39,6 +40,7 @@
"prettier": "^3.3.2", "prettier": "^3.3.2",
"prettier-plugin-svelte": "^3.2.4", "prettier-plugin-svelte": "^3.2.4",
"svelte-eslint-parser": "^0.39.2", "svelte-eslint-parser": "^0.39.2",
"turbo": "^2.0.6",
"typescript": "5.4.5", "typescript": "5.4.5",
"typescript-eslint": "^7.13.1" "typescript-eslint": "^7.13.1"
} }

View File

@ -42,30 +42,17 @@
"peerDependencies": { "peerDependencies": {
"svelte": "^4.0.0 || ^5.0.0-0" "svelte": "^4.0.0 || ^5.0.0-0"
}, },
"publishConfig": {
"types": "./dist/types.d.ts",
"exports": { "exports": {
".": { "./CommitLines/*": {
"types": "./dist/types.d.ts", "svelte": "./dist/CommitLines/*.svelte",
"svelte": "./dist/index.js", "import": "./dist/CommitLines/*.svelte",
"default": "./dist/index.js" "types": "./dist/CommitLines/*.svelte.d.ts"
} }
}, },
"typesVersions": { "typesVersions": {
">4.0": { ">4.0": {
"types.d.ts": [ "./*": ["./dist/components/*.d.ts"]
"./dist/types.d.ts"
]
} }
}
},
"exports": {
".": {
"types": "./dist/types.d.ts",
"svelte": "./dist/index.js",
"default": "./dist/index.js"
},
"./*": "./dist/*"
}, },
"files": [ "files": [
"./dist/**/*.svelte", "./dist/**/*.svelte",

View File

@ -1,21 +0,0 @@
// This file defines the short path imports for the package (ex: @gitbutler/ui/*)
// export type {
// Color,
// Style,
// CommitNode,
// BaseNode,
// Line,
// LineGroup as LineGroupSettings,
// Author,
// CommitData
// } from './components/CommitLines/types.ts';
export { LineManager, LineManagerFactory } from './components/CommitLines/lineManager';
export { default as LineGroup } from './components/CommitLines/LineGroup.svelte';
export { default as Line } from './components/CommitLines/Line.svelte';
export { default as CommitNode } from './components/CommitLines/CommitNode.svelte';
export { default as Cell } from './components/CommitLines/Cell.svelte';
export { default as BaseNode } from './components/CommitLines/BaseNode.svelte';
export { default as Fork } from './components/CommitLines/Cell/Fork.svelte';
export { default as Straight } from './components/CommitLines/Cell/Straight.svelte';

View File

@ -1,10 +0,0 @@
export type {
Color,
Style,
CommitNode,
BaseNode,
Line,
LineGroup as LineGroupSettings,
Author,
CommitData
} from './components/CommitLines/types.ts';

View File

@ -50,6 +50,9 @@ importers:
svelte-eslint-parser: svelte-eslint-parser:
specifier: ^0.39.2 specifier: ^0.39.2
version: 0.39.2(svelte@5.0.0-next.149) version: 0.39.2(svelte@5.0.0-next.149)
turbo:
specifier: ^2.0.6
version: 2.0.6
typescript: typescript:
specifier: 5.4.5 specifier: 5.4.5
version: 5.4.5 version: 5.4.5
@ -5530,6 +5533,40 @@ packages:
peerDependencies: peerDependencies:
typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta'
turbo-darwin-64@2.0.6:
resolution: {integrity: sha512-XpgBwWj3Ggmz/gQVqXdMKXHC1iFPMDiuwugLwSzE7Ih0O13JuNtYZKhQnopvbDQnFQCeRq2Vsm5OTWabg/oB/g==}
cpu: [x64]
os: [darwin]
turbo-darwin-arm64@2.0.6:
resolution: {integrity: sha512-RfeZYXIAkiA21E8lsvfptGTqz/256YD+eI1x37fedfvnHFWuIMFZGAOwJxtZc6QasQunDZ9TRRREbJNI68tkIw==}
cpu: [arm64]
os: [darwin]
turbo-linux-64@2.0.6:
resolution: {integrity: sha512-92UDa0xNQQbx0HdSp9ag3YSS3xPdavhc7q9q9mxIAcqyjjD6VElA4Y85m4F/DDGE5SolCrvBz2sQhVmkOd6Caw==}
cpu: [x64]
os: [linux]
turbo-linux-arm64@2.0.6:
resolution: {integrity: sha512-eQKu6utCVUkIH2kqOzD8OS6E0ba6COjWm6PRDTNCHQRljZW503ycaTUIdMOiJrVg1MkEjDyOReUg8s8D18aJ4Q==}
cpu: [arm64]
os: [linux]
turbo-windows-64@2.0.6:
resolution: {integrity: sha512-+9u4EPrpoeHYCQ46dRcou9kbkSoelhOelHNcbs2d86D6ruYD/oIAHK9qgYK8LeARRz0jxhZIA/dWYdYsxJJWkw==}
cpu: [x64]
os: [win32]
turbo-windows-arm64@2.0.6:
resolution: {integrity: sha512-rdrKL+p+EjtdDVg0wQ/7yTbzkIYrnb0Pw4IKcjsy3M0RqUM9UcEi67b94XOAyTa5a0GqJL1+tUj2ebsFGPgZbg==}
cpu: [arm64]
os: [win32]
turbo@2.0.6:
resolution: {integrity: sha512-/Ftmxd5Mq//a9yMonvmwENNUN65jOVTwhhBPQjEtNZutYT9YKyzydFGLyVM1nzhpLWahQSMamRc/RDBv5EapzA==}
hasBin: true
type-check@0.4.0: type-check@0.4.0:
resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==}
engines: {node: '>= 0.8.0'} engines: {node: '>= 0.8.0'}
@ -12297,6 +12334,33 @@ snapshots:
tslib: 1.14.1 tslib: 1.14.1
typescript: 5.4.5 typescript: 5.4.5
turbo-darwin-64@2.0.6:
optional: true
turbo-darwin-arm64@2.0.6:
optional: true
turbo-linux-64@2.0.6:
optional: true
turbo-linux-arm64@2.0.6:
optional: true
turbo-windows-64@2.0.6:
optional: true
turbo-windows-arm64@2.0.6:
optional: true
turbo@2.0.6:
optionalDependencies:
turbo-darwin-64: 2.0.6
turbo-darwin-arm64: 2.0.6
turbo-linux-64: 2.0.6
turbo-linux-arm64: 2.0.6
turbo-windows-64: 2.0.6
turbo-windows-arm64: 2.0.6
type-check@0.4.0: type-check@0.4.0:
dependencies: dependencies:
prelude-ls: 1.2.1 prelude-ls: 1.2.1

26
turbo.json Normal file
View File

@ -0,0 +1,26 @@
{
"$schema": "https://turborepo.org/schema.json",
"tasks": {
"dev": {
"dependsOn": [
"@gitbutler/app#dev",
"@gitbutler/ui#package"
],
"outputs": ["package/ui/dist/*"],
"cache": false
},
"prepare": {
"cache": false
},
"build": {
"dependsOn": ["@gitbutler/ui#build"],
"outputs": ["build/**"]
},
"preview": {
"cache": false
},
"lint": {
"outputs": []
}
}
}