Skip to content

Commit

Permalink
issue 597 :grunt watch files for dist/bramble.js (#906)
Browse files Browse the repository at this point in the history
Fix #597
* grunt watch files for dist/bramble.js

* watch other files and run build-browser-dev task

* change package.json scripts

* update readme and package.json script
  • Loading branch information
peiying16 authored and gideonthomas committed Jan 12, 2018
1 parent f5d72f3 commit 9e7e407
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
4 changes: 4 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,10 @@ module.exports = function (grunt) {
test : {
files: ['<%= meta.test %>', 'test/**/*'],
tasks: ['eslint:test']
},
bramble : {
files: ['src/bramble/**/*'],
tasks: ['build-browser-dev']
}
},
/* FIXME (jasonsanjose): how to handle extension tests */
Expand Down
12 changes: 2 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,15 @@ consider adding the `--no-optional` flag to have npm skip installing `iltorb`, w
and requires python, gyp and a working c++ build environment.
See comment in https://github.com/mozilla/brackets/pull/588#issuecomment-280438175

Step 3: run the build

You can build Bramble by running the npm build task:

```
$ npm run build
```

Step 4: Run Bramble:
Step 3: Run Bramble:

The easiest way to run Bramble is to simply use:

```
$ npm start
```

This will generate the strings needed for localization in your `src/nls` folder and allow you to access Bramble on `localhost:8000` (NOTE: you need npm version 5 for the cleanup step to run properly; if it doesn't, use `npm run unlocalize` to restore the files in `src/nls/**/*`). It will also build the Bramble iframe API in `dist/` if necessary. You can terminate the server with `Ctrl+C` which will also clean up the strings that were generated in your `src/nls` folder.
This will generate the strings needed for localization in your `src/nls` folder and allow you to access Bramble on `localhost:8000` (NOTE: you need npm version 5 for the cleanup step to run properly; if it doesn't, use `npm run unlocalize` to restore the files in `src/nls/**/*`). It will also build the Bramble iframe API in `dist/` if necessary. You can terminate the server with `Ctrl+C` which will also clean up the strings that were generated in your `src/nls` folder. If any changes are made in the `src` directory, just refresh the page hosting Bramble in your browser to reflect those changes.

If you want to simply run the server without the localized strings, run:

Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"gunzip-maybe": "^1.3.1",
"http-server": "mozilla/http-server#gzip",
"mkdirp": "0.5.1",
"npm-run-all": "^4.1.2",
"nunjucks": "^2.4.3",
"properties-parser": "0.3.1",
"request": "^2.69.0",
Expand All @@ -72,13 +73,15 @@
"localize-dist": "node scripts/properties2js dist",
"unlocalize": "rimraf src/nls && git checkout -- src/nls",
"postinstall": "grunt install",
"build": "grunt build-browser",
"build": "grunt build-browser-dev",
"watch:api": "grunt watch:bramble",
"preproduction": "grunt build-browser-compressed && npm run unlocalize",
"production": "npm start -- --gzip",
"test": "grunt test",
"server": "http-server -p 8000 --cors",
"prestart": "npm run localize && grunt build-browser-dev",
"start": "npm run server || true",
"start:server": "run-p server watch:api",
"start": "npm run start:server || true",
"poststart": "npm run unlocalize"
},
"license": "MIT"
Expand Down

0 comments on commit 9e7e407

Please sign in to comment.