Skip to content

Commit

Permalink
Merge branch 'release/1.4.1' into feat-add-extensionDependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
fyangstudio authored Aug 26, 2021
2 parents 869bea2 + 76fe29d commit 796c582
Show file tree
Hide file tree
Showing 27 changed files with 122 additions and 233 deletions.
3 changes: 3 additions & 0 deletions extensions/application-manager/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
## 1.0.6

- feat: add extensionDependencies `doctor`
- fix: async function syntax error
- feat: update `@appworks/project-service` for feedbackLink
- chore: upgrade @appworks/material-engine version

## 1.0.5

Expand Down
2 changes: 1 addition & 1 deletion extensions/application-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@
"@appworks/common-service": "^0.1.0",
"@appworks/constant": "^0.1.0",
"@appworks/i18n": "^0.1.0",
"@appworks/material-engine": "^0.1.0",
"@appworks/material-engine": "^0.2.0",
"@appworks/project-service": "^0.1.0",
"@appworks/recorder": "^1.0.0",
"@appworks/connector": "^0.1.0",
Expand Down
6 changes: 3 additions & 3 deletions extensions/application-manager/src/views/actionsView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class ActionsProvider implements vscode.TreeDataProvider<ItemData> {
itemDataList = element.children;
} else {
itemDataList = [
...this.buildQuickItems(),
...await this.buildQuickItems(),
this.buildDividerItem(),
await this.buildScriptParentItem(),
];
Expand Down Expand Up @@ -84,7 +84,7 @@ export class ActionsProvider implements vscode.TreeDataProvider<ItemData> {
return item;
}

private buildQuickItems(): ItemData[] {
private async buildQuickItems(): Promise<ItemData[]> {
const items: ItemData[] = [];
const debugLabel = i18n.format('extension.applicationManager.showEntriesQuickPick.runDebug.label');
const debugItem = this.buildActionItem(
Expand Down Expand Up @@ -112,7 +112,7 @@ export class ActionsProvider implements vscode.TreeDataProvider<ItemData> {
items.push(createPageItem);
}

const isAliInternal = checkIsAliInternal();
const isAliInternal = await checkIsAliInternal();
if (isAliInternal) {
const publishLabel = i18n.format('extension.applicationManager.showEntriesQuickPick.DefPublish.label');
const publishItem = this.buildActionItem(
Expand Down
2 changes: 1 addition & 1 deletion extensions/appworks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ AppWorks Pack extension installs these recommend extensions:
- [Auto Rename Tag](https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag): Auto rename paired HTML/XML tag.
- [JavaScript (ES6) code snippets](https://marketplace.visualstudio.com/items?itemName=xabikos.JavaScriptSnippets): Code snippets for JavaScript in ES6 syntax.
- [Simple React Snippets](https://marketplace.visualstudio.com/items?itemName=burkeholland.simple-react-snippets): The essential collection of React Snippets and commands.
- [Debugger for Chrome](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome): Debug your JavaScript code in the Chrome browser, or any other target that supports the Chrome Debugger protocol.
- [Code Runner](https://marketplace.visualstudio.com/items?itemName=formulahendry.code-runner): Run code snippet or code file for multiple languages.
- [Bookmarks](https://marketplace.visualstudio.com/items?itemName=alefragnani.Bookmarks): It helps you to navigate in your code, moving between important positions easily and quickly.

## Help
Expand Down
2 changes: 1 addition & 1 deletion extensions/appworks/README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ AppWorks 套件内包含以下推荐的三方插件:
- [Auto Complete Tag](https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-complete-tag): 自动闭合和重命名标签
- [JavaScript (ES6) code snippets](https://marketplace.visualstudio.com/items?itemName=xabikos.JavaScriptSnippets): ES6 语法的 JavaScript 代码片段
- [Simple React Snippets](https://marketplace.visualstudio.com/items?itemName=burkeholland.simple-react-snippets): React 代码片段
- [Debugger for Chrome](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome): 在 Chrome 浏览器或任何其他支持 Chrome Debugger 协议的目标中调试 JavaScript 代码
- [Code Runner](https://marketplace.visualstudio.com/items?itemName=formulahendry.code-runner): 快速运行文件和代码片段,支持多种开发语言.
- [Bookmarks](https://marketplace.visualstudio.com/items?itemName=alefragnani.Bookmarks): 源码阅读神器

## 获取帮助
Expand Down
2 changes: 1 addition & 1 deletion extensions/appworks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"formulahendry.auto-rename-tag",
"xabikos.JavaScriptSnippets",
"burkeholland.simple-react-snippets",
"msjsdiag.debugger-for-chrome",
"formulahendry.code-runner",
"alefragnani.Bookmarks"
],
"homepage": "https://github.com/appworks-lab/appworks/blob/master/extensions/appworks/README.md",
Expand Down
5 changes: 5 additions & 0 deletions extensions/material-helper/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## 1.1.0
- chore: add iceworks-refactor to extensionDependencies
- fix: the babel plugin's flow will cause error, when babel parse typescript files.
- fix: import duplicate components when add routers

## 1.0.9

- feat: change auto fill code to React Generator extension.
Expand Down
9 changes: 6 additions & 3 deletions extensions/material-helper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Component Helper",
"description": "Easily use Component in React/Vue/Rax.",
"publisher": "iceworks-team",
"version": "1.0.9",
"version": "1.1.0",
"main": "./build/extension.js",
"engines": {
"vscode": "^1.41.0"
Expand Down Expand Up @@ -368,7 +368,7 @@
"@appworks/common-service": "^0.1.0",
"@appworks/constant": "^0.1.0",
"@appworks/i18n": "^0.1.0",
"@appworks/material-engine": "^0.1.0",
"@appworks/material-engine": "^0.2.0",
"@appworks/project-service": "^0.1.0",
"@appworks/project-utils": "^0.1.0",
"@appworks/recorder": "^0.1.0",
Expand All @@ -385,5 +385,8 @@
"bugs": {
"url": "https://github.com/appworks-lab/appworks/issues",
"email": "iceworksteam@163.com"
}
},
"extensionDependencies": [
"iceworks-team.iceworks-refactor"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default (doc: vscode.TextDocument): Set<string> => {
try {
const ast = parse(documentText, {
sourceType: 'module',
plugins: getBabelParserPlugins('jsx'),
plugins: getBabelParserPlugins('ts'),
errorRecovery: true,
});
traverse(ast, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import getBabelParserPlugins from '../utils/getBabelParserPlugins';
function isCursorInObjectExpression(callExpression: CallExpression, cursorPosition: number): boolean {
const callArguments = callExpression.arguments;
const node = callArguments?.[0];

return isObjectExpression(node) && (node.start < cursorPosition && cursorPosition < node.end);
return isObjectExpression(node) && (<number>node.start < cursorPosition && cursorPosition < <number>node.end);
}

function conditionOfCompletion(callExpression: CallExpression, cursorPosition: number): boolean {
Expand All @@ -31,7 +30,7 @@ function getOriginCurrentCallExpress(
try {
const ast = parse(code, {
sourceType: 'module',
plugins: getBabelParserPlugins('jsx'),
plugins: getBabelParserPlugins('ts'),
});
traverse(ast, {
CallExpression(path: NodePath<CallExpression>) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default (doc: vscode.TextDocument, location: vscode.Location): string[] =
try {
const ast = parse(definitionsCode, {
sourceType: 'module',
plugins: getBabelParserPlugins('jsx'),
plugins: getBabelParserPlugins('js'),
});
if (checkIsCapitalizeWord(originSelectionCode) && checkIsJsxComponent(ast)) {
return getJsxPropKeysFromAst(ast);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default (code: string, uri: vscode.Uri): string => {
try {
const ast = parse(code, {
sourceType: 'module',
plugins: getBabelParserPlugins('jsx'),
plugins: getBabelParserPlugins('js'),
errorRecovery: true,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function getPropKeysFromCode(componentPath: string): string[] {
try {
const ast = parse(fs.readFileSync(componentPath, 'utf-8'), {
sourceType: 'module',
plugins: getBabelParserPlugins('jsx'),
plugins: getBabelParserPlugins('js'),
});

if (ast) {
Expand Down
4 changes: 2 additions & 2 deletions extensions/material-helper/src/utils/getBabelParserPlugins.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { ParserPlugin } from '@babel/parser';

export default function getBabelParserPlugins(language: string): ParserPlugin[] {
export default function getBabelParserPlugins(language: 'ts' | 'js'): ParserPlugin[] {
const plugins: ParserPlugin[] = [
'jsx',
'doExpressions',
'objectRestSpread',
'decorators-legacy',
Expand All @@ -18,7 +19,6 @@ export default function getBabelParserPlugins(language: string): ParserPlugin[]
plugins.unshift('typescript');
} else {
plugins.unshift('flow');
plugins.unshift('jsx');
}

return plugins;
Expand Down
2 changes: 1 addition & 1 deletion extensions/material-helper/src/utils/getComponentSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function getComponentSource(
) {
const ast = parser.parse(documentText, {
sourceType: 'module',
plugins: getBabelParserPlugins('jsx'),
plugins: getBabelParserPlugins('ts'),
});

const result = { source: '', importedComponent: '' };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function getCurrentJsxElement(
// https://babeljs.io/docs/en/babel-parser
const ast = parse(documentText, {
sourceType: 'module',
plugins: getBabelParserPlugins('jsx'),
plugins: getBabelParserPlugins('ts'),
});

if (ast) {
Expand Down
2 changes: 1 addition & 1 deletion extensions/material-helper/src/utils/getJsxElements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function getJsxElements(
// https://babeljs.io/docs/en/babel-parser
const ast = parse(documentText, {
sourceType: 'module',
plugins: getBabelParserPlugins('jsx'),
plugins: getBabelParserPlugins('ts'),
});

if (ast) {
Expand Down
4 changes: 1 addition & 3 deletions extensions/material-helper/src/views/componentsView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,7 @@ export function createComponentsTreeView(context: vscode.ExtensionContext) {
i18n.format('extension.iceworksMaterialHelper.cancel'),
);
if (choice === confirmTitle) {
if (vscode.extensions.getExtension('iceworks-team.iceworks-refactor')) {
await vscode.commands.executeCommand('react-refactor.file-and-reference.remove', { path: component.fsPath });
}
await vscode.commands.executeCommand('react-refactor.file-and-reference.remove', { path: component.fsPath });
}
});

Expand Down
1 change: 1 addition & 0 deletions extensions/project-creator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 1.0.5

- feat: add extensionDependencies
- chore: upgrade @appworks/material-engine version

## 1.0.4

Expand Down
2 changes: 1 addition & 1 deletion extensions/project-creator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"@appworks/common-service": "^0.1.0",
"@appworks/constant": "^0.1.0",
"@appworks/i18n": "^0.1.0",
"@appworks/material-engine": "^0.1.0",
"@appworks/material-engine": "^0.2.0",
"@iceworks/pegasus-service": "^0.1.0",
"@appworks/project-service": "^0.1.1",
"@appworks/recorder": "^0.1.0",
Expand Down
4 changes: 4 additions & 0 deletions packages/material-engine/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 0.2.0

- fix: import duplicate components when add routers

## 0.1.2

- feat: update official materials
Expand Down
2 changes: 1 addition & 1 deletion packages/material-engine/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@appworks/material-engine",
"version": "0.1.2",
"version": "0.2.0",
"description": "AppWorks Material Engine for VSCode extension.",
"files": [
"lib"
Expand Down
Loading

0 comments on commit 796c582

Please sign in to comment.