Commit 27dea118 authored by Dana Keeler's avatar Dana Keeler
Browse files

Bug 1811633 - vendor PKI.js r=tjr,Gijs

parent b20db2f2
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -131,6 +131,9 @@ _OPT\.OBJ/
^remote/test/puppeteer/utils/mochaRunner/lib/
^remote/test/puppeteer/website

^third_party/js/PKI.js/node_modules/
^third_party/js/PKI.js/package-lock.json

# git checkout of libstagefright
^media/libstagefright/android$

+30 −0
Original line number Diff line number Diff line
Copyright (c) 2014, GlobalSign
Copyright (c) 2015-2019, Peculiar Ventures
All rights reserved.

Author 2014-2019, Yury Strozhevsky

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
  list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice, this
  list of conditions and the following disclaimer in the documentation and/or
  other materials provided with the distribution.

* Neither the name of the {organization} nor the names of its
  contributors may be used to endorse or promote products derived from
  this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+70 −0
Original line number Diff line number Diff line
diff --git a/rollup.config.js b/rollup.config.js
index 8c8a7c2..b6e61c0 100644
--- a/rollup.config.js
+++ b/rollup.config.js
@@ -3,6 +3,7 @@ import fs from "fs";
 import typescript from "rollup-plugin-typescript2";
 import dts from "rollup-plugin-dts";
 import pkg from "./package.json";
+import { nodeResolve } from '@rollup/plugin-node-resolve';
 
 const LICENSE = fs.readFileSync("LICENSE", { encoding: "utf-8" });
 const banner = [
@@ -12,7 +13,6 @@ const banner = [
   "",
 ].join("\n");
 const input = "src/index.ts";
-const external = Object.keys(pkg.dependencies || {});
 
 export default [
   {
@@ -26,10 +26,10 @@ export default [
             module: "ES2015",
             removeComments: true,
           }
-        }
+        },
       }),
+      nodeResolve(),
     ],
-    external: [...external],
     output: [
       {
         banner,
@@ -45,7 +45,6 @@ export default [
   },
   {
     input,
-    external: [...external],
     plugins: [
       dts({
         tsconfig: path.resolve(__dirname, "./tsconfig.json")
@@ -58,4 +57,4 @@ export default [
       }
     ]
   },
-];
\ No newline at end of file
+];
diff --git a/tsconfig.json b/tsconfig.json
index ffd67ec..e72bdb6 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,7 +1,8 @@
 {
   "compilerOptions": {
-    "target": "ES2019",
-    "module": "CommonJS",
+    "target": "ES6",
+    "module": "ES6",
+    "moduleResolution": "node",
     "strict": true,
     "importHelpers": true,
     "noImplicitOverride": true,
@@ -11,4 +12,4 @@
   "exclude": [
     "build/*.ts"
   ]
-}
\ No newline at end of file
+}
+5 −0
Original line number Diff line number Diff line
#!/bin/sh

patch -p1  < make-esmodule-bundle.patch
npm install
npm run build
+85 −0
Original line number Diff line number Diff line
# Version of this schema
schema: 1

bugzilla:
  # Bugzilla product and component for this directory and subdirectories
  product: Firefox
  component: Security

# Document the source of externally hosted code
origin:

  # Short name of the package/library
  name: PKIjs

  description: TypeScript library for interacting with public key infrastructure types.

  # Full URL for the package's homepage/etc
  # Usually different from repository url
  url: https://pkijs.org/

  # Human-readable identifier for this version/release
  # Generally "version NNN", "tag SSS", "bookmark SSS"
  release: 72d175c9edbc8e00c550dee610a8dac6204f4383 (2023-01-15T09:12:35Z).

  # Revision to pull in
  # Must be a long or short commit SHA (long preferred)
  revision: 72d175c9edbc8e00c550dee610a8dac6204f4383

  # The package's license, where possible using the mnemonic from
  # https://spdx.org/licenses/
  # Multiple licenses can be specified (as a YAML list)
  # A "LICENSE" file must exist containing the full license text
  license: BSD-3-Clause

  # If the package's license is specified in a particular file,
  # this is the name of the file.
  # optional
  license-file: LICENSE

# Configuration for the automated vendoring system.
# optional
vendoring:

  # Repository URL to vendor from
  # eg. https://github.com/kinetiknz/nestegg
  # Any repository host can be specified here, however initially we'll only
  # support automated vendoring from selected sources.
  url: https://github.com/PeculiarVentures/PKI.js

  # Type of hosting for the upstream repository
  # Valid values are 'gitlab', 'github', googlesource
  source-hosting: github

  # Files/paths that will not be vendored from the upstream repository
  # Implicitly contains ".git", and ".gitignore"
  # optional
  exclude:
    - .eslintrc.json
    - .github/
    - .gitignore
    - .mocharc.yaml
    - .nycrc
    - CNAME
    - FEATURES.md
    - MAPPING.md
    - README.md
    - examples/
    - test/
    - typedoc.json

  keep:
    - make_bundle.sh
    - make-esmodule-bundle.patch

  update-actions:
    - action: run-script
      script: 'make_bundle.sh'
      cwd: '{yaml_dir}'

    - action: move-file
      from: 'build/index.es.js'
      to: '../../../toolkit/components/certviewer/content/vendor/pkijs.js'

    - action: delete-path
      path: 'build'
Loading