Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[iceworks] release-3.0.0-beta.7 #2484

Merged
merged 9 commits into from
Jul 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## 3.0.0-beta.7

- [fix] fixed node environment variable in production
- [fix] dependency panel optimization
- [fix] theme text change

## 3.0.0-beta.6

- [feat] support npm client select #2469
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.0.0-beta.6",
"version": "3.0.0-beta.7",
"description": "",
"files": [
"build"
Expand Down
3 changes: 2 additions & 1 deletion packages/iceworks-client/src/components/GlobalBar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ const GlobalBar = ({ project, intl }) => {
});

const hiddenClassName = globalTerminalStore.dataSource.show ? '' : styles.hidden;
const themeKey = themeValue === 'dark' ? 'light' : 'dark';

return project.name ? (
<div className={styles.container}>
Expand Down Expand Up @@ -123,7 +124,7 @@ const GlobalBar = ({ project, intl }) => {
</div>
<div className={styles.item} onClick={handleTheme}>
<Icon type="zhuti" className={styles.icon} size="small" />
<FormattedMessage id={`iceworks.global.bar.theme.${themeValue}`} />
<FormattedMessage id={`iceworks.global.bar.theme.${themeKey}`} />
</div>
<Balloon
align="tl"
Expand Down
2 changes: 1 addition & 1 deletion packages/iceworks-client/src/hooks/useTask.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const useTask = ({ type, writeLog, writeChunk }) => {
reset: installDependency,
onResetModal: installDependencyVisible,
setResetModal: setInstallDependencyVisible,
} = useDependency(false, writeChunk, false);
} = useDependency(true, writeChunk, false);
const taskErrorEventName = `adapter.task.error`;

async function onStart() {
Expand Down
2 changes: 1 addition & 1 deletion packages/iceworks-server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iceworks-server",
"version": "3.0.0-beta.6",
"version": "3.0.0-beta.7",
"description": "iceworks server",
"files": [
"dist/",
Expand Down
2 changes: 1 addition & 1 deletion packages/iceworks-server/src/interface/dependency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export interface IDependency {
/**
* 最新版本
*/
latestVestion?: string;
latestVersion?: string;

/**
* 是否本地依赖 devDependencies ?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as fsExtra from 'fs-extra';
import * as util from 'util';
import * as rimraf from 'rimraf';
import * as execa from 'execa';
import * as latestVersion from 'latest-version';
// import * as latestVersion from 'latest-version';
import getNpmClient from '../../../getNpmClient';

import { IDependency, IProject, ICreateDependencyParam, IDependencyModule, ISocket, IContext } from '../../../../interface';
Expand Down Expand Up @@ -81,7 +81,6 @@ export default class Dependency implements IDependencyModule {
return version;
}

// TODO any other way?
private async getNpmOutdated(): Promise<INpmOutdatedData[]> {
let npmOutdated = [];

Expand Down Expand Up @@ -142,7 +141,9 @@ export default class Dependency implements IDependencyModule {
specifyVersion,
dev,
localVersion,
latestVersion: await latestVersion(packageName),

// TODO get latestVersion is so slow, so we disable it now
// latestVersion: await latestVersion(packageName),
};
}));
};
Expand All @@ -157,7 +158,8 @@ export default class Dependency implements IDependencyModule {
devDependencies = await getAll(packageDevDependencies, true);
}

const npmOutdated: INpmOutdatedData[] = await this.getNpmOutdated();
// TODO getNpmOutdated is so slow, so we disable it now
const npmOutdated: INpmOutdatedData[] = []; // await this.getNpmOutdated();
npmOutdated.forEach(({ package: _outPackage, wanted }: INpmOutdatedData) => {
const dependency = dependencies.find(({ package: packageName }) => packageName === _outPackage);
if (dependency && dependency.localVersion && dependency.localVersion !== wanted) {
Expand Down
12 changes: 9 additions & 3 deletions packages/iceworks-server/src/lib/plugin/project-manager/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class Project implements IProject {
env[PATH],
];

// for electron
// for electron
const resourcesPath = process['resourcesPath']; // eslint-disable-line
if (resourcesPath) {
pathEnv.push(path.join(resourcesPath, 'bin'));
Expand All @@ -92,6 +92,12 @@ class Project implements IProject {

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

// reset NODE_ENV
// in egg.js: Generally, before deploying the application, dependencies will be installed with NODE_ENV=production or --production
// which will exclude devDependencies because those used in development may increase the size of package released or even create pitfalls that you never expect.
// Refs: https://github.com/eggjs/egg-scripts/blob/master/lib/cmd/start.js#L109
env.NODE_ENV = 'development'

return env;
}

Expand Down Expand Up @@ -313,7 +319,7 @@ class ProjectManager extends EventEmitter {

// check read and write
try {
await accessAsync(targetPath, fs.constants.R_OK | fs.constants.W_OK); // eslint-disable-line
await accessAsync(targetPath, fs.constants.R_OK | fs.constants.W_OK); // eslint-disable-line
} catch (error) {
error.message = '当前路径没有读写权限,请更换项目路径';
throw error;
Expand Down Expand Up @@ -343,7 +349,7 @@ class ProjectManager extends EventEmitter {
private async generateAbcFile(projectDir: string, iceScriptsVersion: string) {
// '^2.0.0' -> true
const latestVersion = /^\^2\./.test(iceScriptsVersion);

const abcData = {
type: latestVersion ? 'ice-scripts' : 'iceworks',
builder: latestVersion ? '@ali/builder-ice-scripts' : '@ali/builder-iceworks',
Expand Down