Skip to content

Commit

Permalink
chore: monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
Novout committed Dec 18, 2021
1 parent e51d0a4 commit 2b15104
Show file tree
Hide file tree
Showing 267 changed files with 10,578 additions and 804 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn
- name: Bootstrap
run: yarn bootstrap
- name: Run tests
run: yarn test
16 changes: 5 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
node_modules
.vscode
.DS_Store
build

node_modules
dist
dist-ssr
*.local
.idea
.vscode
components.d.ts
TODO.md

yarn-error.log
coverage
.yarnrc
.yarn
lerna-debug.log
6 changes: 6 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"packages": ["packages/*"],
"npmClient": "yarn",
"useWorkspaces": true,
"version": "0.10.5"
}
128 changes: 10 additions & 118 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,124 +1,16 @@
{
"name": "better-write",
"version": "0.10.5",
"repository": "https://github.com/Novout/better-write",
"author": {
"name": "Giovane Cardoso",
"email": "novout@hotmail.com",
"url": "https://github.com/Novout"
},
"description": "A editor for creative writers.",
"name": "root",
"private": true,
"workspaces": ["packages/*"],
"scripts": {
"dev": "vite",
"build": "vue-tsc --noEmit && vite build",
"serve": "rimraf ./dist && yarn build && vite preview",
"format": "prettier test/**/*.ts src/**/*.{vue,css,ts} --write",
"test": "jest",
"lint": "eslint --ext .js,.vue --ignore-path .gitignore --fix src && yarn format",
"extract": "vue-i18n-extract report --vueFiles './src/**/*.?(js|vue)' --languageFiles './src/lang/*.?(json|yml|yaml|js)'",
"release:validate": "yarn test && yarn build",
"release:initial": "yarn release:validate && standard-version --first-release",
"release:minor": "yarn release:validate && standard-version --release-as minor",
"release:alpha:minor": "yarn release:validate && standard-version --release-as minor --prerelease alpha",
"release:beta:minor": "yarn release:validate && standard-version --release-as minor --prerelease beta",
"release:patch": "yarn release:validate && standard-version --release-as patch",
"release:alpha:patch": "yarn release:validate && standard-version --release-as patch --prerelease alpha",
"release:beta:patch": "yarn release:validate && standard-version --release-as patch --prerelease beta",
"release:major": "yarn release:validate && standard-version --release-as major",
"release:alpha:major": "yarn release:validate && standard-version --release-as major --prerelease alpha",
"release:beta:major": "yarn release:validate && standard-version --release-as major --prerelease beta",
"release:alpha": "yarn release:validate && standard-version --prerelease alpha",
"release:beta": "yarn release:validate && standard-version --prerelease beta"
},
"dependencies": {
"@headlessui/vue": "1.4.2",
"@tailwindcss/forms": "0.3.4",
"@vuelidate/core": "2.0.0-alpha.32",
"@vuelidate/validators": "2.0.0-alpha.25",
"@vueuse/core": "7.3.0",
"@vueuse/head": "0.7.4",
"@vueuse/integrations": "7.3.0",
"@vueuse/motion": "2.0.0-beta.4",
"autoprefixer": "10.4.0",
"date-fns": "2.27.0",
"docx": "7.2.0",
"dropbox": "10.23.0",
"file-saver": "2.0.5",
"keyboardjs": "2.6.4",
"mitt": "3.0.0",
"pdfmake": "0.2.4",
"pinia": "2.0.6",
"postcss": "8.4.4",
"tailwindcss": "2.2.19",
"tailwindcss-typography": "3.1.0",
"v-tooltip": "4.0.0-beta.2",
"vite-plugin-package-version": "1.0.2",
"vue": "3.2.26",
"vue-i18n": "9.1.9",
"vue-router": "4.0.12",
"vue-toastification": "2.0.0-rc.5",
"vuedraggable": "4.1.0"
"bootstrap": "lerna bootstrap --use-workspaces",
"dev": "lerna exec yarn dev",
"build": "lerna exec yarn build",
"test": "lerna exec yarn test",
"lint": "lerna exec yarn lint",
"deploy": "yarn bootstrap && yarn build"
},
"devDependencies": {
"@intlify/vite-plugin-vue-i18n": "3.2.1",
"@types/file-saver": "2.0.4",
"@types/jest": "27.0.3",
"@types/jsdom": "16.2.13",
"@types/pdfmake": "0.1.19",
"@types/tailwindcss": "2.2.4",
"@typescript-eslint/eslint-plugin": "5.6.0",
"@typescript-eslint/parser": "5.6.0",
"@vitejs/plugin-vue": "1.10.2",
"@vue/compiler-sfc": "3.2.26",
"@vue/eslint-config-typescript": "9.1.0",
"cross-env": "7.0.3",
"eslint": "8.4.1",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-vue": "8.2.0",
"jest": "27.4.3",
"prettier": "2.5.1",
"rimraf": "3.0.2",
"standard-version": "9.3.2",
"ts-jest": "27.1.1",
"typescript": "4.5.2",
"unplugin-vue-components": "0.17.6",
"vite": "2.7.1",
"vite-plugin-optimize-persist": "0.1.1",
"vite-plugin-package-config": "0.1.0",
"vite-plugin-pwa": "0.11.10",
"vue-i18n-extract": "2.0.4",
"vue-tsc": "0.29.8",
"wait-on": "6.0.0"
},
"vite": {
"optimizeDeps": {
"include": [
"@headlessui/vue",
"@vue/reactivity",
"@vueuse/core",
"@vueuse/head",
"@vueuse/integrations",
"@vueuse/motion",
"date-fns",
"date-fns/locale",
"docx",
"dropbox",
"file-saver",
"keyboardjs",
"mitt",
"node-fetch",
"pdfmake/build/pdfmake",
"pinia",
"v-tooltip",
"vue",
"vue-i18n",
"vue-router",
"vue-toastification",
"vuedraggable"
],
"exclude": [
"vue-demi"
]
}
"lerna": "4.0.0"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions packages/better-write-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
node_modules
.DS_Store
build
dist
dist-ssr
*.local
.idea
.vscode
components.d.ts
TODO.md
yarn-error.log
coverage
.yarnrc
.yarn
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
117 changes: 117 additions & 0 deletions packages/better-write-app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
{
"name": "better-write-app",
"version": "0.10.5",
"repository": "https://github.com/Novout/better-write",
"author": {
"name": "Giovane Cardoso",
"email": "novout@hotmail.com",
"url": "https://github.com/Novout"
},
"publishConfig": {
"access": "public"
},
"description": "A editor for creative writers.",
"scripts": {
"dev": "vite",
"build": "vue-tsc --noEmit && vite build",
"serve": "rimraf ./dist && yarn build && vite preview",
"format": "prettier test/**/*.ts src/**/*.{vue,css,ts} --write",
"test": "jest",
"lint": "eslint --ext .js,.vue --ignore-path .gitignore --fix src && yarn format",
"extract": "vue-i18n-extract report --vueFiles './src/**/*.?(js|vue)' --languageFiles './src/lang/*.?(json|yml|yaml|js)'"
},
"dependencies": {
"@headlessui/vue": "1.4.2",
"@tailwindcss/forms": "0.3.4",
"@vuelidate/core": "2.0.0-alpha.32",
"@vuelidate/validators": "2.0.0-alpha.25",
"@vueuse/core": "7.3.0",
"@vueuse/head": "0.7.4",
"@vueuse/integrations": "7.3.0",
"@vueuse/motion": "2.0.0-beta.4",
"autoprefixer": "10.4.0",
"better-write-entity": "*",
"better-write-types": "*",
"better-write-plugin-core": "*",
"date-fns": "2.27.0",
"docx": "7.2.0",
"dropbox": "10.23.0",
"file-saver": "2.0.5",
"keyboardjs": "2.6.4",
"mitt": "3.0.0",
"pdfmake": "0.2.4",
"pinia": "2.0.6",
"postcss": "8.4.4",
"tailwindcss": "2.2.19",
"tailwindcss-typography": "3.1.0",
"v-tooltip": "4.0.0-beta.2",
"vite-plugin-package-version": "1.0.2",
"vue": "3.2.26",
"vue-i18n": "9.1.9",
"vue-router": "4.0.12",
"vue-toastification": "2.0.0-rc.5",
"vuedraggable": "4.1.0"
},
"devDependencies": {
"@intlify/vite-plugin-vue-i18n": "3.2.1",
"@types/file-saver": "2.0.4",
"@types/jest": "27.0.3",
"@types/jsdom": "16.2.13",
"@types/pdfmake": "0.1.19",
"@types/tailwindcss": "2.2.4",
"@typescript-eslint/eslint-plugin": "5.6.0",
"@typescript-eslint/parser": "5.6.0",
"@vitejs/plugin-vue": "1.10.2",
"@vue/compiler-sfc": "3.2.26",
"@vue/eslint-config-typescript": "9.1.0",
"cross-env": "7.0.3",
"eslint": "8.4.1",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-vue": "8.2.0",
"jest": "27.4.3",
"prettier": "2.5.1",
"rimraf": "3.0.2",
"standard-version": "9.3.2",
"ts-jest": "27.1.1",
"typescript": "4.5.2",
"unplugin-vue-components": "0.17.6",
"vite": "2.7.1",
"vite-plugin-optimize-persist": "0.1.1",
"vite-plugin-package-config": "0.1.0",
"vite-plugin-pwa": "0.11.10",
"vue-i18n-extract": "2.0.4",
"vue-tsc": "0.29.8",
"wait-on": "6.0.0"
},
"vite": {
"optimizeDeps": {
"include": [
"@headlessui/vue",
"@vue/reactivity",
"@vueuse/core",
"@vueuse/head",
"@vueuse/integrations",
"@vueuse/motion",
"date-fns",
"date-fns/locale",
"docx",
"dropbox",
"file-saver",
"keyboardjs",
"mitt",
"node-fetch",
"pdfmake/build/pdfmake",
"pinia",
"v-tooltip",
"vue",
"vue-i18n",
"vue-router",
"vue-toastification",
"vuedraggable"
],
"exclude": [
"vue-demi"
]
}
}
}
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
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import { useEditorStore } from '@/store/editor'
import { computed, watch, ref } from 'vue'
import { setEditorLogo } from '@/plugin/theme/external'
import { onAfterMounted } from '@/plugin/core/cycle'
import { Cycle } from 'better-write-plugin-core'
import { useUtils } from '@/use/utils'
const EDITOR = useEditorStore()
Expand All @@ -33,7 +33,7 @@
const path = ref(utils.path().resolve('logo_default.svg'))
const theme = computed(() => EDITOR.configuration.theme)
onAfterMounted(() => {
Cycle.onAfterMounted(() => {
path.value = setEditorLogo(theme.value)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
import { useProjectStore } from '@/store/project'
import { useEditorStore } from '@/store/editor'
import { useAbsoluteStore } from '@/store/absolute'
import usePlugin from '@/use/plugin/core'
import { usePlugin } from 'better-write-plugin-core'
import { ID } from '@/types/utils'
import { useUtils } from '@/use/utils'
import { useMagicKeys } from '@vueuse/core'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,12 +491,12 @@
import { EntityType } from '@/types/context'
import { useContextStore } from '@/store/context'
import { Entity } from '@/types/context'
import usePlugin from '@/use/plugin/core'
import useEmitter from '@/use/emitter'
import { useEditorStore } from '@/store/editor'
import { useAbsoluteStore } from '@/store/absolute'
import { useEntity } from '@/use/entity'
import { useRaw } from '@/use/raw'
import { usePlugin } from 'better-write-plugin-core'
const props = defineProps({
entity: {
Expand Down
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
Expand Up @@ -105,9 +105,9 @@
<script setup lang="ts">
import { ContextState } from '@/types/context'
import { ProjectTypeID } from '@/types/project'
import usePlugin from '@/use/plugin/core'
import { useRaw } from '@/use/raw'
import { useCreativeType } from '@/use/type/creative'
import { usePlugin } from 'better-write-plugin-core'
import { ref, watch, nextTick } from 'vue'
const creative = useCreativeType()
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.
12 changes: 6 additions & 6 deletions src/main.ts → packages/better-write-app/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { createApp } from 'vue'
import { createHead } from '@vueuse/head'
import { createPinia } from 'pinia'
import { createEditor } from 'better-write-entity'
import { createPluginCore } from 'better-write-plugin-core'
import { MotionPlugin as motion } from '@vueuse/motion'
import tooltip from 'v-tooltip'
import toast, { POSITION } from 'vue-toastification'
import mitt from 'mitt'

import { PluginEmitter } from './types/plugin/core'
import { VueEmitter } from './types/emitter'
import { plugin as PluginBase } from './types/plugin/emitter'

import router from './router'
import i18n from './lang'
Expand All @@ -23,18 +22,19 @@ import 'vue-toastification/dist/index.css'
const app = createApp(App)
const head = createHead()
const store = createPinia()

const editor = createEditor()
const core = createPluginCore()
const emitter = mitt()
const plugin = PluginBase()

app.config.globalProperties.emitter = emitter as VueEmitter
app.config.globalProperties.plugin = plugin as PluginEmitter

app.use(router)
app.use(store)
app.use(i18n)
app.use(motion)
app.use(head)
app.use(editor)
app.use(core)
app.use(tooltip, {
themes: {
'better-write': {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 2b15104

Please sign in to comment.