Skip to content

Commit

Permalink
Divide the repo into workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
baku89 committed Jun 12, 2024
1 parent 8749520 commit e987830
Show file tree
Hide file tree
Showing 42 changed files with 582 additions and 1,017 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ jobs:
- name: Build
uses: borales/actions-yarn@v4
with:
cmd: build:demo
cmd: build:doc

- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload dist repository
path: './demo/dist'
path: './doc/dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ node_modules

lib
*.tsbuildinfo
demo/dist
doc/dist

*.log
.vscode/launch.json
48 changes: 48 additions & 0 deletions core/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"name": "tethr",
"author": "Baku Hashimoto <mail@baku89.com> (https://baku89.com)",
"version": "0.2.0",
"description": "Controlls USB-connected cameras, webcam, and smartphone camera from browser",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"repository": "https://github.com/baku89/tethr",
"sideEffects": false,
"keywords": [
"camera",
"webcam",
"tethered",
"photo",
"gphoto2",
"shooting",
"dslr",
"webusb",
"ptp"
],
"scripts": {
"build": "tsc",
"prepare": "npm run build"
},
"files": [
"lib"
],
"homepage": "https://baku89.github.io/tethr/",
"license": "MIT",
"dependencies": {
"bim": "^1.3.3",
"date-format-parse": "^0.2.7",
"eventemitter3": "^5.0.1",
"lodash": "^4.17.21",
"p-queue": "^8.0.1",
"p-timeout": "^6.1.2",
"sleep-promise": "^9.1.0",
"typescript-memoize": "^1.1.1"
},
"devDependencies": {
"@types/lodash": "^4.14.202",
"@types/w3c-image-capture": "^1.0.10",
"@types/w3c-web-usb": "^1.0.10",
"@typescript-eslint/eslint-plugin": "^6.19.1",
"@typescript-eslint/parser": "^6.19.1",
"linearly": "^0.21.0"
}
}
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.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {BiMap} from 'bim'
import {ConfigDesc} from 'src/Tethr'

import {
ExposureMode,
Expand All @@ -9,6 +8,7 @@ import {
WhiteBalanceTable,
} from '../configs'
import {DatatypeCode, DevicePropCode} from '../PTPDatacode'
import {ConfigDesc} from '../Tethr'
import {TethrPTPUSB} from './TethrPTPUSB'

enum DevicePropCodeRicohTheta {
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.
7 changes: 7 additions & 0 deletions core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "./lib/",
"rootDir": "src",
},
}
13 changes: 0 additions & 13 deletions demo/tsconfig.json

This file was deleted.

File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion demo/index.html → doc/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
Expand Down
23 changes: 23 additions & 0 deletions doc/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "@tethr/doc",
"version": "1.0.0",
"scripts": {
"dev": "vite",
"build": "vite build"
},
"devDependencies": {
"@types/file-saver": "^2.0.7",
"@types/wicg-file-system-access": "^2023.10.4",
"@vitejs/plugin-vue": "^5.0.3",
"@vue/eslint-config-prettier": "^9.0.0",
"@vue/eslint-config-typescript": "^12.0.0",
"@vue/tsconfig": "^0.5.1",
"eslint-plugin-vue": "^9.20.1",
"file-saver": "^2.0.5",
"stylus": "^0.63.0",
"vite": "^5.0.12",
"vue": "^3.4.15",
"vue-tsc": "^1.8.27"
},
"dependencies": {}
}
3 changes: 2 additions & 1 deletion demo/src/App.vue → doc/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@
</template>

