{"_id":"@ahlec/s3-deployer","_rev":"3-958f3d2b50c639839a228176f0f1cb11","name":"@ahlec/s3-deployer","dist-tags":{"latest":"2.0.0"},"versions":{"1.0.0":{"name":"@ahlec/s3-deployer","version":"1.0.0","description":"Node CLI tool for customized, powerful deploys to S3.","author":{"name":"Alec Jacob Deitloff","email":"alec.deitloff@gmail.com"},"keywords":["s3","deploy","upload","cloudfront","aws","publish"],"publishConfig":{"access":"public"},"license":"MIT","bin":{"s3-deployer":"lib/cli/cli.js"},"main":"./lib/index.js","types":"./lib/index.d.ts","scripts":{"start":"ts-node ./src/cli/cli.ts","build":"tsc","clean":"rm -rf ./lib","lint":"eslint \"./src/**/*.ts\"","format":"prettier --write ."},"repository":{"type":"git","url":"git+https://github.com/ahlec/s3-deployer.git"},"bugs":{"url":"https://github.com/ahlec/s3-deployer/issues"},"dependencies":{"@aws-sdk/client-cloudfront":"^3.43.0","@aws-sdk/client-s3":"^3.44.0","ajv":"^8.9.0","chalk":"4.1.2","cosmiconfig":"^7.0.1","inquirer":"^8.2.0","md5":"^2.3.0","micromatch":"^4.0.4","mime-types":"^2.1.34","wrap-ansi":"^7.0.0","yargs":"^17.3.1"},"devDependencies":{"@types/inquirer":"^8.1.3","@types/md5":"^2.3.1","@types/micromatch":"^4.0.2","@types/mime-types":"^2.1.1","@types/node":"^16.11.11","@types/wrap-ansi":"^8.0.1","@types/yargs":"^17.0.8","@typescript-eslint/eslint-plugin":"^5.9.1","@typescript-eslint/parser":"^5.9.1","eslint":"^8.6.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^4.0.0","prettier":"^2.5.1","ts-node":"^10.4.0","typescript":"4.5.2"},"prettier":{},"packageManager":"yarn@3.1.1","gitHead":"6d066eb21fbc2559953888a7b833e75fbc2adc86","homepage":"https://github.com/ahlec/s3-deployer#readme","_id":"@ahlec/s3-deployer@1.0.0","_nodeVersion":"16.13.1","_npmVersion":"8.1.2","dist":{"integrity":"sha512-paizmTatQl3wuuiHBXlRjWOdXnUyd1mMI3y1qevqG0Dia5UtNbPWipJztAkmYwLGBZAfagInk51ZYAnBG3BjjQ==","shasum":"984fe7c4d269f7d79e5b2d8080e60b675e5752ca","tarball":"https://registry.npmjs.org/@ahlec/s3-deployer/-/s3-deployer-1.0.0.tgz","fileCount":18,"unpackedSize":62053,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8j1VCRA9TVsSAnZWagAA78sP+QCE/s6DzLn1+HSZjvt4\nlotmKETTpC5L4laxTJYqz3+eoMH4r/Ss4d7OlsBhzaGqo4XFFProO4Xs9Q3M\nBPqzIX2u2jH7BBqcjJ2HX9KHGYMo0WgSRl6OE1N4MN8CgQejjvqAS5b2LZgY\ndisP/IDTTDBNkG6WtWFTtocEtnpHF+R1pPXcbfSXBB/fAK+Wa6UMmxv4Oa6T\nOWvQdZoI4OXO3bbKGHVzqik7BkvqSWp2RF6QuqLtDqLin0W64NQg5NwKTk9g\nCpAdIA9BhERi6NcXil3EiO8cB2tXUvz0qXcBN1QAFNEz39EGEEq8sYFlFkqj\nRQ6a5NMPRDhFIeO/ALL7aieoJZ5CpDiCyRoJb/zcZLS378q0YzjW6klqOVGN\n+SS9qGSFK6m7p7Ep79MABPD6CYZO+tzGTcz296kr7DPoJHuk8+7VoVibkpXV\nNB+PAwaf4EhJeM6zDbBqpKPePJ0O+5wKS0Iq3D6UnbW3e+NPXAzIN5nojPoe\nWAnday/nIRA/rGotEFn/l5F8aogJQlYlS7fl23OACsEprkREi0y4hecSK2W0\n6SBOe+YAagkodamlDOE4MtBMHLbh34adkpAmC5ZpCb/7U3EVshIfEDDquIUE\nnORHZOs3HdjSPa15AJPY9cfJbSednHyg5+lUuQPBUmulLYvn0OH8rFDxCZWv\n3Nvo\r\n=6xty\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICHSGw3XG8j9G2eRa5drXxikZOD0I7spHg7KgCShj7yGAiEA9ByPWwI6aia/F+Ns1rIIse2vGbnICK0CXeAYQZ9JFIc="}]},"_npmUser":{"name":"ahlec","email":"alec.deitloff@gmail.com"},"directories":{},"maintainers":[{"name":"ahlec","email":"alec.deitloff@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/s3-deployer_1.0.0_1643265364741_0.4879109697637556"},"_hasShrinkwrap":false},"1.0.1":{"name":"@ahlec/s3-deployer","version":"1.0.1","description":"Node CLI tool for customized, powerful deploys to S3.","author":{"name":"Alec Jacob Deitloff","email":"alec.deitloff@gmail.com"},"keywords":["s3","deploy","upload","cloudfront","aws","publish"],"publishConfig":{"access":"public"},"license":"MIT","bin":{"s3-deployer":"lib/cli/cli.js"},"main":"./lib/index.js","types":"./lib/index.d.ts","scripts":{"start":"ts-node ./src/cli/cli.ts","build":"tsc","clean":"rm -rf ./lib","lint":"eslint \"./src/**/*.ts\"","format":"prettier --write ."},"repository":{"type":"git","url":"git+https://github.com/ahlec/s3-deployer.git"},"bugs":{"url":"https://github.com/ahlec/s3-deployer/issues"},"dependencies":{"@aws-sdk/client-cloudfront":"^3.43.0","@aws-sdk/client-s3":"^3.44.0","ajv":"^8.9.0","chalk":"4.1.2","cosmiconfig":"^7.0.1","inquirer":"^8.2.0","md5":"^2.3.0","micromatch":"^4.0.4","mime-types":"^2.1.34","wrap-ansi":"^7.0.0","yargs":"^17.3.1"},"devDependencies":{"@types/inquirer":"^8.1.3","@types/md5":"^2.3.1","@types/micromatch":"^4.0.2","@types/mime-types":"^2.1.1","@types/node":"^16.11.11","@types/wrap-ansi":"^8.0.1","@types/yargs":"^17.0.8","@typescript-eslint/eslint-plugin":"^5.9.1","@typescript-eslint/parser":"^5.9.1","eslint":"^8.6.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^4.0.0","prettier":"^2.5.1","ts-node":"^10.4.0","typescript":"4.5.2"},"prettier":{},"packageManager":"yarn@3.1.1","gitHead":"b533d00ae2d2dc57cad36d85334b987990a8f5bf","homepage":"https://github.com/ahlec/s3-deployer#readme","_id":"@ahlec/s3-deployer@1.0.1","_nodeVersion":"16.13.1","_npmVersion":"8.1.2","dist":{"integrity":"sha512-39nqdkqfrJqcFN8+q0cVhx21zqK4QNnqujpjc3AyU/7E/b8GalIL6iC0+CrjnAOcnyRRZ8/VZnzh0+b7lgFh3A==","shasum":"9a8aef60285f60bec344cacca4efeceb4f10b458","tarball":"https://registry.npmjs.org/@ahlec/s3-deployer/-/s3-deployer-1.0.1.tgz","fileCount":18,"unpackedSize":62073,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8kF1CRA9TVsSAnZWagAAve4P/R4C/ds0FzIjuLtQI2Cb\nqAyjBn5UNUkJR3J6TchdXyE+YUBaxrp5lLPUCNaU3ds3ttAJFvYg5dHL83Ah\nAw9CroIGmoWD6iRyp5jL0qvCm9Cf3SOKcdMq+ch6GjlnplX3XyTkioBKgKUC\nO2EEYzM6ODUk2aYUzpfHSkilWINQXN7K03Y0INzwXDwztPbUbg7I7b/a1ec7\ndHa415HFtNtjlEcnb8KPH0m1tp1evh8bsrVkrKqIOsfBPQSZcb0+Qi8ViPxO\noqTdlkhowbdBSYVBhO0F/AjHOv1ECaZQeJAX79doMuqeDaoJipSZsDH1t6B6\n2IVO2zyt0xW44oPV1EZFBoHiUNl6NejeguZ8b1IbXTGohVuII5tGlT5CxJhF\ndIc5QauN2Ehj3+/egLpg0WTm8S0AaEJUkT42+uuAfg2HAOdP+L0ujW9T04Pm\na3+TaPZNV+OT17u0QlYlKGPCdQay+T7PGzCpWGXSOoGL9ASl+0iL/VbYYa0y\n5xY79gMtcefgIT5oz9fAgp9LqwfGEjjxLgamgv+Lp7lfYqv+re7arjDoCIqV\nrrOzD58rV8Jj3bB05QudSDLZHOqFgKHjxJQexJsbcW5DbIO1gPVQLSVdP5CG\nEbE0uXYPGQZ1EJ2RMeepU5QBzKvw1sL1pJjzBd7Z/Tw2vj580RwvAN3uSMZ0\ng+Ur\r\n=vBNO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDOVPqPBX3KLpuk3yHOHP0e9sO6HBK/ZLmOSBVL56vVqgIgIKfupzioUUmQa7Xfw80oSZfbmHLxJ+yWyU+WvlGjsbk="}]},"_npmUser":{"name":"ahlec","email":"alec.deitloff@gmail.com"},"directories":{},"maintainers":[{"name":"ahlec","email":"alec.deitloff@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/s3-deployer_1.0.1_1643266421266_0.5178713733662552"},"_hasShrinkwrap":false},"2.0.0":{"name":"@ahlec/s3-deployer","version":"2.0.0","description":"Node CLI tool for customized, powerful deploys to S3.","author":{"name":"Alec Jacob Deitloff","email":"alec.deitloff@gmail.com"},"type":"module","keywords":["s3","deploy","upload","cloudfront","aws","publish"],"publishConfig":{"access":"public"},"license":"MIT","bin":{"s3-deployer":"lib/cli/cli.js"},"exports":"./lib/index.js","types":"./lib/index.d.ts","scripts":{"start":"ts-node ./src/cli/cli.ts","build":"tsc && fix-esm-import-path lib/","clean":"rm -rf ./lib","lint":"eslint \"./src/**/*.ts\"","format":"prettier --write ."},"repository":{"type":"git","url":"git+https://github.com/ahlec/s3-deployer.git"},"bugs":{"url":"https://github.com/ahlec/s3-deployer/issues"},"dependencies":{"@aws-sdk/client-cloudfront":"^3.418.0","@aws-sdk/client-s3":"^3.418.0","ajv":"^8.12.0","chalk":"5.3.0","cosmiconfig":"^8.3.6","inquirer":"^9.2.11","md5":"^2.3.0","micromatch":"^4.0.5","mime-types":"^2.1.35","wrap-ansi":"^8.1.0","yargs":"^17.7.2"},"devDependencies":{"@types/inquirer":"^9.0.3","@types/md5":"^2.3.2","@types/micromatch":"^4.0.2","@types/mime-types":"^2.1.1","@types/node":"^20.6.3","@types/wrap-ansi":"^8.0.1","@types/yargs":"^17.0.24","@typescript-eslint/eslint-plugin":"^6.7.2","@typescript-eslint/parser":"^6.7.2","eslint":"^8.50.0","eslint-config-prettier":"^9.0.0","eslint-plugin-prettier":"^5.0.0","fix-esm-import-path":"^1.4.0","prettier":"^3.0.3","ts-node":"^10.9.1","typescript":"5.2.2"},"prettier":{},"packageManager":"yarn@3.6.3","gitHead":"ce8d9ca478d089c45302085e79d9d2500c7f766a","homepage":"https://github.com/ahlec/s3-deployer#readme","_id":"@ahlec/s3-deployer@2.0.0","_nodeVersion":"16.13.1","_npmVersion":"8.1.2","dist":{"integrity":"sha512-S2ByjoVIgsW3O3r88UpzTtP/SpPaUrD0Ao1w/y8pXfPiuhdoA7NivdLhQ5TRFn6JwdBg8JuaVAbvefz3n6P4Yg==","shasum":"695e7253947fdcb14004b59632802e47c8db0392","tarball":"https://registry.npmjs.org/@ahlec/s3-deployer/-/s3-deployer-2.0.0.tgz","fileCount":19,"unpackedSize":67108,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDDlk946x4I0KbT5Q03nJbb9jphG3ezDk0V60sfO+KCagIgXPG7NVOnVSVmccuWsIZUZgQEeaxTKGTCiW6vp5AufbI="}]},"_npmUser":{"name":"ahlec","email":"alec.deitloff@gmail.com"},"directories":{},"maintainers":[{"name":"ahlec","email":"alec.deitloff@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/s3-deployer_2.0.0_1695499837092_0.06553430760849754"},"_hasShrinkwrap":false}},"time":{"created":"2022-01-27T06:36:04.691Z","1.0.0":"2022-01-27T06:36:05.085Z","modified":"2023-09-23T20:10:37.526Z","1.0.1":"2022-01-27T06:53:41.471Z","2.0.0":"2023-09-23T20:10:37.336Z"},"maintainers":[{"name":"ahlec","email":"alec.deitloff@gmail.com"}],"description":"Node CLI tool for customized, powerful deploys to S3.","homepage":"https://github.com/ahlec/s3-deployer#readme","keywords":["s3","deploy","upload","cloudfront","aws","publish"],"repository":{"type":"git","url":"git+https://github.com/ahlec/s3-deployer.git"},"author":{"name":"Alec Jacob Deitloff","email":"alec.deitloff@gmail.com"},"bugs":{"url":"https://github.com/ahlec/s3-deployer/issues"},"license":"MIT","readme":"# s3-deployer\n\n[![npm version](https://badge.fury.io/js/@ahlec%2Fs3-deployer.svg)](https://badge.fury.io/js/@ahlec%2Fs3-deployer)\n\nDeploying to S3 and invalidating a Cloudfront distribution _is_ the deploying process for many web applications. Doing it can be trivial — until you need something non-trivial, at which point it quickly can become a nightmare.\n\nThe **s3-deployer** is a program that handles uploading to an S3 bucket and invalidating an optional Cloudfront distribution in front of it. This runs as a CLI script and is highly configurable.\n\n## Features\n\nWhat **s3-deployer** sets out to do is to handle uploading files the way you think about them in your codebase:\n\n- **Configure how files are uploaded using glob patterns.** Your HTML files have different `Cache-Control` from your React assets; you only want _some_ of your source maps to be uploaded; it turns out you want a couple of your PNG files to have a custom `Content-Type`. Set up complex upload rules in a familiar, intuitive way!\n\n- **Only deploy changed files.** When a file is uploaded to S3, it'll invalidate user caches which has a direct impact on load times. **s3-deployer** will only upload files which have changed. This is checked at deploy time — whether you last deployed on this computer or a different one, we'll only update files that need updating.\n\n- **Helpful output (and input).** All of our output is logged to be easy to follow, informative on what's happening and why, and also pretty to look at. But the deploy process needs checks in place to ensure you're ready. Do you have scripts or processes you want to confirm have been run before deploy? Configure them to appear prior to the deploy process.\n\n## Getting Started\n\nInstall using your preferred package manager:\n\n```\nyarn add --dev @ahlec/s3-deployer\nnpm install --save-dev @ahlec/s3-deployer\n```\n\nThen, configure your build using the options below.\n\nWhen you're ready for a deploy, go ahead and run the script:\n\n```\nyarn s3-deployer\n```\n\nIf you'd like to preview your build without actually running it, use the `--dry-run` CLI option. This makes no changes, but highlights what it would change.\n\n## Configuration\n\n**s3-deployer** uses [`cosmiconfig`](https://github.com/davidtheclark/cosmiconfig) to configure your build. This allows you to define your configuration in your **package.json** file, or in a dedicated file of a number of different types.\n\nThe key is `s3deployer` — add an `\"s3deployer\"` key to your **package.json** file, or try out **s3deployer.config.js** if you want an advanced configuration.\n\n```javascript\nconst chalk = require(\"chalk\");\n\nmodule.exports = {\n  assets: {\n    \"**/*.tmp\": false,\n    \"**/static/*.png\": {\n      // These PNG files aren't managed by the build system\n      cacheControl: \"no-cache\",\n    },\n  },\n  bucket: {\n    name: \"my-amazing-s3-bucket\",\n    region: \"us-west-1\",\n  },\n  buildDir: \"./build\",\n  confirmation: [`Have you run ${chalk.yellow(\"yarn pre-release\")} yet?`],\n  cloudfront: {\n    id: \"CL0UDFR0N7\",\n    region: \"us-west-1\",\n  },\n};\n```\n\n### `assets`\n\n| Key      | Type                                   | Default   |\n| -------- | -------------------------------------- | --------- |\n| `assets` | `{ [glob: string]: Asset \\| boolean }` | See below |\n\nAn optional parameter that is a lookup object of glob patterns to rules for how an asset should (or should not) be uploaded. The glob patterns are relative to the build directory.\n\nA rule is one of three values:\n\n- `true`: the asset should be uploaded with default options (default);\n- `false`: the asset shouldn't be uploaded;\n- An `Asset` type object\n\nThis field comes with defaults that should serve regular use cases:\n\n```json\n{\n  \"**/*.{htm,html}\": {\n    \"cacheControl\": \"no-cache\"\n  },\n  \"**/.DS_Store\": false\n}\n```\n\nAny file in the build directory that doesn't have a provided rule will be uploaded with the default values of an `Asset` type object.\n\n#### `Asset` type\n\n| Field          | Type   | Default                                 |\n| -------------- | ------ | --------------------------------------- |\n| `acl`          | string | `\"public-read\"`                         |\n| `cacheControl` | string | `\"public, max-age=31536000, immutable\"` |\n| `contentType`  | string | (based on the MIME type of the file)    |\n\nAll fields are optional. If a value isn't provided, the default value will be used.\n\n### `bucket` (Required)\n\n| Key      | Type             | Default |\n| -------- | ---------------- | ------- |\n| `bucket` | BucketDefinition | (none)  |\n\nThe `bucket` config key describes your S3 bucket destination. This is a **required** field, and is an object with the following fields:\n\n| Field    | Type   |\n| -------- | ------ |\n| `name`   | string |\n| `region` | string |\n\n### `buildDir` (Required)\n\n| Key        | Type   | Default |\n| ---------- | ------ | ------- |\n| `buildDir` | string | (none)  |\n\nThe `buildDir` config key is the **required** string pathname to the directory you want to deploy. This is relative to the current working directory if it isn't an absolute path. The root of this directory will be uploaded to the root of the S3 bucket.\n\n### `confirmation`\n\n| Key            | Type                           | Default |\n| -------------- | ------------------------------ | ------- |\n| `confirmation` | Confirmation \\| Confirmation[] | []      |\n\nThe `confirmation` config key is an **optional** array which, if specified, should contain yes/no prompts for the user to respond \"yes\" to in order to release. If the user responds \"no\" to any prompt, the deploy will not proceed.\n\nThe user will _always_ be prompted, prior to any custom confirmations, to confirm they desire to release alongside a timestamp of when the build directory was last modified.\n\nA `Confirmation` maybe either a `string`, or a function that takes no parameters and returns a string.\n\n### `cloudfront`\n\n| Key          | Type                 | Default |\n| ------------ | -------------------- | ------- |\n| `cloudfront` | CloudfrontDefinition | `null`  |\n\nThe `cloudfront` config key is an **optional** configuration object which, if specified, will be invalidated after all files have been deployed to S3. If your S3 bucket is not behind a Cloudfront distribution, you may omit this or set this field to `null`. The `CloudfrontDistribution` type takes the following fields:\n\n| Field    | Type   |\n| -------- | ------ |\n| `id`     | string |\n| `region` | string |\n\n### `title`\n\n| Key     | Type   | Default       |\n| ------- | ------ | ------------- |\n| `title` | string | `\"S3 Deploy\"` |\n\nThe `title` config key is purely for display purposes. If specified, this configures the first line of text that is written out to the console when the application is started. This is purely for \"branding\" purposes or to provide more specific context for what this tool is about to do, and can be safely ignored.\n\n### `subtitle`\n\n| Key        | Type   | Default                                                               |\n| ---------- | ------ | --------------------------------------------------------------------- |\n| `subtitle` | string | `Deploying the latest build to the '${config.bucket.name}' S3 bucket` |\n\nThe `subtitle` config key is purely for display purposes. If specified, this configures the second line of text that is written out to the console when the application is started. This is purely for \"branding\" purposes, with a desired intention of providing more context for what this tool is going to perform. It can be safely omitted/ignored.\n","readmeFilename":"README.md"}