Skip to content

Commit

Permalink
simplify code contributions by fully automating the dev setup with gi…
Browse files Browse the repository at this point in the history
…tpod.
  • Loading branch information
nisarhassan12 committed Mar 5, 2020
1 parent 6cdd5a0 commit 09725b1
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 9 deletions.
10 changes: 10 additions & 0 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM gitpod/workspace-full-vnc

USER gitpod

RUN sudo apt-get update && \
sudo apt-get install -yq chromium-browser firefox && \
sudo rm -rf /var/lib/apt/lists/*

ENV CHROME_BIN=/usr/bin/chromium-browser
ENV BROWSER="Chrome_Without_Sandbox"
14 changes: 14 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
image:
file: .gitpod.Dockerfile
tasks:
- command: gp await-port 1338 && sleep 3 && gp preview $(gp url 1338)/sandbox/index-local.html
- before: >
cd Tools/Gulp &&
npm i typescript [email protected] -g &&
npm install
command: npm run start
ports:
- port: 1338
onOpen: ignore
- port: 3000
onOpen: ignore
4 changes: 3 additions & 1 deletion Viewer/tests/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
var baseConfig = require('../../tests/karma-browsers.config')

module.exports = function (config) {
config.set({
basePath: '../',
Expand Down Expand Up @@ -56,6 +58,6 @@ module.exports = function (config) {
properties: {} // key value pair of properties to add to the <properties> section of the report
},

browsers: ['ChromeHeadless']
...baseConfig
})
}
5 changes: 3 additions & 2 deletions Viewer/tests/validation/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
var baseConfig = require('../../../tests/karma-browsers.config')

module.exports = function (config) {
'use strict';
config.set({
Expand Down Expand Up @@ -56,7 +58,6 @@ module.exports = function (config) {
properties: {} // key value pair of properties to add to the <properties> section of the report
},

browsers: ['Chrome']

...baseConfig
});
};
6 changes: 6 additions & 0 deletions contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ Please use the Github issues (after discussing them on the forum) **only** for:

We will try to enforce these rules as we consider the forum is a better place for discussions and learnings.

## Online one-click setup for Contributing

Contribute to BabylonJS using a fully featured online development environment; cloned repo, pre-installed dependencies, running web server.

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/from-referrer/)

## Pull requests

We are not complicated people, but we still have some [coding guidelines](http://doc.babylonjs.com/how_to/approved_naming_conventions)
Expand Down
18 changes: 18 additions & 0 deletions dist/preview release/what's new.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

- Scale on one axis for `BoundingBoxGizmo` ([cedricguillemet](https://github.com/cedricguillemet))

- Simplified code contributions by fully automating the dev setup with gitpod ([nisarhassan12](https://github.com/nisarhassan12))

### Engine

- Allow logging of shader code when a compilation error occurs ([Popov72](https://github.com/Popov72))
Expand Down Expand Up @@ -37,3 +39,19 @@


## Breaking changes

My Pr simplifies code contributions by fully automating the dev setup with gitpod, a free online VS Code like IDE with a single click it'll launch a ready-to-code workspace where:

- Babylon.js repo is already cloned.
- dependencies are pre-installed.
- `npm run start` running in `Tools/Gulp`

So that anyone interested in contributing can start straight away without wasting time on the setup.

You can give it a try on my fork of the repo via the following link:

https://gitpod.io/#https://github.com/nisarhassan12/Babylon.js

This is how it looks:

![image](https://user-images.githubusercontent.com/46004116/75895532-9c8eee80-5e57-11ea-93ba-19eade97f08c.png)
11 changes: 11 additions & 0 deletions tests/karma-browsers.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
var env = process.env

module.exports = {
browsers: env.BROWSER ? env.BROWSER.split(',') : ['ChromeHeadless'],
customLaunchers: {
Chrome_Without_Sandbox: {
base: 'Chrome',
flags: ['--no-sandbox', '--disable-setuid-sandbox'],
},
},
}
5 changes: 3 additions & 2 deletions tests/modules/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
var baseConfig = require('../karma-browsers.config')

module.exports = function (config) {
config.set({
basePath: '../../',
Expand Down Expand Up @@ -55,7 +57,6 @@ module.exports = function (config) {
classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element
properties: {} // key value pair of properties to add to the <properties> section of the report
},

browsers: ['ChromeHeadless']
...baseConfig
})
}
5 changes: 3 additions & 2 deletions tests/unit/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
var baseConfig = require('../karma-browsers.config')

module.exports = function(config) {
config.set({
basePath: '../../',
Expand Down Expand Up @@ -74,7 +76,6 @@ module.exports = function(config) {
classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element
properties: {} // key value pair of properties to add to the <properties> section of the report
},

browsers: ['ChromeHeadless']
...baseConfig
})
}
5 changes: 3 additions & 2 deletions tests/validation/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
var baseConfig = require('../karma-browsers.config')

module.exports = function (config) {
'use strict';
config.set({
Expand Down Expand Up @@ -63,8 +65,7 @@ module.exports = function (config) {
classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element
properties: {} // key value pair of properties to add to the <properties> section of the report
},

browsers: ['Chrome']
...baseConfig

});
};

0 comments on commit 09725b1

Please sign in to comment.