Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
2 parents 1c83f79 + 71b2e0a commit 89b5c83
Show file tree
Hide file tree
Showing 94 changed files with 19,580 additions and 667 deletions.
23 changes: 19 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ concurrency:

jobs:
verify:
runs-on: macos-latest
runs-on: ubuntu-24.04
steps:
- name: Setup repo
uses: actions/checkout@v3
Expand Down Expand Up @@ -218,6 +218,15 @@ jobs:
template_file: ./examples/nodejs/aws/lambda-examples/cloudwatch-metrics/README.template.md
output_file: ./examples/nodejs/aws/lambda-examples/cloudwatch-metrics/README.md

- name: Verify README generation for examples/nodejs/aws/lambda-examples/advanced-compression
uses: momentohq/standards-and-practices/github-actions/oss-readme-template@gh-actions-v2
with:
project_status: official
project_stability: beta
project_type: other
template_file: ./examples/nodejs/aws/lambda-examples/advanced-compression/README.template.md
output_file: ./examples/nodejs/aws/lambda-examples/advanced-compression/README.md

- name: Verify README generation for examples/nodejs/topics
uses: momentohq/standards-and-practices/github-actions/oss-readme-template@gh-actions-v2
with:
Expand Down Expand Up @@ -354,7 +363,7 @@ jobs:
node: [16, 18, 20]
fail-fast: true
name: Test examples on node ${{ matrix.node }}
runs-on: macos-latest
runs-on: ubuntu-24.04
env:
# TODO: remove token stored as secret in favor of using a
# momento-local instance that can be spun up for testing
Expand Down Expand Up @@ -410,6 +419,12 @@ jobs:
npm ci
npm run build
popd
pushd examples/nodejs/aws/lambda-examples/advanced-compression
# This example shows how to build and package a lambda function for a different target architecture,
# and thus it requires this `--force` flag.
npm ci --force
npm run build
popd
pushd examples/nodejs/mongodb-examples/simple-read-aside
npm ci
npm run build
Expand Down Expand Up @@ -446,7 +461,7 @@ jobs:
node: [ 16, 18 ]
fail-fast: true
name: Test web examples on node ${{ matrix.node }}
runs-on: macos-latest
runs-on: ubuntu-24.04
env:
# TODO: remove token stored as secret in favor of using a
# momento-local instance that can be spun up for testing
Expand Down Expand Up @@ -496,7 +511,7 @@ jobs:
node: [ 16, 18 ]
fail-fast: true
name: Test Deno examples on node ${{ matrix.node }}
runs-on: macos-latest
runs-on: ubuntu-24.04
env:
# TODO: remove token stored as secret in favor of using a
# momento-local instance that can be spun up for testing
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/on-push-to-main-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
test:
runs-on: macos-latest
runs-on: ubuntu-24.04
env:
MOMENTO_API_KEY: ${{ secrets.ALPHA_TEST_AUTH_TOKEN }}
TEST_SESSION_TOKEN: ${{ secrets.MOMENTO_PREPROD_SESSION_TOKEN }}
Expand Down Expand Up @@ -231,6 +231,15 @@ jobs:
template_file: ./examples/nodejs/aws/lambda-examples/cloudwatch-metrics/README.template.md
output_file: ./examples/nodejs/aws/lambda-examples/cloudwatch-metrics/README.md

- name: Generate README for examples/nodejs/aws/lambda-examples/advanced-compression
uses: momentohq/standards-and-practices/github-actions/generate-and-commit-oss-readme@gh-actions-v2
with:
project_status: official
project_stability: stable
project_type: other
template_file: ./examples/nodejs/aws/lambda-examples/advanced-compression/README.template.md
output_file: ./examples/nodejs/aws/lambda-examples/advanced-compression/README.md

