Skip to content

Commit

Permalink
iceworks/3.4.3 (#2931)
Browse files Browse the repository at this point in the history
* chore: new version for iceworks-client

* chore: new version for iceworks-cli

* feat: add client version (#2932)

* feat: add asset version

* chore: lint

* chore: new  test for home.html

* fix: set default value for projects (#2937)

* fix: shell path (#2964)

* fix: shell path

* fix: make sure process.env.PATH is string

* chore: using CND qrcode (#2967)

* chore: changlog for 3.4.3 (#2970)

* feat: changlog

* chore: typo

* chore: typo

Co-authored-by: 大果 <sobear.me@gmail.com>
  • Loading branch information
2 people authored and chenbin92 committed Jan 3, 2020
1 parent a23baaf commit 5b9af12
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 15 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# CHANGELOG for iceworks

## 3.4.3

- [feat] Add client version
- [fix] Set default value for projects
- [fix] Environment variable PATH is empty
- [refactor] Using CND QR Code

## 3.4.2

- [refactor] Better user data collection methods
Expand Down
2 changes: 1 addition & 1 deletion packages/iceworks-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iceworks-client",
"version": "3.4.2",
"version": "3.4.3",
"description": "iceworks client",
"files": [
"build"
Expand Down
2 changes: 1 addition & 1 deletion packages/iceworks-client/src/components/GlobalBar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ const GlobalBar = ({ project, intl }) => {
<a
target="_blank"
rel="noopener noreferrer"
href="https://img.alicdn.com/tfs/TB1q_oaQgTqK1RjSZPhXXXfOFXa-993-1280.png"
href="https://ice.alicdn.com/assets/images/qrcode.png"
style={{ display: 'block', marginBottom: '5px' }}
>
<FormattedMessage id="iceworks.global.bar.feedback.join" />
Expand Down
4 changes: 2 additions & 2 deletions packages/iceworks-server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iceworks-server",
"version": "3.4.2",
"version": "3.4.3",
"description": "iceworks server",
"files": [
"dist/",
Expand Down Expand Up @@ -50,7 +50,7 @@
"request-promise-native": "^1.0.7",
"rimraf": "^2.6.3",
"semver": "^6.0.0",
"shell-path": "^2.1.0",
"shell-env": "^3.0.0",
"simple-git": "^1.113.0",
"tar": "^4.4.8",
"terminate": "^2.1.2",
Expand Down
3 changes: 3 additions & 0 deletions packages/iceworks-server/src/app/middleware/client.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { checkAliInternal } from 'ice-npm-utils';

const packageJSON = require('../../../package.json');

export default function() {
return async function client(ctx, next) {
if (String(ctx.path).indexOf('/api') === 0) {
Expand All @@ -15,6 +17,7 @@ export default function() {
socketUrl: `//127.0.0.1:${process.env.PORT}/`,
apiUrl: `//127.0.0.1:${process.env.PORT}/api/`,
isAliInternal: await checkAliInternal(),
clientVersion: packageJSON.version.split('.').join(''),
};

await next();
Expand Down
4 changes: 2 additions & 2 deletions packages/iceworks-server/src/app/view/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge,chrome=1" />
<meta name="viewport" content="width=device-width" />
<link href="{{ clientPath }}css/index.css" rel="stylesheet" />
<link href="{{ clientPath }}css/index.css?v={{clientVersion}}" rel="stylesheet" />
<link rel="shortcut icon" href="{{ clientPath }}favicon.png" />
<title>iceworks</title>
</head>
Expand All @@ -18,6 +18,6 @@
isAliInternal: {{isAliInternal}},
};
</script>
<script src="{{ clientPath }}js/index.js"></script>
<script src="{{ clientPath }}js/index.js?v={{clientVersion}}"></script>
</body>
</html>
15 changes: 8 additions & 7 deletions packages/iceworks-server/src/lib/plugin/project-manager/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as trash from 'trash';
import * as path from 'path';
import * as fs from 'fs';
import * as util from 'util';
import * as shellPath from 'shell-path';
import * as shellEnv from 'shell-env';
import * as pathKey from 'path-key';
import * as _ from 'lodash';
import * as mkdirp from 'mkdirp';
Expand Down Expand Up @@ -99,18 +99,19 @@ class Project implements IProject {
const PATH = pathKey();

const env = process.env;
const envPath = shellPath.sync().split(path.delimiter);
envPath.unshift(path.join(this.path, 'node_modules', '.bin'));
const shellEnvPath = shellEnv.sync().PATH;
const shellEnvPathArr = (typeof shellEnvPath === 'string') ? shellEnvPath.split(path.delimiter) : [];
shellEnvPathArr.unshift(path.join(this.path, 'node_modules', '.bin'));

this.app.logger.info('env.pah:', process.env[PATH]);
this.app.logger.info('env.pah:', env[PATH]);

// for electron fallback
const resourcesPath = process['resourcesPath']; // eslint-disable-line
if (resourcesPath) {
envPath.push(path.join(resourcesPath, 'bin'));
shellEnvPathArr.push(path.join(resourcesPath, 'bin'));
}

env[PATH] = envPath.join(path.delimiter);
env[PATH] = shellEnvPathArr.join(path.delimiter);

this.app.logger.info('setEnv.pah:', env[PATH]);

Expand Down Expand Up @@ -258,7 +259,7 @@ interface ICreateParams {
}

class ProjectManager extends EventEmitter {
private projects;
private projects = [];

private app: ISimpleApp;

Expand Down
4 changes: 2 additions & 2 deletions packages/iceworks-server/test/app/controller/home.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ describe('GET /', () => {

assert.equal(status, 200);

const cssLinkReg = /<link\shref="(.+)css\/index.css"\srel="stylesheet" \/>/i;
const cssLinkReg = /<link\shref="(.+)css\/index.css(.+)"\srel="stylesheet" \/>/i;
const faviconLinkReg = /<link\srel="shortcut\sicon"\shref="(.+)favicon.png"\s\/>/i;
const scriptReg = /<script\ssrc="(.+)js\/index.js"/i;
const scriptReg = /<script\ssrc="(.+)js\/index.js(.+)"/i;
const iceworksConfigScriptReg = /<script>[\s]*window.iceworksConfig/i;
// should load common css
assert.equal(cssLinkReg.test(text), true);
Expand Down

0 comments on commit 5b9af12

Please sign in to comment.