Skip to content

Commit

Permalink
Release 1.4.1 (#943)
Browse files Browse the repository at this point in the history
* chore: remove @ali/publish-visual extension (#938)

* chore: remove @ali/publish-visual extension

* fix: material-help (#944)

* fix: material-help (#946)

* fix: material-help

* chore: add @ali/publish-visual to o2 pack (#948)

* fix: import duplicate components when add routers (#947)

* fix: import duplicate components when add routers

* chore: remove comment

* feat: update feedbackLink (#940)

* feat: remove deprecated extension (#939)

* fix: fail to remove compoennt (#942)

Co-authored-by: yangfan <18767120422@163.com>

* feat: add extensionDependencies (#945)

* feat: update version and changelog (#941)

* feat: update version and changelog

* feat: update changelog

* feat: update

* fix: remove referenced identifiers (#949)

Co-authored-by: Hengchang Lu <44047106+luhc228@users.noreply.github.com>
Co-authored-by: qixuan <58852732+GiveMe-A-Name@users.noreply.github.com>
  • Loading branch information
3 people authored Aug 26, 2021
1 parent 50f2664 commit 83954c4
Show file tree
Hide file tree
Showing 34 changed files with 202 additions and 254 deletions.
7 changes: 7 additions & 0 deletions extensions/application-manager/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Change Log

## 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

- feat: update activitybar icon
Expand Down
5 changes: 3 additions & 2 deletions extensions/application-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Application Manager",
"description": "Quick view your Universal Application(React/Rax/Vue, etc).",
"publisher": "iceworks-team",
"version": "1.0.5",
"version": "1.0.6",
"engines": {
"vscode": "^1.41.0"
},
Expand Down 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 All @@ -366,6 +366,7 @@
"util": "^0.12.3"
},
"extensionDependencies": [
"iceworks-team.iceworks-doctor",
"iceworks-team.iceworks-project-creator"
],
"homepage": "https://github.com/appworks-lab/appworks/blob/master/extensions/application-manager/README.md",
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
9 changes: 9 additions & 0 deletions extensions/appworks/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Change Log

## [1.4.1](https://github.com/appworks-lab/appworks/releases/tag/v1.4.1)

- feat: update feedback link [#940](https://github.com/appworks-lab/appworks/pull/940)
- feat: remove deprecated extension [#939](https://github.com/appworks-lab/appworks/pull/939)
- feat: add extensionDependencies [#945](https://github.com/appworks-lab/appworks/pull/945)
- fix: import duplicate components when add routers [#947](https://github.com/appworks-lab/appworks/pull/947)
- fix: fail to remove component [#942](https://github.com/appworks-lab/appworks/pull/942)
- fix: material-help babel parse error [#944](https://github.com/appworks-lab/appworks/pull/944)

## [1.4.0](https://github.com/appworks-lab/appworks/releases/tag/v1.4.0)

- feat: add React Generator [#933](https://github.com/appworks-lab/appworks/pull/933)
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
4 changes: 2 additions & 2 deletions extensions/appworks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "AppWorks",
"description": "Application Development Pack, provide visualization and intelligent technology to build Universal Application faster and better, support Web / H5 / MiniProgram(小程序) Application.",
"publisher": "iceworks-team",
"version": "1.4.0",
"version": "1.4.1",
"engines": {
"vscode": "^1.41.0"
},
Expand Down 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
5 changes: 5 additions & 0 deletions extensions/project-creator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 1.0.5

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

## 1.0.4

- feat: update official materials
Expand Down
9 changes: 6 additions & 3 deletions extensions/project-creator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Application Creator",
"description": "Quick create a Universal Application(React/Rax/Vue, etc).",
"publisher": "iceworks-team",
"version": "1.0.4",
"version": "1.0.5",
"engines": {
"vscode": "^1.41.0"
},
Expand Down 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 All @@ -87,5 +87,8 @@
"bugs": {
"url": "https://github.com/appworks-lab/appworks/issues",
"email": "iceworksteam@163.com"
}
},
"extensionDependencies": [
"iceworks-team.iceworks-app"
]
}
4 changes: 4 additions & 0 deletions extensions/react-refactor/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 1.0.2

- fix: remove referenced identifiers in ArrayPattern and ObjectPattern

## 1.0.1

- fix .vscodeignore configuration [#576](https://github.com/microsoft/vscode-vsce/issues/576)
Expand Down
2 changes: 1 addition & 1 deletion extensions/react-refactor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Easily refactor Component in React/Rax.",
"publisher": "iceworks-team",
"icon": "assets/logo.png",
"version": "1.0.1",
"version": "1.0.2",
"engines": {
"vscode": "^1.41.0"
},
Expand Down
8 changes: 4 additions & 4 deletions extensions/react-refactor/src/__tests__/suite/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class CoverageRunner {
this.options = options;
}

public setupCoverage(): void {
setupCoverage(): void {
// Set up Code Coverage, hooking require so that instrumented code is returned
const self = this;
self.instrumenter = new istanbul.Instrumenter({ coverageVariable: self.coverageVar });
Expand Down Expand Up @@ -102,7 +102,7 @@ class CoverageRunner {
*
* @memberOf CoverageRunner
*/
public reportCoverage(): void {
reportCoverage(): void {
const self = this;
istanbul.hook.unhookRequire();
let cov: any;
Expand Down Expand Up @@ -173,11 +173,11 @@ export function run(): Promise<void> {
}

// Add files to the test suite
files.forEach(f => mocha.addFile(path.resolve(testsRoot, f)));
files.forEach((f) => mocha.addFile(path.resolve(testsRoot, f)));

try {
// Run the mocha test
mocha.run(failures => {
mocha.run((failures) => {
if (failures > 0) {
e(new Error(`${failures} tests failed.`));
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,26 @@ export function removeUselessReferences(ast: any, originUnrefIdentifiers: string
}

if (path && path.node) {
binding.path.remove();
const { id } = path.node as any;
if (id && (t.isArrayPattern(id) || t.isObjectPattern(id))) {
// const [a, b] = [1, 2]
// const { a, b } = obj;
const { properties, elements } = id as any;
if (properties) {
const propertyIndex = properties.findIndex(({ key }) => key.name === name);
if (propertyIndex) {
properties.splice(propertyIndex, 1);
}
}
if (elements) {
const elementIndex = elements.findIndex((item) => item.name === name);
if (elementIndex) {
elements.splice(elementIndex, 1);
}
}
} else {
binding.path.remove();
}
}
} else {
// remove identifier in the parent scope
Expand Down
Loading

0 comments on commit 83954c4

Please sign in to comment.