diff --git a/package-lock.json b/package-lock.json index 10ab215..5a6fef5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "@statickit/cli", + "name": "@formspree/cli", "version": "0.9.0", "lockfileVersion": 1, "requires": true, @@ -416,6 +416,13 @@ "minimist": "^1.2.0" } }, + "@formspree/deploy": { + "version": "github:formspree/formspree-deploy#a97f88ff17b4f07728114ed2a069f2ec0042833b", + "from": "github:formspree/formspree-deploy#master", + "requires": { + "axios": "^0.19.0" + } + }, "@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -1022,31 +1029,6 @@ "@sinonjs/commons": "^1.7.0" } }, - "@statickit/core": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/@statickit/core/-/core-2.5.1.tgz", - "integrity": "sha512-DaAoeD4V/Kf1jpzqTEZ/NatYg5b3TUgDN/mbvhUguE6aE00ePVGlX1W790rDGc5rQHMkf1rN5iv428Z1gMNe+g==", - "requires": { - "@types/promise-polyfill": "^6.0.3", - "fetch-ponyfill": "^6.1.0", - "promise-polyfill": "^8.1.3" - } - }, - "@statickit/deploy": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@statickit/deploy/-/deploy-0.3.0.tgz", - "integrity": "sha512-cH3+i5E68hWVAU8pKG7TxvM6FagTMPnx20VosFU3jcH1Uf08Ks/FDY0+20TEIVD5ZFmf5LrFygyGc6EYDEP6UA==", - "requires": { - "axios": "^0.19.0" - } - }, - "@statickit/functions": { - "version": "github:unstacked/statickit-functions#714d8ee5b4384a71bac8cf3937478d3e59684fa2", - "from": "github:unstacked/statickit-functions#37679bcf-8da7-4b23-842b-2eac5026a269", - "requires": { - "@statickit/core": "^2.5.0" - } - }, "@szmarczak/http-timer": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", @@ -1189,11 +1171,6 @@ "integrity": "sha512-boy4xPNEtiw6N3abRhBi/e7hNvy3Tt8E9ZRAQrwAGzoCGZS/1wjo9KY7JHhnfnEsG5wSjDbymCozUM9a3ea7OQ==", "dev": true }, - "@types/promise-polyfill": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/@types/promise-polyfill/-/promise-polyfill-6.0.3.tgz", - "integrity": "sha512-f/BFgF9a+cgsMseC7rpv9+9TAE3YNjhfYrtwCo/pIeCDDfQtE6PY0b5bao2eIIEpZCBUy8Y5ToXd4ObjPSJuFw==" - }, "@types/stack-utils": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-1.0.1.tgz", @@ -2990,14 +2967,6 @@ "bser": "2.1.1" } }, - "fetch-ponyfill": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/fetch-ponyfill/-/fetch-ponyfill-6.1.1.tgz", - "integrity": "sha512-rWLgTr5A44/XhvCQPYj0X9Tc+cjUaHofSM4lcwjc9MavD5lkjIhJ+h8JQlavPlTIgDpwhuRozaIykBvX9ItaSA==", - "requires": { - "node-fetch": "~2.6.0" - } - }, "figgy-pudding": { "version": "3.5.1", "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.1.tgz", @@ -6727,11 +6696,6 @@ "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" }, - "node-fetch": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", - "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==" - }, "node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -7800,11 +7764,6 @@ "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=" }, - "promise-polyfill": { - "version": "8.1.3", - "resolved": "https://registry.npmjs.org/promise-polyfill/-/promise-polyfill-8.1.3.tgz", - "integrity": "sha512-MG5r82wBzh7pSKDRa9y+vllNHz3e3d4CNj1PQE4BQYxLme0gKYYBm9YENq+UkEikyZ0XbiGWxYlVw3Rl9O/U8g==" - }, "promise-retry": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-1.1.1.tgz", diff --git a/package.json b/package.json index 96b841d..f1114a6 100644 --- a/package.json +++ b/package.json @@ -42,8 +42,7 @@ ] }, "dependencies": { - "@statickit/deploy": "^0.3.0", - "@statickit/functions": "github:unstacked/statickit-functions#37679bcf-8da7-4b23-842b-2eac5026a269", + "@formspree/deploy": "github:formspree/formspree-deploy#master", "axios": "^0.19.0", "chalk": "^2.4.2", "common-tags": "^1.8.0", @@ -70,4 +69,4 @@ "np": { "yarn": false } -} \ No newline at end of file +} diff --git a/src/cmds/deploy.js b/src/cmds/deploy.js index 15d1dc0..d6b0f26 100644 --- a/src/cmds/deploy.js +++ b/src/cmds/deploy.js @@ -1,5 +1,5 @@ const chalk = require('chalk'); -const deploy = require('@statickit/deploy'); +const deploy = require('@formspree/deploy'); const ora = require('ora'); const version = require('../../package.json').version; const log = require('../log'); @@ -44,15 +44,15 @@ exports.builder = yargs => { }); yargs.option('file', { - describe: 'Path to the local `statickit.json` file', - default: 'statickit.json' + describe: 'Path to the local `formspree.json` file', + default: 'formspree.json' }); }; exports.handler = async args => { const rawConfig = args.config || deploy.getRawConfig(args); - const endpoint = args.endpoint || 'https://api.statickit.com'; - const userAgent = `@statickit/cli@${version}`; + const endpoint = args.endpoint || 'https://formspree-cli.herokuapp.com'; + const userAgent = `@formspree/cli@${version}`; const spinner = ora(chalk.gray('Deploying...')); if (!rawConfig) { diff --git a/src/version_check.js b/src/version_check.js index 4d8cd6d..4918abb 100644 --- a/src/version_check.js +++ b/src/version_check.js @@ -10,7 +10,7 @@ module.exports = async () => { spinner.start(); try { - const manifest = await pacote.manifest('@statickit/cli@latest'); + const manifest = await pacote.manifest('@formspree/cli@latest'); const newVersion = manifest.version; spinner.stop(); @@ -21,7 +21,7 @@ module.exports = async () => { `${chalk.yellow.bold('Update Available!')} ${chalk.gray( `v${installedVersion} ➜ v${newVersion}` )}\n Run ${log.variable( - 'npm i -g @statickit/cli@latest' + 'npm i -g @formspree/cli@latest' )} to update.\n` ); } diff --git a/test/cmds/deploy.test.js b/test/cmds/deploy.test.js index 8377270..2d7247b 100644 --- a/test/cmds/deploy.test.js +++ b/test/cmds/deploy.test.js @@ -1,10 +1,10 @@ -const deploy = require('@statickit/deploy'); +const deploy = require('@formspree/deploy'); const version = require('../../package.json').version; jest.mock('process', () => ({ env: { MY_SECRET: 'pa$$w0rd', API_KEY: '12345' } })); -jest.mock('@statickit/deploy'); +jest.mock('@formspree/deploy'); jest.mock('ora', () => { return () => ({ @@ -30,7 +30,7 @@ it('sends a deploy request with the right params', async () => { deploy.request.mockImplementation(params => { expect(params.config).toStrictEqual({}); expect(params.key).toBe('xxx'); - expect(params.userAgent).toBe(`@statickit/cli@${version}`); + expect(params.userAgent).toBe(`@formspree/cli@${version}`); return Promise.resolve({ status: 200, data: { id: 'xxxx-xxxx-xxxx' } }); });