Skip to content

Commit

Permalink
Merge generate-data into main project (danvk#141)
Browse files Browse the repository at this point in the history
- Translate existing `generate-data` NPM scripts to JavaScript functions
- Remove `foo.1234.js` because it's the same as `foo.min.js`
- Add `sourcesContent` to `map-reference-eol.js` so that EOL can be checked
- Move frequently used NPM scripts to the top
- Add `test:generate-data` script to generate test data
- Update dependencies
- Add `Learn about source maps` section to README
  • Loading branch information
nikolay-borzov authored Mar 10, 2020
1 parent db6bf38 commit 4f9b164
Show file tree
Hide file tree
Showing 47 changed files with 8,595 additions and 4,910 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
*.jsx text
*.less text
*.ls text
*.map text -diff
*.map text
*.od text
*.onlydata text
*.php text diff=php
Expand Down
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,10 @@ source-map-explorer script.js --tsv --no-root
### On error
Errors will be displayed only if no output flags specified
```
source-map-explore with-unmapped.js no-map.js
source-map-explore with-unmapped.js no-map-comment.js
```
```
no-map.js
no-map-comment.js
Unable to find a source map.
See https://github.com/danvk/source-map-explorer/blob/master/README.md#generating-source-maps
with-unmapped.js
Expand Down Expand Up @@ -555,9 +555,14 @@ source-map-explorer path/to/foo.min.js{,.map}

### Other source map tools

[source-map-visualization](https://sokra.github.io/source-map-visualization)
- [source-map-visualization](https://sokra.github.io/source-map-visualization)

[bundle-wizard](https://github.com/aholachek/bundle-wizard): Easier analysis of webapp entry points (uses source-map-explorer under the hood)
- [bundle-wizard](https://github.com/aholachek/bundle-wizard) - Easier analysis of webapp entry points (uses source-map-explorer under the hood)

### Learn about source maps

- [Standard](https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit)
- [Anatomy of source maps](https://www.bugsnag.com/blog/source-maps)

[demo]: https://cdn.rawgit.com/danvk/source-map-explorer/08b0e130cb9345f9061760bf8a8d9136ea60b457/demo.html
[another demo]: https://cdn.rawgit.com/danvk/source-map-explorer/08b0e130cb9345f9061760bf8a8d9136ea60b457/demo-bug.html
Expand Down
9,289 changes: 7,407 additions & 1,882 deletions package-lock.json

Large diffs are not rendered by default.

40 changes: 25 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,22 @@
"node": ">=10"
},
"scripts": {
"pretest:e2e": "npm run build",
"build": "npm-run-all build:*",
"watch": "chokidar src/*.* -c \"npm run build\" --silent --initial --debounce=700",
"test:unit": "mocha --config .mocharc.unit.js",
"test:e2e": "mocha --config .mocharc.e2e.js",
"test:perf": "mocha --config .mocharc.perf.js",
"test": "npm-run-all test:unit test:e2e test:perf",
"test:update-snapshots": "cross-env SNAPSHOT_UPDATE=1 npm run test",
"coverage": "nyc --reporter=lcov --reporter=text npm run test:unit",
"coverage:ci": "nyc npm run test:unit && nyc report --reporter=text-lcov | coveralls",
"lint": "eslint src/**/*.* tests/*.* --fix",
"test:update-snapshots": "cross-env SNAPSHOT_UPDATE=1 npm run test",
"test:generate-data": "ts-node tests/generate-data/index.ts",
"build:clean": "rimraf dist/**/*",
"build:compile": "tsc --project tsconfig.build.json",
"build:copy": "copyfiles -u 1 src/vendor/*.* src/tree-viz.ejs src/types.d.ts dist",
"build:format": "prettier dist/*.js --write",
"build": "npm-run-all build:*",
"watch": "chokidar src/*.* -c \"npm run build\" --silent --initial --debounce=700",
"pretest:e2e": "npm run build",
"coverage:ci": "nyc npm run test:unit && nyc report --reporter=text-lcov | coveralls",
"lint": "eslint src/**/*.* tests/*.* --fix",
"update-dependencies": "npx npm-check-updates -u && npm i",
"prepublishOnly": "npm run build"
},
Expand Down Expand Up @@ -81,10 +82,13 @@
"yargs": "^15.1.0"
},
"devDependencies": {
"@babel/core": "^7.8.7",
"@babel/preset-env": "^7.8.7",
"@istanbuljs/nyc-config-typescript": "^1.0.1",
"@smpx/snap-shot-it": "^6.6.1",
"@types/browserify": "^12.0.36",
"@types/btoa": "^1.2.3",
"@types/chai": "^4.2.9",
"@types/chai": "^4.2.10",
"@types/chai-as-promised": "^7.1.2",
"@types/concat-stream": "^1.6.0",
"@types/convert-source-map": "^1.5.1",
Expand All @@ -93,34 +97,40 @@
"@types/escape-html": "0.0.20",
"@types/glob": "^7.1.1",
"@types/lodash": "^4.14.149",
"@types/mocha": "^7.0.1",
"@types/mocha": "^7.0.2",
"@types/node": "^13.x",
"@types/rimraf": "^2.0.3",
"@types/temp": "^0.8.34",
"@types/yargs": "^15.0.3",
"@typescript-eslint/eslint-plugin": "^2.20.0",
"@typescript-eslint/parser": "^2.20.0",
"@types/yargs": "^15.0.4",
"@typescript-eslint/eslint-plugin": "^2.22.0",
"@typescript-eslint/parser": "^2.22.0",
"babelify": "^10.0.0",
"browserify": "^16.5.0",
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"chokidar-cli": "^2.1.0",
"concat-stream": "^2.0.0",
"copyfiles": "^2.2.0",
"coveralls": "^3.0.9",
"cross-env": "^7.0.0",
"cross-env": "^7.0.2",
"cross-spawn": "^7.0.1",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.10.0",
"eslint-plugin-prettier": "^3.1.2",
"generate-source-map": "0.0.5",
"husky": "^4.2.3",
"lint-staged": "^10.0.7",
"mocha": "^7.0.1",
"lint-staged": "^10.0.8",
"mocha": "^7.1.0",
"npm-run-all": "^4.1.5",
"nyc": "^15.0.0",
"prettier": "^1.19.1",
"rewiremock": "^3.13.9",
"rimraf": "^3.0.2",
"source-map-support": "^0.5.16",
"terser": "^4.6.6",
"terser-webpack-plugin": "^2.3.5",
"ts-node": "^8.6.2",
"typescript": "^3.8.2"
"typescript": "^3.8.3",
"webpack": "^4.42.0"
}
}
5 changes: 2 additions & 3 deletions tests/data/big.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion tests/data/big.js.map

This file was deleted.

2 changes: 0 additions & 2 deletions tests/data/foo.1234.js

This file was deleted.

1 change: 0 additions & 1 deletion tests/data/foo.1234.js.map

This file was deleted.

2 changes: 1 addition & 1 deletion tests/data/foo.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/data/inline-map.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/data/map-reference-eol.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
1 change: 1 addition & 0 deletions tests/data/no-map-comment.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4f9b164

Please sign in to comment.