<script lang="ts" setup>
import {useTethr} from '@tethr/vue3'
import {saveAs} from 'file-saver'
import {Tethr, TethrObject} from 'tethr'
import {ref, watchEffect} from 'vue'
import TethrConfig from './TethrConfig.vue'
import {useTethr} from './useTethr'
const folderHandler = ref<FileSystemDirectoryHandle | null>(null)
Expand Down Expand Up @@ -274,3 +274,4 @@ dl
button
width 100%
</style>
../../integrations/vue3/useTethr
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions doc/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": ["@vue/tsconfig/tsconfig.dom", "../tsconfig"],
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
"compilerOptions": {
"baseUrl": ".",
"lib": ["esnext", "dom", "dom.iterable"],
"paths": {
"tethr": ["../core/src"],
"@tethr/vue3": ["../integrations/vue3"],
},
},
"references": [{"path": ".."}],
}
3 changes: 2 additions & 1 deletion demo/vite.config.ts → doc/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
tethr: path.resolve('./src'),
tethr: path.resolve('../core/src'),
'@tethr/vue3': path.resolve('../integrations/vue3'),
},
},
define: {
Expand Down
17 changes: 17 additions & 0 deletions integrations/vue3/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "@tethr/vue3",
"version": "1.0.0",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
"build": "tsc",
"prepare": "npm run build"
},
"files": [
"index.js"
],
"dependencies": {
"vue": "^3.0.0",
"tethr": "^0.2.0"
}
}
File renamed without changes.
7 changes: 7 additions & 0 deletions integrations/vue3/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./lib/",
"rootDir": "src",
},
}
75 changes: 12 additions & 63 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,75 +1,24 @@
{
"name": "tethr",
"author": "Baku Hashimoto <mail@baku89.com> (https://baku89.com)",
"version": "0.2.0",
"description": "Tethers USB-connected cameras, webcam, and smartphone camera from browser",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"repository": "https://github.com/baku89/tethr",
"sideEffects": false,
"keywords": [
"camera",
"webcam",
"tethered",
"photo",
"shooting",
"dslr",
"webusb",
"ptp"
],
"name": "@tethr/monorepo",
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "vite serve demo",
"lint": "eslint --fix src --ext .ts --ignore-path .gitignore",
"lint:demo": "eslint --fix demo/src --ext .ts,.vue --ignore-path .gitignore",
"format": "prettier --write src",
"format:demo": "prettier --wite demo/src",
"fix": "npm run format && npm run lint",
"fix:demo": "npm run format:demo && npm run lint:demo",
"build": "tsc --p tsconfig.json",
"build:demo": "vue-tsc --p demo/tsconfig.json --noEmit && vite build demo",
"prepare": "npm run build"
"dev": "npm run dev --w doc",
"build": "npm run build --w core",
"build:doc": "npm run build --w doc"
},
"files": [
"lib"
"workspaces": [
"core",
"doc",
"integrations/*"
],
"homepage": "https://baku89.github.io/tethr/",
"license": "MIT",
"dependencies": {
"bim": "^1.3.3",
"date-format-parse": "^0.2.7",
"eventemitter3": "^5.0.1",
"lodash": "^4.17.21",
"p-queue": "^8.0.1",
"p-timeout": "^6.1.2",
"sleep-promise": "^9.1.0",
"typescript-memoize": "^1.1.1"
},
"devDependencies": {
"@types/file-saver": "^2.0.7",
"@types/lodash": "^4.14.202",
"@types/w3c-image-capture": "^1.0.10",
"@types/w3c-web-usb": "^1.0.10",
"@types/wicg-file-system-access": "^2023.10.4",
"@typescript-eslint/eslint-plugin": "^6.19.1",
"@typescript-eslint/parser": "^6.19.1",
"@vitejs/plugin-vue": "^5.0.3",
"@vue/eslint-config-prettier": "^9.0.0",
"@vue/eslint-config-typescript": "^12.0.0",
"@vue/tsconfig": "^0.5.1",
"typescript": "^5.4.5",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-unused-imports": "^3.0.0",
"eslint-plugin-vue": "^9.20.1",
"file-saver": "^2.0.5",
"linearly": "^0.21.0",
"npm-run-all": "^4.1.5",
"prettier": "^3.2.4",
"stylus": "^0.62.0",
"typescript": "^5.4.5",
"vite": "^5.0.12",
"vue": "^3.4.15",
"vue-tsc": "^1.8.27"
"prettier": "^3.2.4"
}
}
18 changes: 0 additions & 18 deletions tsconfig.common.json

This file was deleted.

19 changes: 14 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
{
"extends": "./tsconfig.common",
"compilerOptions": {
"outDir": "./lib/",
"rootDir": "./src",
"composite": true,
"target": "es2022",
"module": "esnext",
"strict": true,
"importHelpers": true,
"moduleResolution": "node",
"skipLibCheck": true,
"verbatimModuleSyntax": false,
"experimentalDecorators": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"baseUrl": ".",
"lib": ["esnext", "dom", "dom.iterable"]
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules"]
}
Loading

0 comments on commit e987830

Please sign in to comment.