Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ jobs:
run: |
yarn install --immutable
yarn run init
yarn run update-package -v ${{ github.event.inputs.version }}

- name: Setup .yarnrc.yml
run: |
Expand All @@ -95,14 +94,6 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

# 非 main 分支发布时,需要提交各 package 里的 version 变更
- name: Commit Files Before Push Release Branch
if: github.event.ref != 'refs/heads/main' && github.event.inputs.release_branch == ''
run: |
git add -A
git commit -m 'chore: update package version to v${{github.event.inputs.version}}'
git push origin ${{ github.event.inputs.release_branch }}

# 非 main 分支发布时,自动推送代码到对应分支并打 Tag
- name: Publish Prod Version
if: steps.checkTag.outputs.exists == 'false' && github.event.ref != 'refs/heads/main' && github.event.inputs.release_branch == ''
Expand Down
14 changes: 2 additions & 12 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
{
"packages": [
"packages/*"
],
"npmClient": "npm",
"version": "1.2.0",
"command": {
"bootstrap": {
"npmClientArgs": [
"--no-package-lock"
]
}
}
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "2.0.2"
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"description": "codeblitzjs",
"main": "index.js",
"engines": {
"opensumi": "3.3.1"
"opensumi": "3.3.2"
},
"scripts": {
"prepare": "husky install",
Expand Down Expand Up @@ -71,6 +71,7 @@
"jest": "^26.6.3",
"jsdom": "^16.5.3",
"json5": "^2.2.0",
"lerna": "^8.1.8",
"lint-staged": "^10.5.1",
"localforage": "^1.10.0",
"minimist": "^1.2.5",
Expand All @@ -81,7 +82,6 @@
"typescript": "^4.2.3"
},
"resolutions": {
"node-gyp": "npm:@favware/skip-dependency@latest",
"nsfw": "npm:@favware/skip-dependency@latest",
"spdlog": "npm:@favware/skip-dependency@latest",
"node-pty": "npm:@favware/skip-dependency@latest",
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@codeblitzjs/ide-cli",
"version": "1.2.0",
"version": "2.0.2",
"description": "@codeblitzjs/ide-cli",
"main": "lib/commander.js",
"files": [
Expand All @@ -10,13 +10,13 @@
"opensumi codeblitzjs"
],
"engines": {
"opensumi": "3.3.1",
"opensumi": "3.3.2",
"node": ">=10.0.0"
},
"dependencies": {
"@codeblitzjs/ide-common": "workspace:*",
"@opensumi/extension-installer": "^0.0.1",
"@opensumi/ide-extension": "3.3.1",
"@opensumi/ide-extension": "3.3.2",
"commander": "^7.2.0",
"fs-extra": "^9.0.1",
"lodash.pick": "^4.4.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/code-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@codeblitzjs/ide-code-api",
"version": "1.2.0",
"version": "2.0.2",
"description": "@codeblitzjs/ide-code-api",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/code-service/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@codeblitzjs/ide-code-service",
"version": "1.2.0",
"version": "2.0.2",
"description": "@codeblitzjs/ide-code-service",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@codeblitzjs/ide-common",
"version": "1.2.0",
"version": "2.0.2",
"description": "@codeblitzjs/ide-common",
"main": "lib/index.js",
"typing": "lib/index.d.ts",
Expand Down
86 changes: 43 additions & 43 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@codeblitzjs/ide-core",
"version": "1.2.0",
"version": "2.0.2",
"description": "@codeblitzjs/ide-core",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand Down Expand Up @@ -33,48 +33,48 @@
"@codeblitzjs/ide-plugin": "workspace:*",
"@codeblitzjs/ide-registry": "workspace:*",
"@codeblitzjs/ide-sumi-core": "workspace:*",
"@opensumi/ide-addons": "3.3.1",
"@opensumi/ide-ai-native": "3.3.1",
"@opensumi/ide-comments": "3.3.1",
"@opensumi/ide-core-browser": "3.3.1",
"@opensumi/ide-core-common": "3.3.1",
"@opensumi/ide-debug": "3.3.1",
"@opensumi/ide-decoration": "3.3.1",
"@opensumi/ide-design": "3.3.1",
"@opensumi/ide-editor": "3.3.1",
"@opensumi/ide-explorer": "3.3.1",
"@opensumi/ide-express-file-server": "3.3.1",
"@opensumi/ide-extension": "3.3.1",
"@opensumi/ide-extension-storage": "3.3.1",
"@opensumi/ide-file-scheme": "3.3.1",
"@opensumi/ide-file-service": "3.3.1",
"@opensumi/ide-file-tree-next": "3.3.1",
"@opensumi/ide-i18n": "3.3.1",
"@opensumi/ide-keymaps": "3.3.1",
"@opensumi/ide-logs": "3.3.1",
"@opensumi/ide-main-layout": "3.3.1",
"@opensumi/ide-markdown": "3.3.1",
"@opensumi/ide-markers": "3.3.1",
"@opensumi/ide-menu-bar": "3.3.1",
"@opensumi/ide-monaco": "3.3.1",
"@opensumi/ide-monaco-enhance": "3.3.1",
"@opensumi/ide-opened-editor": "3.3.1",
"@opensumi/ide-outline": "3.3.1",
"@opensumi/ide-output": "3.3.1",
"@opensumi/ide-overlay": "3.3.1",
"@opensumi/ide-preferences": "3.3.1",
"@opensumi/ide-quick-open": "3.3.1",
"@opensumi/ide-scm": "3.3.1",
"@opensumi/ide-search": "3.3.1",
"@opensumi/ide-status-bar": "3.3.1",
"@opensumi/ide-storage": "3.3.1",
"@opensumi/ide-testing": "3.3.1",
"@opensumi/ide-theme": "3.3.1",
"@opensumi/ide-toolbar": "3.3.1",
"@opensumi/ide-variable": "3.3.1",
"@opensumi/ide-webview": "3.3.1",
"@opensumi/ide-workspace": "3.3.1",
"@opensumi/ide-workspace-edit": "3.3.1",
"@opensumi/ide-addons": "3.3.2",
"@opensumi/ide-ai-native": "3.3.2",
"@opensumi/ide-comments": "3.3.2",
"@opensumi/ide-core-browser": "3.3.2",
"@opensumi/ide-core-common": "3.3.2",
"@opensumi/ide-debug": "3.3.2",
"@opensumi/ide-decoration": "3.3.2",
"@opensumi/ide-design": "3.3.2",
"@opensumi/ide-editor": "3.3.2",
"@opensumi/ide-explorer": "3.3.2",
"@opensumi/ide-express-file-server": "3.3.2",
"@opensumi/ide-extension": "3.3.2",
"@opensumi/ide-extension-storage": "3.3.2",
"@opensumi/ide-file-scheme": "3.3.2",
"@opensumi/ide-file-service": "3.3.2",
"@opensumi/ide-file-tree-next": "3.3.2",
"@opensumi/ide-i18n": "3.3.2",
"@opensumi/ide-keymaps": "3.3.2",
"@opensumi/ide-logs": "3.3.2",
"@opensumi/ide-main-layout": "3.3.2",
"@opensumi/ide-markdown": "3.3.2",
"@opensumi/ide-markers": "3.3.2",
"@opensumi/ide-menu-bar": "3.3.2",
"@opensumi/ide-monaco": "3.3.2",
"@opensumi/ide-monaco-enhance": "3.3.2",
"@opensumi/ide-opened-editor": "3.3.2",
"@opensumi/ide-outline": "3.3.2",
"@opensumi/ide-output": "3.3.2",
"@opensumi/ide-overlay": "3.3.2",
"@opensumi/ide-preferences": "3.3.2",
"@opensumi/ide-quick-open": "3.3.2",
"@opensumi/ide-scm": "3.3.2",
"@opensumi/ide-search": "3.3.2",
"@opensumi/ide-status-bar": "3.3.2",
"@opensumi/ide-storage": "3.3.2",
"@opensumi/ide-testing": "3.3.2",
"@opensumi/ide-theme": "3.3.2",
"@opensumi/ide-toolbar": "3.3.2",
"@opensumi/ide-variable": "3.3.2",
"@opensumi/ide-webview": "3.3.2",
"@opensumi/ide-workspace": "3.3.2",
"@opensumi/ide-workspace-edit": "3.3.2",
"@opensumi/textmate-languages": "^2.7.0",
"tslib": "^2.2.0"
},
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/api/exports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export { getDefaultLayoutConfig } from '../core/layout';

export { CodeEditor } from '../core/components/CodeEditor'

export { DiffEditor } from '../core/components/DiffEditor'

export { BrowserFSFileType, HOME_ROOT, REPORT_NAME, WORKSPACE_ROOT };

export * from '../core/env';
6 changes: 3 additions & 3 deletions packages/core/src/api/renderApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export const AppRenderer: React.FC<IAppRendererProps> = ({ onLoad, Landing, ...o

export const AppProvider: React.FC<React.PropsWithChildren<IAppRendererProps>> = ({ onLoad, children, ...opts }) => {
const app = useConstant(() => {
opts.appConfig.layoutComponent = () => <Fragment></Fragment>
opts.appConfig.layoutComponent = () => null;
return createApp(opts)
});
const [clientApp, setClientApp] = useState<IAppInstance | null>(null);
Expand All @@ -150,7 +150,7 @@ export const AppProvider: React.FC<React.PropsWithChildren<IAppRendererProps>> =
const [state, setState] = useState<{
status: RootProps['status'];
error?: RootProps['error'];
}>(() => ({ status: 'pending' }));
}>(() => ({ status: 'loading' }));

useMemo(() => {
app.injector.addProviders({
Expand Down Expand Up @@ -191,7 +191,7 @@ export const AppProvider: React.FC<React.PropsWithChildren<IAppRendererProps>> =
};
}, []);

const contextValue = useMemo(() => ({ app: clientApp }), [clientApp])
const contextValue = useMemo(() => ({ app: clientApp, startState: state }), [clientApp, state])

return (
<AppContext.Provider value={contextValue}>
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/api/renderDiffViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ export const DiffViewerRenderer = (props: IDiffViewerProps) => {
},
runtimeConfig: ({
aiNative: {
enable: false,
enable: true,
capabilities: {
supportsInlineChat: false,
supportsInlineChat: true,
},
},
startupEditor: 'none',
Expand Down
17 changes: 4 additions & 13 deletions packages/core/src/core/components/CodeEditor.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
import React, { useContext, useEffect, useMemo, useRef, useCallback } from 'react';
import React, { useContext, useEffect, useMemo, useRef } from 'react';

import * as path from 'path'
import { URI, useInjectable } from '@opensumi/ide-core-browser';
import { ConfigProvider, AppConfig } from '@opensumi/ide-core-browser/lib/react-providers/config-provider'
import { EditorCollectionService, ICodeEditor, IEditorDocumentModelRef } from '@opensumi/ide-editor/lib/common'
import { IEditorDocumentModelService } from '@opensumi/ide-editor/lib/browser/doc-model/types'
import { AppContext } from './context'
import { useMemorizeFn } from '../hooks'
import { parseUri } from './util'

const noop = () => {}

export function useMemorizeFn<T extends (...args: any[]) => any>(fn: T) {
const fnRef = useRef<T>(fn);
fnRef.current = useMemo(() => fn, [fn]);
return useCallback((...args: any) => fnRef.current(...args), []) as T;
}

export interface ICodeEditorProps extends React.HTMLAttributes<HTMLDivElement> {
uri: URI | string;

Expand All @@ -29,12 +25,7 @@ export const CodeEditorComponent = ({ uri, editorOptions, onEditorCreate, ...pro
const appConfig: AppConfig = useInjectable(AppConfig);

const containerRef = React.useRef<HTMLDivElement | null>(null);
const uriStr = useMemo(() => {
if (typeof uri === 'string') {
return URI.file(path.join(appConfig.workspaceDir, uri)).toString()
}
return uri.toString()
}, [uri])
const uriStr = useMemo(() => parseUri(uri, appConfig.workspaceDir), [uri])
const fetchingUriRef = useRef<string>('');
const documentModelRef = useRef<IEditorDocumentModelRef>();
const editorRef = useRef<ICodeEditor>()
Expand Down
Loading