diff --git a/README.md b/README.md index 4ac835677..2c9247a67 100644 --- a/README.md +++ b/README.md @@ -24,10 +24,10 @@ A collection of AMP tools making it easier to publish and host AMP pages. The fo - **[amp-cache-list](./packages/cache-list):** a javascript library for listing the known AMP Caches. - **[amp-cli](./packages/cli):** a command line version of AMP Toolbox - **[amp-cors](./packages/cors):** a connect/express middleware to automatically add [AMP Cors headers](https://www.ampproject.org/docs/fundamentals/amp-cors-requests). -- **[amp-download-runtime](./packages/download-runtime):** a javascript library for downloading the AMP runtime. - **[amp-linter](./packages/linter):** a javascript library for linting AMP documents (includes CLI mode). - **[amp-optimizer](./packages/optimizer):** a javascript library implementing server-side-rendering for AMP pages. - **[amp-optimizer-express](./packages/optimizer-express)** an [express](http://expressjs.com/) middleware that applies AMP server-side-rendering on the fly. +- **[amp-runtime-fetch](./packages/runtime-fetch):** a javascript library for downloading the AMP runtime. - **[amp-runtime-version](./packages/runtime-version):** a javascript library for querying the current AMP runtime version. - **[amp-script-csp](./packages/script-csp):** a javascript library for calculating [`amp-script`](https://amp.dev/documentation/components/amp-script/) compatible CSP hashes. - **[amp-update-cache](./packages/update-cache):** a javascript library for updating AMP documents in AMP Caches. diff --git a/package-lock.json b/package-lock.json index 90ca2a1f8..b374d3fe6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -83,9 +83,9 @@ "requires": { "@ampproject/toolbox-cache-list": "^2.1.0", "@ampproject/toolbox-cache-url": "^2.1.0", - "@ampproject/toolbox-download-runtime": "^2.1.0", "@ampproject/toolbox-linter": "^2.1.0", "@ampproject/toolbox-optimizer": "^2.1.0", + "@ampproject/toolbox-runtime-fetch": "^2.1.0", "@ampproject/toolbox-runtime-version": "^2.1.0", "@ampproject/toolbox-update-cache": "^2.1.0", "minimist": "1.2.5", @@ -123,51 +123,6 @@ "@ampproject/toolbox-core": "^2.1.0" } }, - "@ampproject/toolbox-download-runtime": { - "version": "file:packages/download-runtime", - "requires": { - "@ampproject/toolbox-cache-list": "^2.1.0", - "@ampproject/toolbox-core": "^2.1.0", - "@ampproject/toolbox-runtime-version": "^2.1.0", - "at-least-node": "1.0.0", - "cross-fetch": "3.0.4", - "fs-extra": "9.0.0" - }, - "dependencies": { - "fs-extra": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.0.tgz", - "integrity": "sha512-pmEYSk3vYsG/bF651KPUXZ+hvjpgWYw/Gc7W9NFUe3ZVLczKKWIij3IKpOrQcdw4TILtibFslZ0UmR8Vvzig4g==", - "requires": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^1.0.0" - }, - "dependencies": { - "at-least-node": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", - "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==" - } - } - }, - "jsonfile": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.0.1.tgz", - "integrity": "sha512-jR2b5v7d2vIOust+w3wtFKZIfpC2pnRmFAhAC/BuweZFQR8qZzxH1OyrQ10HmdVYiXWkYUqPVsz91cG7EL2FBg==", - "requires": { - "graceful-fs": "^4.1.6", - "universalify": "^1.0.0" - } - }, - "universalify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz", - "integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==" - } - } - }, "@ampproject/toolbox-linter": { "version": "file:packages/linter", "requires": { @@ -433,6 +388,68 @@ } } }, + "@ampproject/toolbox-runtime-fetch": { + "version": "file:packages/runtime-fetch", + "requires": { + "@ampproject/toolbox-cache-list": "^2.1.0", + "@ampproject/toolbox-core": "^2.1.0", + "@ampproject/toolbox-runtime-version": "^2.1.0", + "at-least-node": "1.0.0", + "cross-fetch": "3.0.4", + "fs-extra": "9.0.0" + }, + "dependencies": { + "@ampproject/toolbox-cache-list": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@ampproject/toolbox-cache-list/-/toolbox-cache-list-2.1.0.tgz", + "integrity": "sha512-7P65pcNxgdz1H4lhY3oeJlkNi7S4XYO8qCE0/cqtXl1tNuTsmzZhJ1UG1VhMz3AMqnv9KBMBeuhQ3AC6IQbNWw==", + "requires": { + "@ampproject/toolbox-core": "^2.1.0" + } + }, + "@ampproject/toolbox-core": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@ampproject/toolbox-core/-/toolbox-core-2.1.0.tgz", + "integrity": "sha512-8xwrkoaf515dsigSIytdeX1ZqMlHyza+0DXUr45NTv53uFQxiUIjGNv0VNaK+3YLTCPB0dOgQ9kNHqjDz5Ep2g==", + "requires": { + "cross-fetch": "3.0.4" + } + }, + "@ampproject/toolbox-runtime-version": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@ampproject/toolbox-runtime-version/-/toolbox-runtime-version-2.1.0.tgz", + "integrity": "sha512-2nQy9tT4uqQG/MqhmWrbC05hQxuX2g//CHbIBfA4kLOt/QlHiAqv4Yjqe3SAeCMEbhejnPj+rYs67JogrDYbKA==", + "requires": { + "@ampproject/toolbox-core": "^2.1.0" + } + }, + "fs-extra": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.0.tgz", + "integrity": "sha512-pmEYSk3vYsG/bF651KPUXZ+hvjpgWYw/Gc7W9NFUe3ZVLczKKWIij3IKpOrQcdw4TILtibFslZ0UmR8Vvzig4g==", + "requires": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^1.0.0" + } + }, + "jsonfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.0.1.tgz", + "integrity": "sha512-jR2b5v7d2vIOust+w3wtFKZIfpC2pnRmFAhAC/BuweZFQR8qZzxH1OyrQ10HmdVYiXWkYUqPVsz91cG7EL2FBg==", + "requires": { + "graceful-fs": "^4.1.6", + "universalify": "^1.0.0" + } + }, + "universalify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz", + "integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==" + } + } + }, "@ampproject/toolbox-runtime-version": { "version": "file:packages/runtime-version", "requires": { @@ -3538,8 +3555,7 @@ "@types/color-name": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", - "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", - "dev": true + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==" }, "@types/debug": { "version": "4.1.5", @@ -6535,7 +6551,6 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", - "dev": true, "requires": { "once": "^1.4.0" } @@ -7852,7 +7867,6 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.1.0.tgz", "integrity": "sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw==", - "dev": true, "requires": { "pump": "^3.0.0" } @@ -8148,8 +8162,7 @@ "graceful-fs": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.0.tgz", - "integrity": "sha512-jpSvDPV4Cq/bgtpndIWbI5hmYxhQGHPC4d4cqBPb4DLniCfhJokdXhwhaDuLBGLQdvvRum/UiX6ECVIPvDXqdg==", - "dev": true + "integrity": "sha512-jpSvDPV4Cq/bgtpndIWbI5hmYxhQGHPC4d4cqBPb4DLniCfhJokdXhwhaDuLBGLQdvvRum/UiX6ECVIPvDXqdg==" }, "growly": { "version": "1.3.0", @@ -8479,8 +8492,7 @@ "human-signals": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", - "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", - "dev": true + "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==" }, "humanize-ms": { "version": "1.2.1", @@ -9109,8 +9121,7 @@ "is-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", - "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", - "dev": true + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==" }, "is-subset": { "version": "0.1.1", @@ -9184,8 +9195,7 @@ "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, "isobject": { "version": "3.0.1", @@ -12246,8 +12256,7 @@ "merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" }, "merge2": { "version": "1.3.0", @@ -12388,8 +12397,7 @@ "mimic-fn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" }, "min-document": { "version": "2.19.0", @@ -13111,7 +13119,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", - "dev": true, "requires": { "path-key": "^3.0.0" }, @@ -13119,8 +13126,7 @@ "path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" } } }, @@ -13337,7 +13343,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, "requires": { "wrappy": "1" } @@ -13346,7 +13351,6 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz", "integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==", - "dev": true, "requires": { "mimic-fn": "^2.1.0" } @@ -14627,7 +14631,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, "requires": { "end-of-stream": "^1.1.0", "once": "^1.3.1" @@ -15707,8 +15710,7 @@ "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "dev": true + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" }, "simple-swizzle": { "version": "0.2.2", @@ -16619,8 +16621,7 @@ "strip-final-newline": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", - "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", - "dev": true + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==" }, "strip-indent": { "version": "2.0.0", @@ -18093,8 +18094,7 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "write": { "version": "1.0.3", diff --git a/package.json b/package.json index 57c2dc08e..63b43e48d 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "@ampproject/toolbox-cli": "file:packages/cli", "@ampproject/toolbox-core": "file:packages/core", "@ampproject/toolbox-cors": "file:packages/cors", - "@ampproject/toolbox-download-runtime": "file:packages/download-runtime", + "@ampproject/toolbox-runtime-fetch": "file:packages/runtime-fetch", "@ampproject/toolbox-linter": "file:packages/linter", "@ampproject/toolbox-optimizer": "file:packages/optimizer", "@ampproject/toolbox-optimizer-express": "file:packages/optimizer-express", diff --git a/packages/cli/lib/cmds/downloadRuntime.js b/packages/cli/lib/cmds/downloadRuntime.js index aa0e92809..ddf7be801 100644 --- a/packages/cli/lib/cmds/downloadRuntime.js +++ b/packages/cli/lib/cmds/downloadRuntime.js @@ -18,7 +18,7 @@ const path = require('path'); -const downloadRuntimeProvider = require('@ampproject/toolbox-download-runtime'); +const downloadRuntimeProvider = require('@ampproject/toolbox-runtime-fetch'); async function downloadRuntime(args, _) { const {host, clear, dest, rtv} = args; diff --git a/packages/cli/package.json b/packages/cli/package.json index 6e5f415a6..3aa33a683 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -29,7 +29,7 @@ "dependencies": { "@ampproject/toolbox-cache-list": "^2.1.0", "@ampproject/toolbox-cache-url": "^2.1.0", - "@ampproject/toolbox-download-runtime": "^2.1.0", + "@ampproject/toolbox-runtime-fetch": "^2.1.0", "@ampproject/toolbox-linter": "^2.1.0", "@ampproject/toolbox-optimizer": "^2.1.0", "@ampproject/toolbox-runtime-version": "^2.1.0", diff --git a/packages/download-runtime/README.md b/packages/runtime-fetch/README.md similarity index 92% rename from packages/download-runtime/README.md rename to packages/runtime-fetch/README.md index efeb32e47..a5080ab02 100644 --- a/packages/download-runtime/README.md +++ b/packages/runtime-fetch/README.md @@ -1,6 +1,6 @@ # AMP Download Runtime -[![npm version](https://badge.fury.io/js/%40ampproject%2Ftoolbox-download-runtime.svg)](https://badge.fury.io/js/%40ampproject%2Ftoolbox-download-runtime) +[![npm version](https://badge.fury.io/js/%40ampproject%2Ftoolbox-runtime-fetch.svg)](https://badge.fury.io/js/%40ampproject%2Ftoolbox-runtime-fetch) The AMP Download Runtime tool fetches a complete, compiled AMP runtime and saves it to disk. You can use this tool to fetch [AMP Project releases](https://github.com/ampproject/amphtml/releases) from `cdn.ampproject.org` or direct it to download an AMP runtime hosted elsewhere. @@ -11,7 +11,7 @@ Special handling is included for amp-geo. For hosting environments that [dynamic Install via: ```sh -npm install @ampproject/toolbox-download-runtime --save +npm install @ampproject/toolbox-runtime-fetch --save ``` ## Options @@ -28,7 +28,7 @@ Note: When downloading [AMP Project releases](https://github.com/ampproject/amph Basic usage: ```js -const downloadRuntime = require('@ampproject/toolbox-download-runtime'); +const downloadRuntime = require('@ampproject/toolbox-runtime-fetch'); let result; diff --git a/packages/download-runtime/index.js b/packages/runtime-fetch/index.js similarity index 100% rename from packages/download-runtime/index.js rename to packages/runtime-fetch/index.js diff --git a/packages/download-runtime/lib/DownloadRuntime.js b/packages/runtime-fetch/lib/DownloadRuntime.js similarity index 99% rename from packages/download-runtime/lib/DownloadRuntime.js rename to packages/runtime-fetch/lib/DownloadRuntime.js index fd85b6bd9..6f71add0f 100644 --- a/packages/download-runtime/lib/DownloadRuntime.js +++ b/packages/runtime-fetch/lib/DownloadRuntime.js @@ -19,7 +19,7 @@ const cacheListProvider = require('@ampproject/toolbox-cache-list'); const crossFetch = require('cross-fetch'); const fse = require('fs-extra'); const https = require('https'); -const log = require('@ampproject/toolbox-core').log.tag('AMP Download Runtime'); +const log = require('@ampproject/toolbox-core').log.tag('Runtime Download'); const os = require('os'); const path = require('path'); const runtimeVersionProvider = require('@ampproject/toolbox-runtime-version'); diff --git a/packages/download-runtime/package.json b/packages/runtime-fetch/package.json similarity index 86% rename from packages/download-runtime/package.json rename to packages/runtime-fetch/package.json index 8c73568c2..8d1e872a5 100644 --- a/packages/download-runtime/package.json +++ b/packages/runtime-fetch/package.json @@ -1,5 +1,5 @@ { - "name": "@ampproject/toolbox-download-runtime", + "name": "@ampproject/toolbox-runtime-fetch", "version": "2.1.0", "description": "Download the AMP runtime", "main": "index.js", @@ -15,7 +15,7 @@ "repository": { "type": "git", "url": "git+https://github.com/ampproject/amp-toolbox.git", - "directory": "packages/download-runtime" + "directory": "packages/runtime-fetch" }, "author": "AMPHTML Team", "license": "Apache-2.0", @@ -30,6 +30,6 @@ "bugs": { "url": "https://github.com/ampproject/amp-toolbox/issues" }, - "homepage": "https://github.com/ampproject/amp-toolbox/tree/master/packages/download-runtime", + "homepage": "https://github.com/ampproject/amp-toolbox/tree/master/packages/runtime-fetch", "gitHead": "a6bc962a0af397c2fc21de1e8a730257947d8fb6" } diff --git a/packages/download-runtime/spec/lib/DownloadRuntimeSpec.js b/packages/runtime-fetch/spec/lib/DownloadRuntimeSpec.js similarity index 100% rename from packages/download-runtime/spec/lib/DownloadRuntimeSpec.js rename to packages/runtime-fetch/spec/lib/DownloadRuntimeSpec.js