Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: iceworks/release-2.17.0 (#1497)
* Iceworks/add lint (#1480) * feat: add lint * chore: yarn.lock * chore: network * fix: fix iceworks error (#1532) * chore: add git error log * feat: upgrate template-builder v2 (#1512) * chore: timeout 配置更改;注释增加 * feat: 日志服务添加 * feat: Iceworks download process optim (#1564) * 添加下载流程日志,如 `正在请求区块数据 => 正在解压区块 => 安装依赖` 等详细步骤日志 * 添加具体的容错处理,之前的下载流程没有补获具体的步骤错误,统一都是区块下载失败,这里改成了具体的错误具体抛出 * 部分下载代码重构 * 默认使用 cnpm 源进行下载 ![image](https://user-images.githubusercontent.com/3995814/53929078-7cebab80-40c7-11e9-8ebe-564d6ead536c.png) * 如果不是使用的 cnpm 源则给出提示,推荐使用 cnpm 源进行下载 ![image](https://user-images.githubusercontent.com/3995814/53929380-8c1f2900-40c8-11e9-9b88-13f35d9e9e34.png) fix: #1564 2 、10 * Iceworks/bug fix 7 8 (#1576) 对常见问题 #1544 7,8的修复 1. 添加pluginHoc 统一用cdcatch封装一层 2. 移除git插件ipcRenderer的focus事件监听,这里同denpendies一样,频繁触发会导致react报错(问题7) 3. 问题8,对于git插件不可用的用户提示关闭 * Iceworks/component display (#1538) * feat: 组件市场 - 结构 * 组件市场展示 1. 飞冰物料源,基础组件和业务组件合并 2. 组件展示以是否已下载状态 3. 组件下载之后,显示引用方法复制,点击可复制引用方法代码 * 组件市场 下载 * chore: 组件下载完之后局部刷新;添加进度 * lint * chore: 样式微调 * fix:some bug * Iceworks/bug fix 21 (#1573) 物料源请求失败处理: 1. CI中添加物料更新时自动发包(@icedesign/materails-db)逻辑,使用unpkg作为备份物料源 2. 当正常物料源因为超时无法访问时,自动切换备份物料源。 2. 增加 备份数据也无法访问时的错误处理逻辑。 * chore: code review * chore: code optim * chore: hidden speedtest * fix: merge bug * chore: materials-db-publish * chore: opt * chore: yarn install * chore: yarn reinstall * fix: yarn.lock registry * fix: 文案优化 * fix: 区分物料源加载失败和基础组件加载失败的错误 * fix: iceworks bugs (#1589) * fix: 内网环境判断逻辑优化&移除无用的 is-alibaba * fix: bug * fix: backupSource set * chore: materials backup set * fix: iceworks/oss bugfix (#1590) * chore: update template-builder version * fix: iceBaseComponents 不存在的情况 * chore: defaultMaterials 合并 (#1601) * fix: 初始选中 (#1603)
- Loading branch information
1 parent
1193593
commit 3703f01
Showing
178 changed files
with
5,455 additions
and
2,861 deletions.
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,73 @@ | ||
const npmRequestJson = require('npm-request-json'); | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
const { exec } = require('child_process'); | ||
const rimraf = require("rimraf"); | ||
const semver = require("semver"); | ||
|
||
function publishMaterialsDB() { | ||
|
||
// 1. 创建临时文件夹 | ||
const tempDir = path.join(__dirname, 'tempDir'); | ||
rimraf.sync(tempDir); // 初始化删除 | ||
fs.mkdirSync(tempDir); | ||
const tempLibDir = path.join(tempDir, 'lib'); | ||
fs.mkdirSync(tempLibDir); | ||
|
||
// 2 同步build下物料源配置文件到 tempDir/src 下 | ||
const buildPath = path.resolve(__dirname, '../build'); | ||
fs.readdirSync(buildPath).map( | ||
(filename) => { | ||
const from = path.join(buildPath, filename); | ||
const to = path.join(tempLibDir, filename); | ||
fs.copyFileSync(from, to); | ||
} | ||
); | ||
|
||
// 3. 创建 package.json 文件 | ||
const pkgConfig = { | ||
"name": "@icedesign/materails-db", | ||
"version": "1.0.0", | ||
"description": "iceworks 官方物料源备份数据", | ||
"main": "lib", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"author": "", | ||
"license": "MIT", | ||
"publishConfig": { | ||
"registry": "http://registry.npmjs.com", | ||
"access": "public" | ||
} | ||
}; | ||
// 获取已发布版本号 | ||
const NPM_REGISTRY = process.env.NPM_REGISTRY || 'registry.npmjs.com'; | ||
const registry = `https://${NPM_REGISTRY}`; | ||
return npmRequestJson({ | ||
name: pkgConfig.name, | ||
version: 'latest', | ||
registry, | ||
}) | ||
.then((pkgData) => { | ||
// 版本号自增1 | ||
pkgConfig.version = semver.inc(pkgData.version, 'patch'); | ||
const pkgPath = path.join(tempDir, 'package.json'); | ||
fs.writeFileSync(pkgPath, JSON.stringify(pkgConfig)); | ||
// 4. 发布 | ||
exec('npm publish', { | ||
cwd: tempDir | ||
}, (error, stdout, stderr) => { | ||
if(error) { | ||
console.error(error); | ||
rimraf.sync(tempDir); | ||
throw error; | ||
} | ||
console.log('发布完成: ' + stdout); | ||
rimraf.sync(tempDir); | ||
}) | ||
}) | ||
} | ||
|
||
module.exports = { | ||
publishMaterialsDB | ||
} |
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,16 @@ | ||
# 忽略目录 | ||
build/ | ||
dist/ | ||
node_modules/ | ||
out/ | ||
tests/ | ||
binary/ | ||
bin-win32/ | ||
bin-darwin/ | ||
|
||
# node 覆盖率文件 | ||
coverage/ | ||
|
||
# 忽略文件 | ||
**/*-min.js | ||
**/*.min.js |
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,76 @@ | ||
{ | ||
"root": true, | ||
"parser": "babel-eslint", | ||
"extends": "eslint-config-airbnb", | ||
"parserOptions": { | ||
"ecmaVersion": 6, | ||
"ecmaFeatures": { | ||
"jsx": true, | ||
"experimentalObjectRestSpread": true | ||
} | ||
}, | ||
"env": { | ||
"browser": true, | ||
"mocha": true, | ||
"node": true, | ||
"commonjs": true | ||
}, | ||
"plugins": ["react", "babel"], | ||
"rules": { | ||
"arrow-parens": [2, "always"], | ||
"no-console": 0, | ||
"no-use-before-define": 0, | ||
"react/forbid-prop-types": 0, | ||
"jsx-a11y/label-has-for": 0, | ||
"jsx-a11y/no-static-element-interactions": 0, | ||
"jsx-a11y/anchor-has-content": 0, | ||
"jsx-a11y/click-events-have-key-events": 0, | ||
"jsx-a11y/anchor-is-valid": 0, | ||
"react/no-array-index-key": 0, | ||
"func-names": 0, | ||
"arrow-body-style": 0, | ||
"react/sort-comp": 0, | ||
"react/prop-types": 0, | ||
"react/jsx-first-prop-new-line": 0, | ||
"react/react-in-jsx-scope": 0, | ||
"react/jsx-filename-extension": [ | ||
1, | ||
{ | ||
"extensions": [".js", ".jsx"] | ||
} | ||
], | ||
"import/extensions": 0, | ||
"import/no-unresolved": 0, | ||
"import/no-extraneous-dependencies": 0, | ||
"import/prefer-default-export": 0, | ||
"prefer-destructuring": 0, | ||
"no-param-reassign": 0, | ||
"no-return-assign": 0, | ||
"max-len": 0, | ||
"consistent-return": 0, | ||
"no-redeclare": 0, | ||
"react/require-extension": 0, | ||
"react/no-danger": 0, | ||
"comma-dangle": ["error", "always-multiline"], | ||
"function-paren-newline": 0, | ||
"object-curly-newline": 0, | ||
"no-restricted-globals": 0, | ||
"react/prefer-stateless-function": 0, | ||
"react/jsx-no-bind": 0, | ||
"no-plusplus": 0, | ||
"global-require": 0, | ||
"no-case-declarations": 0, | ||
"class-methods-use-this": 0, | ||
"prefer-promise-reject-errors": 0, | ||
"no-underscore-dangle": 0, | ||
"one-var": 0, | ||
"one-var-declaration-per-line": 0, | ||
"no-return-await": 0, | ||
"import/no-dynamic-require": 0, | ||
"no-restricted-syntax": 0, | ||
"no-await-in-loop": 0, | ||
"no-useless-escape": 0, | ||
"no-continue": 0, | ||
"prefer-const": 0 | ||
} | ||
} |
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,47 @@ | ||
const request = require('request'); | ||
const { app } = require('electron'); | ||
|
||
|
||
/** | ||
* 阿里云 SLS 服务,日志上报方法 | ||
* @param {string} topic 类型:info / error | ||
* @param {object} data 健值参数 | ||
* data = { | ||
* type: '', // 标识具体action / | ||
* } | ||
*/ | ||
const report = (data = {}, topic = 'info') => { | ||
// SLS config:配置参照 https://help.aliyun.com/document_detail/31752.html?spm=a2c4g.11186623.6.707.614f8bdceHbp2w&accounttraceid=3835f51f-2862-4a2c-a8e7-fc695d89c700 | ||
const project = 'iceworks'; | ||
const logstore = 'iceworks-log'; | ||
const host = 'cn-hangzhou.log.aliyuncs.com'; | ||
let url = `http://${project}.${host}/logstores/${logstore}/track?`; | ||
// log 基础信息,保留字段, 如果传入参数有这些字段会被覆盖。 | ||
const baseData = { | ||
__topic__: topic, // 日志类型 | ||
APIVersion: '0.6.0', // sls 必须的参数 | ||
platform: `${process.platform}_${process.arch}`, // app 信息 | ||
version: app.getVersion(), // iceworks版本信息 | ||
}; | ||
|
||
// 构造参数 | ||
const totalData = Object.assign(data, baseData); | ||
const dataKeyArray = Object.keys(totalData); | ||
const param = dataKeyArray.reduce((finnalStr, currentKey, index) => { | ||
const currentData = typeof totalData[currentKey] === 'string' | ||
? totalData[currentKey] | ||
: JSON.stringify(totalData[currentKey]); | ||
return `${finnalStr}${currentKey}=${currentData}${dataKeyArray.length - 1 === index ? '' : '&'}`; | ||
}, ''); | ||
|
||
url += param; | ||
|
||
request({ | ||
url, | ||
timeout: 2000, | ||
}); | ||
}; | ||
|
||
module.exports = { | ||
report, | ||
}; |
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
Oops, something went wrong.