Skip to content
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

feat: export header and Babel preset #5

Merged
merged 1 commit into from
Dec 30, 2019
Merged

Conversation

Thomaash
Copy link
Member

These two things are almost identical across our projects already and it makes a lot of sense to have them shared from a single source.

Babel preset (TypeScript and CSS are optional):

{
  "exclude": ["**/node_modules/**"],
  "presets": [["vis-dev-utils/babel-preset", { "css": true, "ts": true }]]
}

Header for bundled files (reads package.json):

import { generateHeader } from "vis-dev-utils";

const banner = generateHeader();

custom values can be supplied if necessary (tsdoc included):

const banner = generateHeader({ name: 'vis-timeline and vis-graph2d' });

These two things are almost identical across our projects already and it
makes a lot of sense to have them shared from a single source.

Babel preset (TypeScript and CSS are optional):
```json
{
  "exclude": ["**/node_modules/**"],
  "presets": [["vis-dev-utils/babel-preset", { "css": true, "ts": true }]]
}
```

Header (reads package.json):
```javascript
import { generateHeader } from "vis-dev-utils";

const banner = generateHeader();
```

custom values can be supplied if necessary (tsdoc included):
```javascript
const banner = generateHeader({ name: 'vis-timeline and vis-graph2d' });
```
@Thomaash Thomaash requested a review from a team December 29, 2019 20:56
Copy link
Member

@mojoaxel mojoaxel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Thomaash Thomaash merged commit ba46072 into master Dec 30, 2019
@Thomaash Thomaash deleted the babel-and-header branch December 30, 2019 10:12
@vis-bot
Copy link
Collaborator

vis-bot commented Dec 30, 2019

🎉 This PR is included in version 1.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Thomaash added a commit to visjs/vis-uuid that referenced this pull request Dec 30, 2019
Thomaash added a commit to visjs/vis-util that referenced this pull request Dec 30, 2019
Thomaash added a commit to visjs/vis-graph3d that referenced this pull request Dec 30, 2019
See visjs/vis-dev-utils#5.

As in other projects has already been done:
- There should be no more prototype polution.
- Uglify was replaced by Terser (Uglify was removing the header).
- The build in banner was used instead of the plugin (the plugin was
messing up source maps which now work).
- Some unused dependencies were removed.
Thomaash added a commit to visjs/vis-data that referenced this pull request Dec 30, 2019
See visjs/vis-dev-utils#5.

The build in banner was used instead of the plugin (the plugin was
messing up source maps which now work).
Thomaash added a commit to visjs/vis-data that referenced this pull request Dec 30, 2019
See visjs/vis-dev-utils#5.

The build in banner was used instead of the plugin (the plugin was
messing up source maps which now work).
Thomaash added a commit to visjs/vis-network that referenced this pull request Dec 30, 2019
Thomaash added a commit to visjs/vis-network that referenced this pull request Dec 30, 2019
Thomaash added a commit to visjs/vis-timeline that referenced this pull request Dec 30, 2019
See visjs/vis-dev-utils#5.

This also removes prototype pollution associated with the previously
used `useBuiltIns: true`.
yotamberk pushed a commit to visjs/vis-util that referenced this pull request Dec 30, 2019
yotamberk pushed a commit to visjs/vis-timeline that referenced this pull request Dec 30, 2019
See visjs/vis-dev-utils#5.

This also removes prototype pollution associated with the previously
used `useBuiltIns: true`.
yotamberk pushed a commit to visjs/vis-network that referenced this pull request Dec 30, 2019
yotamberk pushed a commit to visjs/vis-data that referenced this pull request Dec 30, 2019
See visjs/vis-dev-utils#5.

The build in banner was used instead of the plugin (the plugin was
messing up source maps which now work).
Thomaash added a commit to visjs/vis-graph3d that referenced this pull request Jan 2, 2020
See visjs/vis-dev-utils#5.

As in other projects has already been done:
- There should be no more prototype polution.
- Uglify was replaced by Terser (Uglify was removing the header).
- The build in banner was used instead of the plugin (the plugin was
messing up source maps which now work).
- Some unused dependencies were removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants