summaryrefslogtreecommitdiffstats
path: root/browser/components/newtab/bin/vendor.js
blob: 3d929dcf4b7e6e6768e555eb8f3543a746f0eaab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env node
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

/* eslint-disable no-console */

const { cp, set } = require("shelljs");
const path = require("path");

const filesToVendor = {
  // XXX currently these two licenses are identical.  Perhaps we should check
  // in case that changes at some point in the future.
  "react/LICENSE": "REACT_AND_REACT_DOM_LICENSE",
  "react/umd/react.production.min.js": "react.js",
  "react/umd/react.development.js": "react-dev.js",
  "react-dom/umd/react-dom.production.min.js": "react-dom.js",
  "react-dom/umd/react-dom.development.js": "react-dom-dev.js",
  "react-dom/umd/react-dom-server.browser.production.min.js":
    "react-dom-server.js",
  "react-redux/LICENSE.md": "REACT_REDUX_LICENSE",
  "react-redux/dist/react-redux.min.js": "react-redux.js",
  "react-transition-group/dist/react-transition-group.min.js":
    "react-transition-group.js",
  "react-transition-group/LICENSE": "REACT_TRANSITION_GROUP_LICENSE",
};

set("-v"); // Echo all the copy commands so the user can see what's going on
for (let srcPath of Object.keys(filesToVendor)) {
  cp(
    path.join("node_modules", srcPath),
    path.join("vendor", filesToVendor[srcPath])
  );
}

console.log(`
Check to see if any license files have changed, and, if so, be sure to update
https://searchfox.org/mozilla-central/source/toolkit/content/license.html`);