- name: Generate README for examples/nodejs/topics
uses: momentohq/standards-and-practices/github-actions/generate-and-commit-oss-readme@gh-actions-v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on-push-to-release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
run: echo "release=${{ steps.semrel.outputs.version }}" >> $GITHUB_OUTPUT
publish_javascript:
# The type of runner that the job will run on
runs-on: macos-latest
runs-on: ubuntu-24.04
env:
MOMENTO_API_KEY: ${{ secrets.ALPHA_TEST_AUTH_TOKEN }}
TEST_SESSION_TOKEN: ${{ secrets.MOMENTO_PREPROD_SESSION_TOKEN }}
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ main().catch(e => {

## Getting Started and Documentation

Documentation is available on the [Momento Docs website](https://docs.momentohq.com).
Documentation is available on the [Momento Docs website](https://docs.momentohq.com). For information specific to a
particular SDK, see the [Node.js SDK documentation](https://docs.momentohq.com/sdks/nodejs) or the
[Web SDK documentation](https://docs.momentohq.com/sdks/web). We also have quickstart guides for both
[Cache](https://docs.momentohq.com/sdks/nodejs/cache.html) and [Topics](https://docs.momentohq.com/sdks/nodejs/topics.html).

## Examples

Expand Down
5 changes: 4 additions & 1 deletion README.template.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ is best suited for a particular environment:

## Getting Started and Documentation

Documentation is available on the [Momento Docs website](https://docs.momentohq.com).
Documentation is available on the [Momento Docs website](https://docs.momentohq.com). For information specific to a
particular SDK, see the [Node.js SDK documentation](https://docs.momentohq.com/sdks/nodejs) or the
[Web SDK documentation](https://docs.momentohq.com/sdks/web). We also have quickstart guides for both
[Cache](https://docs.momentohq.com/sdks/nodejs/cache.html) and [Topics](https://docs.momentohq.com/sdks/nodejs/topics.html).

## Examples

Expand Down
20 changes: 10 additions & 10 deletions examples/cloudflare-workers/web-sdk/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/cloudflare-workers/web-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"dependencies": {
"@gomomento/sdk-core": "^1.40.0",
"@gomomento/sdk-web": "^1.84.0",
"@gomomento/sdk-web": "^1.86.0",
"xhr4sw": "^0.0.5"
}
}
3 changes: 2 additions & 1 deletion examples/nodejs/access-control/access-control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
AllCaches,
AllTopics,
} from '@gomomento/sdk';
import {uuid} from 'uuidv4';

async function createCache(cacheClient: CacheClient, cacheName: string) {
const result = await cacheClient.createCache(cacheName);
Expand Down Expand Up @@ -99,7 +100,7 @@ async function main() {
});

// Set up a cache
const CACHE_OPEN_DOOR = 'open-door';
const CACHE_OPEN_DOOR = `nodejs-access-control-example-${uuid()}`;
const tokenValidForSeconds = 600;

await createCache(mainCacheClient, CACHE_OPEN_DOOR);
Expand Down
76 changes: 59 additions & 17 deletions examples/nodejs/access-control/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion examples/nodejs/access-control/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"typescript": "4.4.3"
},
"dependencies": {
"@gomomento/sdk": "^1.84.0"
"@gomomento/sdk": "^1.86.0",
"uuidv4": "6.2.13"
}
}
1 change: 1 addition & 0 deletions examples/nodejs/aws/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Examples include:
- [AWS Secrets Manager Example](./secrets-manager) - an example of how to retrieve a Momento API key stored as a secret in AWS Secrets Manager and use it to create a cache.
- [AWS Lambda - Simple Cache `get` Example](./lambda-examples/simple-get) - an example of how to use the Momento Node.js SDK to retrieve a value from a cache in an AWS Lambda function.
- [AWS Lambda - CloudWatch Metrics Example](./lambda-examples/cloudwatch-metrics) - an example of how to use Momento middleware to generate client-side metrics for interactions with the Momento cache, and publish them to a CloudWatch dashboard.
- [AWS Lambda - Advanced compression](./lambda-examples/advanced-compression) - a lambda that demonstrates how to package the `@gomomento/sdk-nodejs-compression-zstd` dependency in your lambda, if you have an advanced compression use case that requires the `zstd` extension rather than the default `@gomomento/sdk-nodejs-compression` extension.

If you have questions or need help experimenting further, please reach out to us!

Expand Down
1 change: 1 addition & 0 deletions examples/nodejs/aws/README.template.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Examples include:
- [AWS Secrets Manager Example](./secrets-manager) - an example of how to retrieve a Momento API key stored as a secret in AWS Secrets Manager and use it to create a cache.
- [AWS Lambda - Simple Cache `get` Example](./lambda-examples/simple-get) - an example of how to use the Momento Node.js SDK to retrieve a value from a cache in an AWS Lambda function.
- [AWS Lambda - CloudWatch Metrics Example](./lambda-examples/cloudwatch-metrics) - an example of how to use Momento middleware to generate client-side metrics for interactions with the Momento cache, and publish them to a CloudWatch dashboard.
- [AWS Lambda - Advanced compression](./lambda-examples/advanced-compression) - a lambda that demonstrates how to package the `@gomomento/sdk-nodejs-compression-zstd` dependency in your lambda, if you have an advanced compression use case that requires the `zstd` extension rather than the default `@gomomento/sdk-nodejs-compression` extension.

If you have questions or need help experimenting further, please reach out to us!

Expand Down
1 change: 1 addition & 0 deletions examples/nodejs/aws/lambda-examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Working example projects, with all required build configuration files, for using

* [Simple cache get](./simple-get) - a very basic lambda that just illustrates how to initialize a cache client and do some basic reads
* [Cloudwatch metrics](./cloudwatch-metrics) - a lambda that demonstrates how to use metrics middleware to generate CloudWatch metrics for cache operations that occur in your lambda, including an example CloudWatch dashboard!
* [Advanced compression](./advanced-compression) - a lambda that demonstrates how to package the `@gomomento/sdk-nodejs-compression-zstd` dependency in your lambda, if you have an advanced compression use case that requires the `zstd` extension rather than the default `@gomomento/sdk-nodejs-compression` extension.

----------------------------------------------------------------------------------------
For more info, visit our website at [https://gomomento.com](https://gomomento.com)!
1 change: 1 addition & 0 deletions examples/nodejs/aws/lambda-examples/README.template.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ Working example projects, with all required build configuration files, for using

* [Simple cache get](./simple-get) - a very basic lambda that just illustrates how to initialize a cache client and do some basic reads
* [Cloudwatch metrics](./cloudwatch-metrics) - a lambda that demonstrates how to use metrics middleware to generate CloudWatch metrics for cache operations that occur in your lambda, including an example CloudWatch dashboard!
* [Advanced compression](./advanced-compression) - a lambda that demonstrates how to package the `@gomomento/sdk-nodejs-compression-zstd` dependency in your lambda, if you have an advanced compression use case that requires the `zstd` extension rather than the default `@gomomento/sdk-nodejs-compression` extension.

{{ ossFooter }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
function.zip
.aws-sam
Loading

0 comments on commit 89b5c83

Please sign in to comment.