Skip to content

Commit bf37f3d

Browse files
authored
feat: Adding akamai SDK (#121)
Setting up the basic structure for the Akamai SDK. - Created basic test - Created basic init function that returns Hello World - Modeled structure after the Cloudflare directory
2 parents 3a3fdfc + 1bc56b4 commit bf37f3d

File tree

17 files changed

+265
-1
lines changed

17 files changed

+265
-1
lines changed

.github/workflows/akamai.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: sdk/akamai
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths-ignore:
7+
- '**.md' #Do not need to run CI for markdown changes.
8+
pull_request:
9+
branches: [main]
10+
paths-ignore:
11+
- '**.md'
12+
13+
jobs:
14+
build-test-akamai:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
- uses: actions/setup-node@v3
19+
- id: shared
20+
name: Shared CI Steps
21+
uses: ./actions/ci
22+
with:
23+
workspace_name: '@launchdarkly/akamai-server-sdk'
24+
workspace_path: packages/sdk/akamai

.github/workflows/manual-publish-docs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ on:
1313
- packages/sdk/cloudflare
1414
- packages/sdk/server-node
1515
- packages/sdk/vercel
16+
- packages/sdk/akamai
1617
name: Publish Documentation
1718
jobs:
1819
build-publish:

.github/workflows/manual-publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414
- packages/sdk/cloudflare
1515
- packages/sdk/server-node
1616
- packages/sdk/vercel
17+
- packages/sdk/akamai
1718
prerelease:
1819
description: 'Is this a prerelease. If so, then the latest tag will not be updated in npm.'
1920
type: boolean

.github/workflows/release-please.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
package-cloudflare-released: ${{ steps.release.outputs['packages/sdk/cloudflare--release_created'] }}
1515
package-server-node-released: ${{ steps.release.outputs['packages/sdk/server-node--release_created'] }}
1616
package-vercel-released: ${{ steps.release.outputs['packages/sdk/vercel--release_created'] }}
17+
package-akamai-released: ${{ steps.release.outputs['packages/sdk/akamai--release_created'] }}
1718
steps:
1819
- uses: google-github-actions/release-please-action@v3
1920
id: release
@@ -141,3 +142,23 @@ jobs:
141142
with:
142143
workspace_path: packages/sdk/vercel
143144
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
145+
146+
release-akamai:
147+
runs-on: ubuntu-latest
148+
needs: ['release-please']
149+
permissions:
150+
id-token: write
151+
contents: write
152+
if: ${{ needs.release-please.outputs.package-akamai-released }}
153+
steps:
154+
- uses: actions/checkout@v3
155+
- uses: actions/setup-node@v3
156+
with:
157+
node-version: 16.x
158+
registry-url: 'https://registry.npmjs.org'
159+
- id: release-common
160+
name: Full release of packages/sdk/akamai
161+
uses: ./actions/full-release
162+
with:
163+
workspace_path: packages/sdk/akamai
164+
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ This includes shared libraries, used by SDKs and other tools, as well as SDKs.
1010
| [@launchdarkly/cloudflare-server-sdk](packages/sdk/cloudflare/README.md) | [![NPM][sdk-cloudflare-npm-badge]][sdk-cloudflare-npm-link] | [Cloudflare][package-sdk-cloudflare-issues] | [![Actions Status][sdk-cloudflare-ci-badge]][sdk-cloudflare-ci] |
1111
| [@launchdarkly/node-server-sdk](packages/sdk/server-node/README.md) | [![NPM][sdk-server-node-npm-badge]][sdk-server-node-npm-link] | [Node.js Server][package-sdk-server-node-issues] | [![Actions Status][sdk-server-node-ci-badge]][sdk-server-node-ci] |
1212
| [@launchdarkly/vercel-server-sdk](packages/sdk/vercel/README.md) | [![NPM][sdk-vercel-npm-badge]][sdk-vercel-npm-link] | [Vercel][package-sdk-vercel-issues] | [![Actions Status][sdk-vercel-ci-badge]][sdk-vercel-ci] |
13+
| [@launchdarkly/akamai-server-sdk](packages/sdk/akamai/README.md) | [![NPM][sdk-akamai-npm-badge]][sdk-akamai-npm-link] | [Akamai][package-sdk-akamai-issues] | [![Actions Status][sdk-akamai-ci-badge]][sdk-akamai-ci] |
1314

1415
| Shared packages | npm | issues | tests |
1516
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------- | ----------------------------------------------------------- | ------------------------------------------------------------------------------- |
@@ -97,3 +98,13 @@ We encourage pull requests and other contributions from the community. Check out
9798
[sdk-vercel-dm-badge]: https://img.shields.io/npm/dm/@launchdarkly/vercel-server-sdk.svg?style=flat-square
9899
[sdk-vercel-dt-badge]: https://img.shields.io/npm/dt/@launchdarkly/vercel-server-sdk.svg?style=flat-square
99100
[package-sdk-vercel-issues]: https://github.com/launchdarkly/js-core/issues?q=is%3Aissue+is%3Aopen+label%3A%22package%3A+sdk%2Fvercel%22+
101+
[//]: # 'sdk/akamai'
102+
[sdk-akamai-ci-badge]: https://github.com/launchdarkly/js-core/actions/workflows/akamai.yml/badge.svg
103+
[sdk-akamai-ci]: https://github.com/launchdarkly/js-core/actions/workflows/akamai.yml
104+
[sdk-akamai-npm-badge]: https://img.shields.io/npm/v/@launchdarkly/akamai-server-sdk.svg?style=flat-square
105+
[sdk-akamai-npm-link]: https://www.npmjs.com/package/@launchdarkly/akamai-server-sdk
106+
[sdk-akamai-ghp-badge]: https://img.shields.io/static/v1?label=GitHub+Pages&message=API+reference&color=00add8
107+
[sdk-akamai-ghp-link]: https://launchdarkly.github.io/js-core/packages/sdk/akamai/docs/
108+
[sdk-akamai-dm-badge]: https://img.shields.io/npm/dm/@launchdarkly/akamai-server-sdk.svg?style=flat-square
109+
[sdk-akamai-dt-badge]: https://img.shields.io/npm/dt/@launchdarkly/akamai-server-sdk.svg?style=flat-square
110+
[package-sdk-akamai-issues]: https://github.com/launchdarkly/js-core/issues?q=is%3Aissue+is%3Aopen+label%3A%22package%3A+sdk%2Fakamai%22+

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
"packages/sdk/cloudflare",
99
"packages/sdk/cloudflare/example",
1010
"packages/sdk/vercel",
11-
"packages/sdk/example-vercel"
11+
"packages/sdk/example-vercel",
12+
"packages/sdk/akamai",
13+
"packages/sdk/example-akamai"
1214
],
1315
"private": true,
1416
"scripts": {

packages/sdk/akamai/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Changelog
2+
3+
All notable changes to the LaunchDarkly SDK for Akamai Workers will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org).

packages/sdk/akamai/LICENSE

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright 2023 Catamorphic, Co.
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.

packages/sdk/akamai/README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# LaunchDarkly Akamai SDK
2+
3+
[![NPM][sdk-akamai-npm-badge]][sdk-akamai-npm-link]
4+
[![Actions Status][sdk-akamai-ci-badge]][sdk-akamai-ci]
5+
[![Documentation][sdk-akamai-ghp-badge]][sdk-akamai-ghp-link]
6+
[![NPM][sdk-akamai-dm-badge]][sdk-akamai-npm-link]
7+
[![NPM][sdk-akamai-dt-badge]][sdk-akamai-npm-link]
8+
9+
The LaunchDarkly Akamai SDK is designed primarily for use in Akamai Edgeworkers. It follows the server-side LaunchDarkly model for multi-user contexts. It is not intended for use in desktop and embedded systems applications.
10+
11+
For more information, see the [complete reference guide for this SDK](https://docs.launchdarkly.com/sdk/server-side/akamai).
12+
13+
## Install
14+
15+
```shell
16+
npm i @launchdarkly/akamai-server-sdk
17+
```
18+
19+
Then turn on the Node.js compatibility flag in your `wrangler.toml`. This allows the SDK to use `node:events`:
20+
21+
```toml
22+
compatibility_flags = [ "nodejs_compat" ]
23+
```
24+
25+
## Quickstart
26+
27+
28+
See the full [example app](https://github.com/launchdarkly/js-core/tree/main/packages/sdk/akamai/example).
29+
30+
## Developing this SDK
31+
32+
```shell
33+
# at js-core repo root
34+
yarn && yarn build && cd packages/sdk/akamai
35+
36+
# run tests
37+
yarn test
38+
```
39+
40+
## About LaunchDarkly
41+
42+
- LaunchDarkly is a continuous delivery platform that provides feature flags as a service and allows developers to iterate quickly and safely. We allow you to easily flag your features and manage them from the LaunchDarkly dashboard. With LaunchDarkly, you can:
43+
- Roll out a new feature to a subset of your users (like a group of users who opt-in to a beta tester group), gathering feedback and bug reports from real-world use cases.
44+
- Gradually roll out a feature to an increasing percentage of users, and track the effect that the feature has on key metrics (for instance, how likely is a user to complete a purchase if they have feature A versus feature B?).
45+
- Turn off a feature that you realize is causing performance problems in production, without needing to re-deploy, or even restart the application with a changed configuration file.
46+
- Grant access to certain features based on user attributes, like payment plan (eg: users on the ‘gold’ plan get access to more features than users in the ‘silver’ plan). Disable parts of your application to facilitate maintenance, without taking everything offline.
47+
- LaunchDarkly provides feature flag SDKs for a wide variety of languages and technologies. Read [our documentation](https://docs.launchdarkly.com/sdk) for a complete list.
48+
- Explore LaunchDarkly
49+
- [launchdarkly.com](https://www.launchdarkly.com/ 'LaunchDarkly Main Website') for more information
50+
- [docs.launchdarkly.com](https://docs.launchdarkly.com/ 'LaunchDarkly Documentation') for our documentation and SDK reference guides
51+
- [apidocs.launchdarkly.com](https://apidocs.launchdarkly.com/ 'LaunchDarkly API Documentation') for our API documentation
52+
- [blog.launchdarkly.com](https://blog.launchdarkly.com/ 'LaunchDarkly Blog Documentation') for the latest product updates
53+
54+
[sdk-akamai-ci-badge]: https://github.com/launchdarkly/js-core/actions/workflows/akamai.yml/badge.svg
55+
[sdk-akamai-ci]: https://github.com/launchdarkly/js-core/actions/workflows/akamai.yml
56+
[sdk-akamai-npm-badge]: https://img.shields.io/npm/v/@launchdarkly/akamai-server-sdk.svg?style=flat-square
57+
[sdk-akamai-npm-link]: https://www.npmjs.com/package/@launchdarkly/akamai-server-sdk
58+
[sdk-akamai-ghp-badge]: https://img.shields.io/static/v1?label=GitHub+Pages&message=API+reference&color=00add8
59+
[sdk-akamai-ghp-link]: https://launchdarkly.github.io/js-core/packages/sdk/akamai/docs/
60+
[sdk-akamai-dm-badge]: https://img.shields.io/npm/dm/@launchdarkly/akamai-server-sdk.svg?style=flat-square
61+
[sdk-akamai-dt-badge]: https://img.shields.io/npm/dt/@launchdarkly/akamai-server-sdk.svg?style=flat-square
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"transform": { "^.+\\.ts?$": "ts-jest" },
3+
"testMatch": ["**/*.test.ts?(x)"],
4+
"testPathIgnorePatterns": ["node_modules", "example", "dist"],
5+
"modulePathIgnorePatterns": ["dist"],
6+
"testEnvironment": "node",
7+
"moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json", "node"],
8+
"collectCoverageFrom": ["src/**/*.ts"]
9+
}

0 commit comments

Comments
 (0)