-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed some follow ups after restructuring and issues around generator-theia #310
Changes from all commits
da86895
0f8189c
b87dccd
e70a143
64c9ddc
29b824c
d2cf122
2481dfe
52a0dfe
fef2693
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,16 +41,28 @@ This command does a few things: | |
|
||
## Run the browser-based example application | ||
|
||
We can start the application with: | ||
We can start the application from the examples/browser directory with: | ||
|
||
npm start | ||
|
||
This command starts the backend application, a small web server and a browser | ||
tab with the frontend. | ||
|
||
If you rebuild native node packages for electron then | ||
rollback these changes before starting the browser example | ||
by running from the root directory: | ||
|
||
npm run rebuild:web | ||
|
||
## Run the electron-based example application | ||
|
||
It can also be started with: | ||
From the root directory run: | ||
|
||
npm run rebuild:electron | ||
|
||
This command rebuilds native node packages against the version of node used by electron. | ||
|
||
It can also be started from the examples/electron directory with: | ||
|
||
npm start | ||
|
||
|
@@ -116,16 +128,17 @@ To build and run the browser example: | |
|
||
git clone https://github.com/theia-ide/theia \ | ||
&& cd theia \ | ||
&& npm install --unsafe-perm\ | ||
&& cd ../../examples/browser \ | ||
&& npm install --unsafe-perm \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. BTW we discussed this a bit and --unsafe-perm looks really weird. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you open an issue for it? or PR :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Issue #311 |
||
&& cd examples/browser \ | ||
&& npm run start | ||
|
||
To build and run the electron example: | ||
|
||
git clone https://github.com/theia-ide/theia \ | ||
&& cd theia \ | ||
&& npm install --unsafe-perm\ | ||
&& cd ../../examples/electron \ | ||
&& npm install --unsafe-perm \ | ||
&& npm run rebuild:electron \ | ||
&& cd examples/electron \ | ||
&& npm run start | ||
|
||
## Code coverage | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,6 @@ const CopyWebpackPlugin = require('copy-webpack-plugin'); | |
const CircularDependencyPlugin = require('circular-dependency-plugin'); | ||
|
||
const outputPath = path.resolve(__dirname, 'lib'); | ||
const emptyPath = path.resolve(__dirname, 'webpack_empty.js'); | ||
|
||
const monacoEditorPath = '../../node_modules/monaco-editor-core/min/vs'; | ||
const monacoLanguagesPath = '../../node_modules/monaco-languages/release'; | ||
|
@@ -64,18 +63,13 @@ module.exports = { | |
resolve: { | ||
extensions: ['.js'], | ||
alias: { | ||
'vs': path.resolve(outputPath, monacoEditorPath), | ||
'dtrace-provider': emptyPath, | ||
'safe-json-stringify': emptyPath, | ||
'mv': emptyPath, | ||
'source-map-support': emptyPath | ||
'vs': path.resolve(outputPath, monacoEditorPath) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this not needed for bunyan anymore? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't use bunyan in the frontend and use the webpack to build only the frontend, so these modules are never bundled There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right :) thx |
||
} | ||
}, | ||
devtool: 'source-map', | ||
plugins: [ | ||
// @ts-ignore | ||
new webpack.HotModuleReplacementPlugin(), | ||
CopyWebpackPlugin([ | ||
new CopyWebpackPlugin([ | ||
{ | ||
from: requirePath, | ||
to: '.' | ||
|
@@ -124,8 +118,6 @@ module.exports = { | |
'*': 'http://' + host + ':' + port, | ||
}, | ||
historyApiFallback: true, | ||
hot: true, | ||
inline: true, | ||
stats: { | ||
colors: true, | ||
warnings: false | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,7 @@ export abstract class AbstractGenerator { | |
return `Promise.resolve(${invocation})`; | ||
} | ||
return invocation; | ||
}).map(statement => `.then(function () { return ${statement}.then(load) })`); | ||
}).map(statement => ` .then(function () { return ${statement}.then(load) })`); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is this change for? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. to fix indentation in the generated source files: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes thx for that! I had run into trouble with it |
||
return os.EOL + lines.join(os.EOL); | ||
} | ||
|
||
|
@@ -60,4 +60,20 @@ export abstract class AbstractGenerator { | |
return copyright ? copyright + os.EOL : ''; | ||
} | ||
|
||
protected isWeb(): boolean { | ||
return this.model.target === 'web'; | ||
} | ||
|
||
protected isElectron(): boolean { | ||
return this.model.target === 'electron'; | ||
} | ||
|
||
protected ifWeb(value: string, defaultValue: string = '') { | ||
return this.isWeb() ? value : defaultValue; | ||
} | ||
|
||
protected ifElectron(value: string, defaultValue: string = '') { | ||
return this.isElectron() ? value : defaultValue; | ||
} | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this travis specific or it's passed to lerna or something ?
I can't find options on lerna or npm and travis ci references bundler_args with the ruby bundler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is travis specific, depending on provided language travis knows how to build the project, like run
npm install
first and thennpm test
for node projects. It also has some defaults for such projects, e.g. for node to try to runnpm install
3 times if the first fails, since npmjs sometimes is not available.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK thanks!