-
-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: 将@celljs/cli-common中使用了ts-node
的地方,改为使用importx-tsup包进行动态require #211
#212
Merged
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7902fc6
feat: 将@celljs/cli-common改为使用importx-tsup包进行动态require
nailiable a29d312
feat: 添加一个vitesse示例
nailiable 6e03afb
feat: update
nailiable c675340
Merge branch 'main' into main
Groupguanfang 9de824c
feat: update
nailiable f89640b
feat: update
nailiable File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default async () => { | ||
console.log('webpack-hook'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"private": true, | ||
"name": "@celljs/example-vitesse-app", | ||
"keywords": [ | ||
"cell-component" | ||
], | ||
"version": "3.0.0", | ||
"license": "MIT", | ||
"files": [ | ||
"lib", | ||
"src" | ||
], | ||
"dependencies": { | ||
"@celljs/core": "3.0.0", | ||
"@celljs/vue": "3.0.0", | ||
"@celljs/rpc": "3.0.0", | ||
"@celljs/serve-static": "3.0.0", | ||
"vue": "^3.3.4", | ||
"unocss": "^0.63.4", | ||
"vue-router": "^4.4.5" | ||
}, | ||
"devDependencies": { | ||
"@celljs/cli": "3.0.0", | ||
"@celljs/cli-service": "3.0.0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "@celljs/cli-service": "3.0.0", 这个依赖可以不用添加 |
||
"unplugin-auto-import": "^0.18.3", | ||
"@unhead/vue": "^1.11.10", | ||
"unplugin-vue-router": "^0.10.8", | ||
"@unocss/webpack": "^0.63.4", | ||
"unplugin-vue-components": "^0.27.4", | ||
"unplugin-vue-markdown": "^0.26.2", | ||
"markdown-it-link-attributes": "^4.0.1", | ||
"@shikijs/markdown-it": "^1.22.0", | ||
"@types/markdown-it-link-attributes": "^3.0.5", | ||
"@intlify/unplugin-vue-i18n": "^5.2.0" | ||
}, | ||
"scripts": { | ||
"clean": "rimraf lib dist .cell", | ||
"build": "cell build", | ||
"start": "cell serve", | ||
"deploy": "cell deploy -m scf -m test", | ||
"deploy:test": "cell deploy -m scf -m test", | ||
"deploy:pre": "cell deploy -m scf -m pre", | ||
"deploy:prod": "cell deploy -m scf -m prod" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<script setup lang="ts"> | ||
</script> | ||
|
||
<template> | ||
<RouterView /> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* eslint-disable */ | ||
/* prettier-ignore */ | ||
// @ts-nocheck | ||
// noinspection JSUnusedGlobalSymbols | ||
// Generated by unplugin-auto-import | ||
// biome-ignore lint: disable | ||
export {} | ||
declare global { | ||
const EffectScope: typeof import('vue')['EffectScope'] | ||
const computed: typeof import('vue')['computed'] | ||
const createApp: typeof import('vue')['createApp'] | ||
const customRef: typeof import('vue')['customRef'] | ||
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent'] | ||
const defineComponent: typeof import('vue')['defineComponent'] | ||
const effectScope: typeof import('vue')['effectScope'] | ||
const getCurrentInstance: typeof import('vue')['getCurrentInstance'] | ||
const getCurrentScope: typeof import('vue')['getCurrentScope'] | ||
const h: typeof import('vue')['h'] | ||
const inject: typeof import('vue')['inject'] | ||
const isProxy: typeof import('vue')['isProxy'] | ||
const isReactive: typeof import('vue')['isReactive'] | ||
const isReadonly: typeof import('vue')['isReadonly'] | ||
const isRef: typeof import('vue')['isRef'] | ||
const markRaw: typeof import('vue')['markRaw'] | ||
const nextTick: typeof import('vue')['nextTick'] | ||
const onActivated: typeof import('vue')['onActivated'] | ||
const onBeforeMount: typeof import('vue')['onBeforeMount'] | ||
const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave'] | ||
const onBeforeRouteUpdate: typeof import('vue-router')['onBeforeRouteUpdate'] | ||
const onBeforeUnmount: typeof import('vue')['onBeforeUnmount'] | ||
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate'] | ||
const onDeactivated: typeof import('vue')['onDeactivated'] | ||
const onErrorCaptured: typeof import('vue')['onErrorCaptured'] | ||
const onMounted: typeof import('vue')['onMounted'] | ||
const onRenderTracked: typeof import('vue')['onRenderTracked'] | ||
const onRenderTriggered: typeof import('vue')['onRenderTriggered'] | ||
const onScopeDispose: typeof import('vue')['onScopeDispose'] | ||
const onServerPrefetch: typeof import('vue')['onServerPrefetch'] | ||
const onUnmounted: typeof import('vue')['onUnmounted'] | ||
const onUpdated: typeof import('vue')['onUpdated'] | ||
const onWatcherCleanup: typeof import('vue')['onWatcherCleanup'] | ||
const provide: typeof import('vue')['provide'] | ||
const reactive: typeof import('vue')['reactive'] | ||
const readonly: typeof import('vue')['readonly'] | ||
const ref: typeof import('vue')['ref'] | ||
const resolveComponent: typeof import('vue')['resolveComponent'] | ||
const shallowReactive: typeof import('vue')['shallowReactive'] | ||
const shallowReadonly: typeof import('vue')['shallowReadonly'] | ||
const shallowRef: typeof import('vue')['shallowRef'] | ||
const toRaw: typeof import('vue')['toRaw'] | ||
const toRef: typeof import('vue')['toRef'] | ||
const toRefs: typeof import('vue')['toRefs'] | ||
const toValue: typeof import('vue')['toValue'] | ||
const triggerRef: typeof import('vue')['triggerRef'] | ||
const unref: typeof import('vue')['unref'] | ||
const useAttrs: typeof import('vue')['useAttrs'] | ||
const useCssModule: typeof import('vue')['useCssModule'] | ||
const useCssVars: typeof import('vue')['useCssVars'] | ||
const useId: typeof import('vue')['useId'] | ||
const useModel: typeof import('vue')['useModel'] | ||
const useRoute: typeof import('vue-router')['useRoute'] | ||
const useRouter: typeof import('vue-router')['useRouter'] | ||
const useSlots: typeof import('vue')['useSlots'] | ||
const useTemplateRef: typeof import('vue')['useTemplateRef'] | ||
const watch: typeof import('vue')['watch'] | ||
const watchEffect: typeof import('vue')['watchEffect'] | ||
const watchPostEffect: typeof import('vue')['watchPostEffect'] | ||
const watchSyncEffect: typeof import('vue')['watchSyncEffect'] | ||
} | ||
// for type re-export | ||
declare global { | ||
// @ts-ignore | ||
export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue' | ||
import('vue') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* eslint-disable */ | ||
// @ts-nocheck | ||
// Generated by unplugin-vue-components | ||
// Read more: https://github.com/vuejs/core/pull/3399 | ||
export {} | ||
|
||
/* prettier-ignore */ | ||
declare module 'vue' { | ||
export interface GlobalComponents { | ||
HelloWorld: typeof import('./components/HelloWorld.vue')['default'] | ||
RouterLink: typeof import('vue-router')['RouterLink'] | ||
RouterView: typeof import('vue-router')['RouterView'] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<template> | ||
Hello World | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { createApp } from 'vue'; | ||
import { App } from '@celljs/vue'; | ||
import Root from './App.vue' | ||
import router from './router' | ||
|
||
@App(createApp(Root).use(router)) | ||
export default class {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import './main'; | ||
import { autoBind } from '@celljs/core'; | ||
|
||
export default autoBind(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<script setup lang="tsx"></script> | ||
|
||
<template> | ||
<div> | ||
404 Page | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
title: About | ||
--- | ||
|
||
<div class="text-center"> | ||
<!-- You can use Vue components inside markdown --> | ||
<div i-carbon-dicom-overlay class="text-4xl -mb-6 m-auto" /> | ||
<h3>About</h3> | ||
</div> | ||
|
||
[Vitesse](https://github.com/antfu/vitesse) is an opinionated [Vite](https://github.com/vitejs/vite) starter template made by [@antfu](https://github.com/antfu) for mocking apps swiftly. With **file-based routing**, **components auto importing**, **markdown support**, I18n, PWA and uses **UnoCSS** for styling and icons. | ||
|
||
```js | ||
// syntax highlighting example | ||
function vitesse() { | ||
const foo = 'bar' | ||
console.log(foo) | ||
} | ||
``` | ||
|
||
Check out the [GitHub repo](https://github.com/antfu/vitesse) for more details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<script setup lang="ts"> | ||
</script> | ||
|
||
<template></template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<script setup lang="ts"> | ||
const router = useRouter() | ||
</script> | ||
|
||
<template> | ||
<div> | ||
Index Page | ||
<button @click="router.push('/')">跳转到首页</button> | ||
<HelloWorld /> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { createRouter, createWebHistory } from 'vue-router' | ||
import { routes } from 'vue-router/auto-routes' | ||
|
||
export default createRouter({ | ||
history: createWebHistory(), | ||
routes, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/// <reference types="unplugin-vue-router/client" /> | ||
|
||
declare module '*.vue' { | ||
import type { DefineComponent } from 'vue' | ||
|
||
const component: DefineComponent<{}, {}, unknown> | ||
export default component | ||
} | ||
|
||
declare module '*.svg' | ||
declare module '*.png' | ||
declare module '*.jpg' | ||
declare module '*.jpeg' | ||
declare module '*.gif' | ||
declare module '*.bmp' | ||
declare module '*.tiff' | ||
|
||
|
||
declare module 'vue-router/auto-routes' { | ||
export const routes: any | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* eslint-disable */ | ||
/* prettier-ignore */ | ||
// @ts-nocheck | ||
// Generated by unplugin-vue-router. ‼️ DO NOT MODIFY THIS FILE ‼️ | ||
// It's recommended to commit this file. | ||
// Make sure to add this file to your tsconfig.json file as an "includes" or "files" entry. | ||
|
||
declare module 'vue-router/auto-routes' { | ||
import type { | ||
RouteRecordInfo, | ||
ParamValue, | ||
ParamValueOneOrMore, | ||
ParamValueZeroOrMore, | ||
ParamValueZeroOrOne, | ||
} from 'vue-router' | ||
|
||
/** | ||
* Route name map generated by unplugin-vue-router | ||
*/ | ||
export interface RouteNamedMap { | ||
'/': RouteRecordInfo<'/', '/', Record<never, never>, Record<never, never>>, | ||
'/[...all]': RouteRecordInfo<'/[...all]', '/:all(.*)', { all: ParamValue<true> }, { all: ParamValue<false> }>, | ||
'/about': RouteRecordInfo<'/about', '/about', Record<never, never>, Record<never, never>>, | ||
'/hi/[name]': RouteRecordInfo<'/hi/[name]', '/hi/:name', { name: ParamValue<true> }, { name: ParamValue<false> }>, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export const WelcomeServer = Symbol('WelcomeServer'); | ||
|
||
export interface WelcomeServer { | ||
say(): Promise<string>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import './welcome-server'; | ||
import { autoBind } from '@celljs/core'; | ||
|
||
export default autoBind(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { WelcomeServer } from '../common/welcome-protocol'; | ||
import { Rpc } from '@celljs/rpc'; | ||
|
||
@Rpc(WelcomeServer) | ||
export class WelcomeServerImpl implements WelcomeServer { | ||
say(): Promise<string> { | ||
return Promise.resolve('Welcome to Cell'); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} else return obj; 改成如下:
} else {
return obj;
}