Skip to content

Commit

Permalink
refactor: modify controller deps path
Browse files Browse the repository at this point in the history
  • Loading branch information
hexqi committed Feb 28, 2024
1 parent 7b32439 commit de3084c
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 14 deletions.
3 changes: 2 additions & 1 deletion packages/controller/js/canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
*/

import { PAGE_STATUS } from './constants'
import { useEditorInfo, useResource } from '@opentiny/tiny-engine-controller'
import useEditorInfo from '../src/useEditorInfo'
import useResource from '../src/useResource'

export const getCanvasStatus = (data) => {
// 写死ID 待删除
Expand Down
3 changes: 2 additions & 1 deletion packages/controller/js/completion.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
*
*/

import { useCanvas, useResource } from '@opentiny/tiny-engine-controller'
import useCanvas from '../src/useCanvas'
import useResource from '../src/useResource'

const keyWords = [
'state',
Expand Down
2 changes: 1 addition & 1 deletion packages/controller/js/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/

import * as cssTree from 'css-tree'
import { hyphenate } from '@opentiny/tiny-engine-controller/utils'
import { hyphenate } from '../utils'

/**
* 传入 css 字符串,得到以选择器为 Key,css 规则为 value 的 object
Expand Down
4 changes: 3 additions & 1 deletion packages/controller/js/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
*/

import { useHttp } from '@opentiny/tiny-engine-http'
import { usePage, useCanvas, useNotify } from '@opentiny/tiny-engine-controller'
import usePage from '../src/usePage'
import useCanvas from '../src/useCanvas'
import useNotify from '../src/useNotify'
import { isVsCodeEnv } from './environments'
import { generateRouter, generatePage } from './vscodeGenerateFile'

Expand Down
2 changes: 1 addition & 1 deletion packages/controller/js/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import { constants } from '@opentiny/tiny-engine-utils'
import { isDevelopEnv } from './environments'
import { useResource } from '@opentiny/tiny-engine-controller'
import useResource from '../src/useResource'
// prefer old unicode hacks for backward compatibility

const { COMPONENT_NAME } = constants
Expand Down
5 changes: 3 additions & 2 deletions packages/controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"exports": {
".": "./dist/index.js",
"./js/*": "./js/*.js",
"./js/": "./js/",
"./utils": "./dist/utils.js",
"./adapter": "./dist/adapter.js"
},
Expand All @@ -42,7 +42,8 @@
"@opentiny/vue-locale": "~3.10.0",
"@opentiny/vue-renderless": "~3.10.0",
"@vue/shared": "^3.3.4",
"css-tree": "^2.3.1"
"css-tree": "^2.3.1",
"prettier": "2.7.1"
},
"devDependencies": {
"@vitejs/plugin-vue": "^4.2.3",
Expand Down
6 changes: 3 additions & 3 deletions packages/controller/src/useBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import { hyphenate } from '@vue/shared'
import { extend, copyArray } from '@opentiny/vue-renderless/common/object'
import { format } from '@opentiny/vue-renderless/common/date'
import { remove } from '@opentiny/vue-renderless/common/array'
import { getCanvasStatus } from '@opentiny/tiny-engine-controller/js/canvas'
import { ast2String, parseExpression } from '@opentiny/tiny-engine-controller/js/ast'
import { getCssObjectFromStyleStr } from '@opentiny/tiny-engine-controller/js/css'
import { constants } from '@opentiny/tiny-engine-utils'
import { getCanvasStatus } from '../js/canvas'
import { ast2String, parseExpression } from '../js/ast'
import { getCssObjectFromStyleStr } from '../js/css'
import useCanvas from './useCanvas'
import useTranslate from './useTranslate'
import useEditorInfo from './useEditorInfo'
Expand Down
2 changes: 1 addition & 1 deletion packages/controller/src/useResource.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import { reactive } from 'vue'
import { getGlobalConfig } from './globalConfig'
import { useHttp } from '@opentiny/tiny-engine-http'
import { utils, constants } from '@opentiny/tiny-engine-utils'
import { getCanvasStatus } from '@opentiny/tiny-engine-controller/js/canvas'
import { meta as BuiltinComponentMaterials } from '@opentiny/tiny-engine-builtin-component'
import { getCanvasStatus } from '../js/canvas'
import useApp from './useApp'
import useCanvas from './useCanvas'
import useTranslate from './useTranslate'
Expand Down
2 changes: 1 addition & 1 deletion packages/controller/src/useSaveLocal.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/

import { Modal } from '@opentiny/vue'
import { VITE_ORIGIN } from '@opentiny/tiny-engine-controller/js/environments'
import { VITE_ORIGIN } from '../js/environments'
import useCanvas from './useCanvas'
import { getGlobalConfig } from './globalConfig'

Expand Down
5 changes: 3 additions & 2 deletions packages/controller/src/useTranslate.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
import { reactive, ref } from 'vue'
import { useHttp } from '@opentiny/tiny-engine-http'
import { utils } from '@opentiny/tiny-engine-utils'
import { isVsCodeEnv } from '@opentiny/tiny-engine-controller/js/environments'
import { isVsCodeEnv } from '../js/environments'
import { constants } from '@opentiny/tiny-engine-utils'
import { generateI18n } from '@opentiny/tiny-engine-controller/js/vscodeGenerateFile'
import { generateI18n } from '../js/vscodeGenerateFile'
import useResource from './useResource'
import { PROP_DATA_TYPE } from '../utils'
import useCanvas from './useCanvas'

const { HOST_TYPE } = constants
const state = reactive({
Expand Down
3 changes: 3 additions & 0 deletions packages/controller/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ export default defineConfig({
plugins: [vue(), vueJsx()],
publicDir: false,
resolve: {},
define: {
'process.env': {}
},
build: {
cssCodeSplit: false,
lib: {
Expand Down

0 comments on commit de3084c

Please sign in to comment.