Skip to content

Commit

Permalink
release: 0.3.0 (#278)
Browse files Browse the repository at this point in the history
* feat: apply repo

* feat: convert ts2js

* fix: fix type name

* chore: remove console

* chore: version

* chore: remove code

* refactor: remove iceworks-cli

* feat: support transform ts to js

* chore: version

* refactor: rename Iceworks Material Helper to React Component Helper

* docs: update logo

* chore: lint

* feat: i18n 功能包

* feat: extension 示例 iceworks-app 国际化

* docs: typo

* chore: remove material-import package.json

* feat: add package transform-ts-to-js to tsconfig.json

* feat: 改变了编译顺序,将 i18n package 导出的实体变为导出类。

* feat: web 示例 iceworks-app 设置页面

* refactor: 根据 i8n 的新导出方式进行更新,删除无用行,更改模板及引用方式

* feat: 使用 useEffect 函数进行异步加载

* feat: 改变了编译顺序,将 i18n package 导出的实体变为导出类。

* refactor: move export to bottom

* feat: i18n for packages/block-service

* refactor: format codes and delete useless file `util/i18n.ts`

* feat: replace injectIntl with `useIntl` hook and format codes

* feat: addLocalProvider To Pages/*/index for i18n

* refactor: add `[]` param to useEffect, update en-US JSON and app.tsx

* feat: add ui

* feat: support ejs options

* fix: error styles

* fix: lint

* feat: i18n for packages/project-service

* refactor: uv/pv logic

* refactor: pv|uv

* style: camel case

* chore: add comments

* chore: version & change log

* Hotfix: rax scaffolds title app type icon disappear (#296)

* fix: rax scaffolds title app type icon disappear

* chore: version

* refactor: do not export recordPV and recordUV, using record

* fix: add i18n dep to package.json

* feat: types

* feat: i18n for packages/page-service

* feat: i18n for packages/material-service

* fix: ejs options

* fix: useState name

* feat: i18n for packages/component-service

* chore: generate-project version

* feat: i18n for project-creator

* feat: i18n for page-builder

* feat: i18n for material-helper

* feat: i18n for Iceworks-component-builder (#301)

* feat: i18n for Iceworks-component-generater

* fix: fix double alerts bug and add iceworks/i18n to dep

* fix: web i18n

* style: remove empty line

* fix: ignore i18n error

* chore: remove unnecessary code

* chore: remove unnecessary note

* feat: support next locale

* style: indent

* fix: delete redundant codes

Co-authored-by: alvinhui <alvin.hui@qq.com>

* refactor: update i18n in extension and i18n.tsx in web

* fix: default locale

* chore: version

* chore: types

* refactor: 0.1.0 should be first version

* chore: url extraction as constant (#318)

* chore: url extraction as constant

* style: indent

* fix: en-US errors

* feat: support webapp and assets def project (#299)

* docs: update gifs for en-US (#325)

* fix: update i18n translations

* docs: update i18n doc gifs (#324)

* docs: update i18n doc gifs

* docs: update component builder gifs

* docs: update material-helper and page-bulder doc gifs

* fix: fail to debug extension in development env (#326)

* fix: fail to debug extension in development

* fix: fail-to-debug-extension-in-development

* docs: change slogan for en-US (#327)

* docs: add markdownlint to ci and update docs (#328)

* fix: update i18n translations

* docs: update i18n doc gifs (#324)

* docs: update i18n doc gifs

* docs: update component builder gifs

* docs: update material-helper and page-bulder doc gifs

* feat: add docslInt in ci

* docs: update docs due to markdownlint

* fix: update material helper demo

* fix: fix URl to URL

* fix: fail to install deps when import materials (#329)

* fix: create a new terminal to install deps

* chore: remove repeated bulkDownload code

* chore: version

* refactor: update code due to code style (#331)

* chore: record locale (#332)

* docs: change slogan for en-US

* chore: record locale

* fix: fail get material detail in unknown project (#333)

* fix: fail to get material detail in unknown project

* fix: change specifiedType in getSources method

* chore: version

* feat: get user info through def client login (#323)

* feat: def login client

* feat: get user info in web

* fix: eslint

* feat: get def-login-client zip

* feat: add install def-login-client-deps

* style: change IIFE

* fix: style

* chore: accesskey

* fix: access key not found in ci setup

* fix: ci

* fix: fix by the comment

* fix: lint

* feat: not run the script when key unexist

* fix: lint

* refactor: encode alibaba-inc (#335)

* refactor: encode constants with 'alibaba-Inc'

* fix: add js-base dep to package.json

* fix: eslint err

* fix: use namespace to make test work

* feat: add docs check to CI (#338)

* chore: change version add CHANGLOG

* fix: package publishConfig

* fix: extension build size is  too bulky (#340)

* fix: en-US translation (#339)

* fix: change material-import to material-helper (#341)

* fix: beta and prod publish env (#343)

* chore: title typo (#342)

* chore: title typo

* chore: settings

* fix: gitlab url (#345)

* chore: typo

Co-authored-by: yangfan <18767120422@163.com>
Co-authored-by: alvinhui <alvin.hui@qq.com>
Co-authored-by: sspku-yqLiu <liuyongqi@pku.edu.cn>
Co-authored-by: sspku-yqLiu <56879942+sspku-yqLiu@users.noreply.github.com>
  • Loading branch information
5 people authored Jul 27, 2020
1 parent c605225 commit fd4ce99
Show file tree
Hide file tree
Showing 252 changed files with 4,186 additions and 5,716 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ build/
tests/
demo/
.ice/
packages/common-service/def-login-client/

# node 覆盖率文件
coverage/
Expand Down
5 changes: 3 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ const commonRules = {
'react/jsx-filename-extension': [1, { 'extensions': ['.js', '.jsx', '.tsx'] }],
'react/jsx-no-target-blank': [0],
'prefer-object-spread': 0,
'@typescript-eslint/array-type': 0,
'@typescript-eslint/no-non-null-assertion': 0,
'max-classes-per-file': 0,
'class-methods-use-this': 0
};
Expand All @@ -25,6 +23,9 @@ const tsRules = deepmerge(tslint, {
},
rules: {
...commonRules,
'@typescript-eslint/array-type': 0,
'@typescript-eslint/no-non-null-assertion': 0,
'@typescript-eslint/no-inferrable-types': 1,
'@typescript-eslint/ban-ts-ignore': 0,
'@typescript-eslint/array-type': 0,
'@typescript-eslint/no-non-null-assertion': 0,
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/auto-publisher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ jobs:
with:
node-version: 10
registry-url: https://registry.npmjs.org/
- run: npm i
- run: npm i -g vsce
- run: npm run setup
- run: npm run publish
- run: |
npm i
npm i -g vsce
npm run setup
npm run publish
env:
VSCE_TOKEN: ${{secrets.VSCE_TOKEN}}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/beta-publisher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ jobs:
with:
node-version: 10
registry-url: https://registry.npmjs.org/
- run: npm i
- run: npm i -g vsce
- run: npm run setup
- run: npm run publish-beta
- run: |
npm i
npm i -g vsce
npm run setup
npm run publish-beta
env:
VSCE_TOKEN: ${{secrets.VSCE_TOKEN}}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
Expand Down
35 changes: 19 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,29 @@ on: [push]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: |
npm run setup
npm run lint
npm run dependency:check
npm run test
npm run coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: |
npm run setup
npm run lint
npm run dependency:check
npm run docs:check
npm run test
npm run coverage
env:
ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY_ID }}
ACCESS_KEY_SECRET: ${{ secrets.ACCESS_KEY_SECRET }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
6 changes: 6 additions & 0 deletions extensions/iceworks-app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# Change Log

## 0.3.0

- feat: support en-US

## 0.2.1

- feat: add quick entry in the editor title menu
- fix: fail to set custom registry

## 0.2.0

- feat: install dependencies automatically when node_modules does not exist
- feat: refresh dependencies list、pages list and components list automatically
- feat: support stopping scripts
Expand Down
6 changes: 3 additions & 3 deletions extensions/iceworks-app/README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ Preview and manage your application from a framework perspective, including npm

## Usage

### Initialize panel
### Initialize panel

After you install the Iceworks-APP plugin, an `Iceworks` icon will be added to your activity bar. Click it to enter Iceworks panel.

The initialization panel appears if your current workspace is empty or ** isn't React/Rax application **.
The initialization panel appears if your current workspace is empty or **isn't React/Rax application**.

![demo](https://user-images.githubusercontent.com/56879942/87553484-8e928980-c6e5-11ea-8183-a6ba7f4eae95.gif)

Expand Down Expand Up @@ -82,7 +82,7 @@ When your workspace is a React or Rax application, the Iceworks panel appears.

## Iceworks command palette

If you install [Iceworks suite] (https://marketplace.visualstudio.com/items?ItemName=iceWorks-team.iceWorks), you can activate other extensions in VS Code command palette.
If you install [Iceworks suite](https://marketplace.visualstudio.com/items?ItemName=iceWorks-team.iceWorks), you can activate other extensions in VS Code command palette.

![demo](https://user-images.githubusercontent.com/56879942/87544740-8d5b5f80-c6d9-11ea-85ff-bc31501911e1.gif)

Expand Down
3 changes: 1 addition & 2 deletions extensions/iceworks-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

![使用示例](https://user-images.githubusercontent.com/56879942/87407459-c4a41080-c5f4-11ea-882e-d198afc35413.png)

#### 设置
#### 设置

![使用示例](https://user-images.githubusercontent.com/56879942/87531798-d1903500-c6c4-11ea-9c6d-e19d6241c91a.gif)

Expand Down Expand Up @@ -79,7 +79,6 @@
3. 输入需要安装的 npm 包及版本信息,例如 `typescript@latest`
4. npm 包将会自动安装,如果这个包已经添加到了依赖中,那么将会重新安装。


### 命令面板

您可以通过点击窗口右下角状态栏上的「Iceworks」按钮激活 Iceworks 命令面板。
Expand Down
9 changes: 5 additions & 4 deletions extensions/iceworks-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Iceworks Application Viewer",
"description": "Quick view your Universal Application(React/Rax/Vue, etc).",
"publisher": "iceworks-team",
"version": "0.2.1",
"version": "0.3.0",
"engines": {
"vscode": "^1.41.0"
},
Expand Down Expand Up @@ -383,7 +383,7 @@
"vscode:prepublish": "rm -rf build && npm run build:web && webpack --mode production",
"build:web": "cd web && npm run build",
"watch:web": "cd web && npm run start",
"webpack": "rm -rf ./build/extension.js && webpack --mode development",
"webpack": "webpack --mode development",
"webpack-dev": "webpack --mode development --watch",
"compile": "tsc -p ./tsconfig.json"
},
Expand All @@ -402,6 +402,7 @@
"@iceworks/material-service": "^0.1.5",
"@iceworks/project-service": "^0.1.6",
"@iceworks/vscode-webview": "^0.1.2",
"@iceworks/i18n": "^0.1.0",
"fs-extra": "^9.0.0",
"ice-npm-utils": "^2.0.0",
"latest-version": "^5.1.0",
Expand All @@ -412,11 +413,11 @@
"iceworks-team.iceworks-project-creator",
"iceworks-team.iceworks-component-builder",
"iceworks-team.iceworks-page-builder",
"iceworks-team.iceworks-material-import"
"iceworks-team.iceworks-material-helper"
],
"homepage": "https://github.com/ice-lab/iceworks/blob/master/extensions/iceworks-app/README.md",
"bugs": {
"url": "https://github.com/ice-lab/iceworks/issues",
"email": "iceworksteam@163.com"
}
}
}
8 changes: 4 additions & 4 deletions extensions/iceworks-app/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
"iceworksApp.viewsWelcome.pages.contents": "Pages could not be found.",
"iceworksApp.viewsWelcome.components.contents": "Components could not be found.",
"iceworksApp.viewsWelcome.nodeDependencies.contents": "Node dependencies could not be found in package.json.",
"iceworksApp.command.configHelper.start.title": "Iceworks: Set Configuration",
"iceworksApp.command.configHelper.start.title": "Iceworks: Settings",
"iceworksApp.command.DefPublish.title": "Iceworks: Def Publish",
"iceworksApp.command.npmScripts.refresh.title": "Refresh",
"iceworksApp.command.npmScripts.run.title": "Run Script",
"iceworksApp.command.npmScripts.stop.title": "Stop Script",
"iceworksApp.command.npmScripts.runDev.title": "IceWorks: Run Dev",
"iceworksApp.command.npmScripts.stopDev.title": "IceWorks: Stop Dev",
"iceworksApp.command.npmScripts.runBuild.title": "IceWorks: Run Build",
"iceworksApp.command.npmScripts.runDev.title": "Iceworks: Run Dev",
"iceworksApp.command.npmScripts.stopDev.title": "Iceworks: Stop Dev",
"iceworksApp.command.npmScripts.runBuild.title": "Iceworks: Run Build",
"iceworksApp.command.pages.add.title": "Add Pages",
"iceworksApp.command.pages.refresh.title": "Refresh",
"iceworksApp.command.pages.openFile.title": "Open File",
Expand Down
16 changes: 9 additions & 7 deletions extensions/iceworks-app/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { showExtensionsQuickPickCommandId } from './constants';
import showExtensionsQuickPick from './quickPicks/showExtensionsQuickPick';
import showDefPublishEnvQuickPick from './quickPicks/showDefPublishEnvQuickPick';
import createExtensionsStatusBar from './statusBar/createExtensionsStatusBar';
import i18n from './i18n';

// eslint-disable-next-line
const { name, version } = require('../package.json');
Expand All @@ -23,8 +24,8 @@ export async function activate(context: vscode.ExtensionContext) {

// data collection
const logger = new Logger(name, globalState);
logger.recordDAU();
logger.recordActivate(version);
logger.recordMainDAU();
logger.recordExtensionActivate(version);

// auto set configuration
initExtension(context);
Expand All @@ -35,10 +36,11 @@ export async function activate(context: vscode.ExtensionContext) {
subscriptions.push(extensionsStatusBar);
// init webview
function activeWebview() {
const webviewPanel: vscode.WebviewPanel = window.createWebviewPanel('iceworks', '设置 - Iceworks', ViewColumn.One, {
enableScripts: true,
retainContextWhenHidden: true,
});
const webviewPanel: vscode.WebviewPanel = window.createWebviewPanel('iceworks',
i18n.format('extension.iceworksApp.extension.title'), ViewColumn.One, {
enableScripts: true,
retainContextWhenHidden: true,
});
webviewPanel.webview.html = getHtmlForWebview(extensionPath);
connectService(webviewPanel, context, { services, logger });
}
Expand All @@ -48,7 +50,7 @@ export async function activate(context: vscode.ExtensionContext) {
}));

if (!rootPath) {
vscode.window.showInformationMessage('当前工作区为空,请打开应用或新建应用。');
vscode.window.showInformationMessage(i18n.format('extension.iceworksApp.extebsion.emptyWorkplace'));
vscode.commands.executeCommand('setContext', 'iceworks:isNotTargetProject', true);
vscode.commands.executeCommand('iceworks-project-creator.start');
return;
Expand Down
14 changes: 14 additions & 0 deletions extensions/iceworks-app/src/i18n.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import * as vscode from 'vscode';
import I18nService from '@iceworks/i18n';
import * as zhCNTextMap from './locales/zh-CN.json';
import * as enUSTextMap from './locales/en-US.json';

// 注册语言表
const i18n = new I18nService();
i18n.registry('zh-cn', zhCNTextMap);
i18n.registry('en', enUSTextMap);

// 设置使用的语言
i18n.setLocal(vscode.env.language);

export default i18n;
5 changes: 3 additions & 2 deletions extensions/iceworks-app/src/inputBoxs/showDepsInputBox.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import * as vscode from 'vscode';
import { NodeDepTypes, ITerminalMap } from '../types';
import executeCommand from '../commands/executeCommand';
import i18n from '../i18n';

export default async function showDepsInputBox(terminals: ITerminalMap, nodeDependenciesInstance: any, depType: NodeDepTypes) {
const result = await vscode.window.showInputBox({
placeHolder: '例如: lodash react@latest',
prompt: `请输入需要添加到 ${depType} 的依赖名称, 支持通过空格添加多个依赖`
placeHolder: i18n.format('extension.iceworksApp.showDepsInputBox.materialImport.placeHolder'),
prompt: i18n.format('extension.iceworksApp.showDepsInputBox.materialImport.prompt',{depType})
});
if (!result) {
return;
Expand Down
20 changes: 20 additions & 0 deletions extensions/iceworks-app/src/locales/en-US.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"extension.iceworksApp.showExtensionsQuickPick.projectCreater.label": "Iceworks Create Application",
"extension.iceworksApp.showExtensionsQuickPick.projectCreater.detail": "Create a Universal Application(React/Rax/Vue, etc) quickly.",
"extension.iceworksApp.showExtensionsQuickPick.pageBuilder.label": "Iceworks Generate Page",
"extension.iceworksApp.showExtensionsQuickPick.pageBuilder.detail": "Build Page UI by low-code way.",
"extension.iceworksApp.showExtensionsQuickPick.generateComponent.label": "Iceworks Create Component",
"extension.iceworksApp.showExtensionsQuickPick.generateComponent.detail": "Build Component UI by low-code way.",
"extension.iceworksApp.showExtensionsQuickPick.materialImport.label": "Iceworks Import Component",
"extension.iceworksApp.showExtensionsQuickPick.materialImport.detail": "Add Component to the Application in a visual way.",
"extension.iceworksApp.showDepsInputBox.materialImport.placeHolder": "for example: lodash react@latest.",
"extension.iceworksApp.showDepsInputBox.materialImport.prompt": "Please enter the name of the dependency to be addded to <%= depType %>. Multiple dependencies should be spilted by Spaces.",
"extension.iceworksApp.showDefPublishEnvQuickPick.DEFEnvOptions.daily.label": "Daily",
"extension.iceworksApp.showDefPublishEnvQuickPick.DEFEnvOptions.daily.detail": "Release to daily environment.",
"extension.iceworksApp.showDefPublishEnvQuickPick.DEFEnvOptions.prod.label": "Production",
"extension.iceworksApp.showDefPublishEnvQuickPick.DEFEnvOptions.prod.detail": "Release to production environment.",
"extension.iceworksApp.showDepsQuickPick.quickPickItem.detail": "Install <%= label %>",
"extension.iceworksApp.openEntryFile.ErrorMessage": "Cannot find entry",
"extension.iceworksApp.extension.title": "Iceworks Settings",
"extension.iceworksApp.extebsion.emptyWorkplace": "Current workspace is empty, please open or create an application."
}
20 changes: 20 additions & 0 deletions extensions/iceworks-app/src/locales/zh-CN.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"extension.iceworksApp.showExtensionsQuickPick.projectCreater.label": "Iceworks 创建应用",
"extension.iceworksApp.showExtensionsQuickPick.projectCreater.detail": "快速创建多端应用(例如:React/Rax/Vue...)",
"extension.iceworksApp.showExtensionsQuickPick.pageBuilder.label": "Iceworks 生成页面",
"extension.iceworksApp.showExtensionsQuickPick.pageBuilder.detail": "使用低代码的方式生成网页视图",
"extension.iceworksApp.showExtensionsQuickPick.generateComponent.label": "Iceworks 生成组件",
"extension.iceworksApp.showExtensionsQuickPick.generateComponent.detail": "使用低代码的方式生成前端组件",
"extension.iceworksApp.showExtensionsQuickPick.materialImport.label": "Iceworks 使用物料",
"extension.iceworksApp.showExtensionsQuickPick.materialImport.detail": "使用可视化的方式添加物料到应用中",
"extension.iceworksApp.showDepsInputBox.materialImport.placeHolder": "例如: lodash react@latest",
"extension.iceworksApp.showDepsInputBox.materialImport.prompt": "请输入需要添加到 <%= depType %> 的依赖名称, 支持通过空格添加多个依赖",
"extension.iceworksApp.showDefPublishEnvQuickPick.DEFEnvOptions.daily.label": "日常环境",
"extension.iceworksApp.showDefPublishEnvQuickPick.DEFEnvOptions.daily.detail": "发布到日常环境",
"extension.iceworksApp.showDefPublishEnvQuickPick.DEFEnvOptions.prod.label": "生产环境",
"extension.iceworksApp.showDefPublishEnvQuickPick.DEFEnvOptions.prod.detail": "发布到生产环境",
"extension.iceworksApp.showDepsQuickPick.quickPickItem.detail": "安装 <%= label %>",
"extension.iceworksApp.openEntryFile.ErrorMessage": "没有找到入口",
"extension.iceworksApp.extension.title": "设置 - Iceworks",
"extension.iceworksApp.extebsion.emptyWorkplace": "当前工作区为空,请打开应用或新建应用。"
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
import * as vscode from 'vscode';
import { ITerminalMap } from '../types';
import executeCommand from '../commands/executeCommand';
import i18n from '../i18n';

const { window } = vscode;

const DEFEnvOptions = [
{ label: 'daily', detail: '发布到日常环境', command: 'def p -d' },
{ label: 'prod', detail: '发布到线上环境', command: 'def p -o' },
]

export default function showDefPublishEnvQuickPick(terminalMapping: ITerminalMap, rootPath: string) {

const DEFEnvOptions = [
{ label: i18n.format('extension.iceworksApp.showDefPublishEnvQuickPick.DEFEnvOptions.daily.label'),
detail: i18n.format('extension.iceworksApp.showDefPublishEnvQuickPick.DEFEnvOptions.daily.detail'), command: 'def p -d' },
{ label: i18n.format('extension.iceworksApp.showDefPublishEnvQuickPick.DEFEnvOptions.prod.label'),
detail: i18n.format('extension.iceworksApp.showDefPublishEnvQuickPick.DEFEnvOptions.prod.detail'), command: 'def p -o' },
]

const quickPick = window.createQuickPick();
quickPick.items = DEFEnvOptions.map((options) => ({ label: options.label, detail: options.detail }));
quickPick.onDidChangeSelection(selection => {
Expand Down
3 changes: 2 additions & 1 deletion extensions/iceworks-app/src/quickPicks/showDepsQuickPick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import * as vscode from 'vscode';
import { nodeDepTypes } from '../constants';
import { NodeDepTypes, ITerminalMap } from '../types';
import showDepsInputBox from '../inputBoxs/showDepsInputBox';
import i18n from '../i18n';

export default function showDepsQuickPick(terminals: ITerminalMap, nodeDependenciesInstance: any) {
const quickPick = vscode.window.createQuickPick();
quickPick.items = nodeDepTypes.map(label => ({ label, detail: `Install ${label}` }));
quickPick.items = nodeDepTypes.map(label => ({ label, detail: i18n.format('extension.iceworksApp.showDepsQuickPick.quickPickItem.detail',{label}) }));
quickPick.onDidChangeSelection(selection => {
if (selection[0]) {
showDepsInputBox(terminals, nodeDependenciesInstance, selection[0].label as NodeDepTypes)
Expand Down
Loading

0 comments on commit fd4ce99

Please sign in to comment.