From bf3b295836c48abc516a1988fbaa332c311a3b9f Mon Sep 17 00:00:00 2001 From: Martin Ramm Date: Mon, 4 Dec 2023 21:46:00 +0100 Subject: [PATCH 1/4] Add documentation about `fingerprint external` --- src/views/docs/en/guides/frontend/static-assets.md | 14 +++++++++++--- .../docs/en/reference/project-manifest/static.md | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/views/docs/en/guides/frontend/static-assets.md b/src/views/docs/en/guides/frontend/static-assets.md index 99b08d38..82477aca 100644 --- a/src/views/docs/en/guides/frontend/static-assets.md +++ b/src/views/docs/en/guides/frontend/static-assets.md @@ -8,8 +8,8 @@ Architect projects support text and binary static assets such as images, styles, ## `@static` configuration -- `fingerprint` - **boolean** (defaults to false) - - Enable static asset file fingerprinting (and long-lived caching headers) +- `fingerprint` - **boolean** or **string** (defaults to false) + - Enable long-lived caching headers by static asset file fingerprinting - `folder` - **string** (defaults to `./public`) - Designate the local folder to upload static assets from. - `ignore` - **list** @@ -25,7 +25,7 @@ Architect projects support text and binary static assets such as images, styles, ### `fingerprint` -Fingerprinting adds a unique SHA to a file name based on the file content before uploading to S3. The file can then be cached effectively forever. Whenever the contents of the file changes so does the SHA invalidating the cache. +When set to `true`, fingerprinting adds a unique SHA to a file name based on the file content before uploading to S3. The file can then be cached effectively forever. Whenever the contents of the file changes so does the SHA invalidating the cache. ```arc @static @@ -34,6 +34,14 @@ fingerprint true The Node.js runtime helper, [`@architect/functions`, provides a `static`](../../reference/runtime-helpers/node.js#arc.static) method to help create a path for a given fingerprinted asset. See [below for an example](#fingerprinted-file-paths). + +By setting fingerprinting to `external`, the file name is not changed before uploading to S3. You should only do this if you can ensure that the file name changes when you change the file content. This setting is incompatible with the the Node.js runtime helper mentioned above. + +```arc +@static +fingerprint external +``` + ### `folder` Use a custom folder name or path for static assets. diff --git a/src/views/docs/en/reference/project-manifest/static.md b/src/views/docs/en/reference/project-manifest/static.md index 9f77286d..44521d67 100644 --- a/src/views/docs/en/reference/project-manifest/static.md +++ b/src/views/docs/en/reference/project-manifest/static.md @@ -15,7 +15,7 @@ All parameters are optional. - `compression` - **boolean** or **string** (defaults to false) - Enable static asset compression; `true` or `br` compresses with brotli, or `gzip` compresses with gzip - `fingerprint` - **boolean** (defaults to false) - - Enable static asset file fingerprinting (and long-lived caching headers) + - Enable long-lived caching headers by static asset file fingerprinting - `folder` - **string** (defaults to `./public`) - Designate the local folder to upload static assets from. - `ignore` - **list** From 891b87e06562778a9526595988c07069fc155ccb Mon Sep 17 00:00:00 2001 From: Martin Ramm Date: Mon, 4 Dec 2023 22:15:40 +0100 Subject: [PATCH 2/4] Fix typo --- src/views/docs/en/guides/frontend/static-assets.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/docs/en/guides/frontend/static-assets.md b/src/views/docs/en/guides/frontend/static-assets.md index 82477aca..9fe6d5b3 100644 --- a/src/views/docs/en/guides/frontend/static-assets.md +++ b/src/views/docs/en/guides/frontend/static-assets.md @@ -35,7 +35,7 @@ fingerprint true The Node.js runtime helper, [`@architect/functions`, provides a `static`](../../reference/runtime-helpers/node.js#arc.static) method to help create a path for a given fingerprinted asset. See [below for an example](#fingerprinted-file-paths). -By setting fingerprinting to `external`, the file name is not changed before uploading to S3. You should only do this if you can ensure that the file name changes when you change the file content. This setting is incompatible with the the Node.js runtime helper mentioned above. +By setting fingerprinting to `external`, the file name is not changed before uploading to S3. You should only do this if you can ensure that the file name changes when you change the file content. This setting is incompatible with the Node.js runtime helper mentioned above. ```arc @static From 5e49f2be9def09a5cdd287389182b2cc8b0f7d36 Mon Sep 17 00:00:00 2001 From: Ryan Block Date: Wed, 6 Dec 2023 15:30:41 -0800 Subject: [PATCH 3/4] 3.12.9 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index fb731166..4846537e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@architect/arc.codes", - "version": "3.12.8", + "version": "3.12.9", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@architect/arc.codes", - "version": "3.12.8", + "version": "3.12.9", "license": "Apache-2.0", "dependencies": { "@architect/asap": "^6.0.4", diff --git a/package.json b/package.json index cc46aa87..9c632ccc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@architect/arc.codes", - "version": "3.12.8", + "version": "3.12.9", "repository": { "type": "git", "url": "https://github.com/architect/arc.codes" From 3719b30d141edeb225b57345a29ec2aebe8a17c6 Mon Sep 17 00:00:00 2001 From: Martin Ramm Date: Sat, 9 Dec 2023 01:15:07 +0100 Subject: [PATCH 4/4] Update documentation for `[New Feature]: Allow TTL attribute to also be a partition or sort key` see https://github.com/architect/inventory/pull/71 --- src/views/docs/en/guides/backend/indexes.md | 3 ++- src/views/docs/en/guides/backend/tables.md | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/views/docs/en/guides/backend/indexes.md b/src/views/docs/en/guides/backend/indexes.md index 465ec0f2..6b3336c3 100644 --- a/src/views/docs/en/guides/backend/indexes.md +++ b/src/views/docs/en/guides/backend/indexes.md @@ -34,7 +34,8 @@ In this example you can query for an account by their username or email! - Otherwise, the basic syntax for defining `@indexes` is the same as `@tables`: - Partition key, defined by a `*`, is required - Sort key, defined by `**`, is optional - - Currently only `*String`, `**String`, `*Number` and `**Number` are supported + - Currently only `*String`, `**String`, `*Number`, `**Number`, `*TTL`, `**TTL` are supported + - `*TTL` and `**TTL` is equivalent to `*Number` and `**Number` respectively, but also turns [time-to-live](./tables.md#time-to-live) on. ## Examples diff --git a/src/views/docs/en/guides/backend/tables.md b/src/views/docs/en/guides/backend/tables.md index 92a6d699..aeb65dd5 100644 --- a/src/views/docs/en/guides/backend/tables.md +++ b/src/views/docs/en/guides/backend/tables.md @@ -76,6 +76,7 @@ accounts - The required partition key is denoted by `*` - The optional sort key is denoted by `**` - Currently only `*String`, `**String`, `*Number` and `**Number` are supported + - `*TTL` and `**TTL` is equivalent to `*Number` and `**Number` respectively, but also turns [time-to-live](#time-to-live) on. - Lambdas can only be values of: `insert`, `update`, or `destroy` > **Protip:** table names can be anything but choose a consistent naming scheme within your app namespace; one useful scheme is plural nouns like: `accounts` or `email-invites`