Skip to content

Commit 44f9b7d

Browse files
committed
Move off of dryice and to webpack for builds.
We were pretty much the last dryice user, and it isn't worth being on such a minority build tool when we don't really want to maintain it ourselves. Additionally, this lets us stop using amdefine and the AMD format, which was an alright choice in 2011 but has increasinly shown its age. Regular Common JS modules are used now, which should pave the way for better tree shaking and unused submodule removal tooling. Note that in order to avoid ruining `git blame`, this leaves each module indented by two spaces as it was from the AMD `define` function, and wraps a block around them so that editors don't freak out too much.
1 parent d55e947 commit 44f9b7d

36 files changed

+284
-788
lines changed

Makefile.dryice.js

Lines changed: 0 additions & 166 deletions
This file was deleted.

README.md

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@
33
This is a library to generate and consume the source map format
44
[described here][format].
55

6-
This library is written in the Asynchronous Module Definition format, and works
7-
in the following environments:
6+
This library is compatible with the following environments:
87

9-
* Modern Browsers supporting ECMAScript 5 (either after the build, or with an
10-
AMD loader such as RequireJS)
8+
* Node.js versions 0.8.X and higher
119

12-
* Inside Firefox (as a JSM file, after the build)
10+
* On the web, with browsers supporting ECMAScript 5 (after the build)
1311

14-
* With NodeJS versions 0.8.X and higher
12+
* Inside Firefox (after the build)
1513

1614
## Node
1715

@@ -23,19 +21,22 @@ Install Node and then run
2321

2422
$ git clone https://fitzgen@github.com/mozilla/source-map.git
2523
$ cd source-map
26-
$ npm link .
2724

2825
Next, run
2926

30-
$ node Makefile.dryice.js
27+
$ npm run build
3128

32-
This should spew a bunch of stuff to stdout, and create the following files:
29+
This will create the following files:
3330

34-
* `dist/source-map.js` - The unminified browser version.
31+
* `dist/source-map.js` - The plain browser build.
3532

36-
* `dist/source-map.min.js` - The minified browser version.
33+
* `dist/source-map.min.js` - The minified browser build.
3734

38-
* `dist/SourceMap.jsm` - The JavaScript Module for inclusion in Firefox source.
35+
* `dist/source-map.min.js.map` - The source map for the minified browser build.
36+
37+
* `dist/source-map.debug.js` - The debug browser build.
38+
39+
* `dist/source-map.debug.js.map` - The source map for the debug browser build.
3940

4041
## Examples
4142

@@ -152,8 +153,7 @@ var sourceMap = require('source-map');
152153
var sourceMap = window.sourceMap;
153154

154155
// Inside Firefox
155-
let sourceMap = {};
156-
Components.utils.import('resource:///modules/devtools/SourceMap.jsm', sourceMap);
156+
const sourceMap = require("devtools/toolkit/sourcemap/source-map.js");
157157
```
158158

159159
### SourceMapConsumer
@@ -473,20 +473,19 @@ The arguments are the same as those to `new SourceMapGenerator`.
473473

474474
[![Build Status](https://travis-ci.org/mozilla/source-map.png?branch=master)](https://travis-ci.org/mozilla/source-map)
475475

476-
Install NodeJS version 0.8.0 or greater, then run `node test/run-tests.js`.
476+
Install NodeJS version 0.8.0 or greater, then run `npm test`.
477477

478-
To add new tests, create a new file named `test/test-<your new test name>.js`
479-
and export your test functions with names that start with "test", for example
478+
To add new tests, create a new file named
479+
`test/source-map/test-your-new-test-name.js` and export your test functions with
480+
names that start with "test", for example
480481

481482
```js
482-
exports["test doing the foo bar"] = function (assert, util) {
483+
exports["test doing the foo bar"] = function (assert) {
483484
...
484485
};
485486
```
486487

487-
The new test will be located automatically when you run the suite.
488-
489-
The `util` argument is the test utility module located at `test/source-map/util`.
488+
The new tests will be located automatically when you run the suite.
490489

491490
The `assert` argument is a cut down version of node's assert module. You have
492491
access to the following assertion functions:
@@ -502,8 +501,8 @@ access to the following assertion functions:
502501
* `throws`
503502

504503
(The reason for the restricted set of test functions is because we need the
505-
tests to run inside Firefox's test suite as well and so the assert module is
506-
shimmed in that environment. See `build/assert-shim.js`.)
504+
tests to run inside Firefox's test suite as well and Firefox has a shimmed
505+
assert module.)
507506

508507
[format]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit
509508
[feature]: https://wiki.mozilla.org/DevTools/Features/SourceMap

build/assert-shim.js

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)