Skip to content

Commit

Permalink
chore: Added .env.local file for secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklafrance authored Jan 20, 2025
1 parent 21bb74d commit 811f20d
Show file tree
Hide file tree
Showing 13 changed files with 129 additions and 221 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ apiKeys.js
.turbo
.rslib
.retype
*.env.local

# Mac
.DS_Store
Expand Down
23 changes: 12 additions & 11 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"version": "1.0.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Jest: current file",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": ["${fileBasenameNoExtension}", "--config", "jest.config.ts"],
"console": "integratedTerminal",
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
{
"type": "node",
"request": "launch",
"name": "Jest: current file",
"program": "${fileDirname}/../node_modules/.bin/jest",
"args": ["${fileBasenameNoExtension}", "--config", "${fileDirname}/../jest.config.ts"],
"console": "integratedTerminal",
"windows": {
"program": "${fileDirname}\\..\\node_modules\\jest\\bin\\jest",
"args": ["${fileBasenameNoExtension}", "--config", "${fileDirname}\\..\\jest.config.ts"],
}
}
}
]
}
}
26 changes: 8 additions & 18 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,32 +65,26 @@ pnpm install

### Setup Honeycomb

[Honeycomb](https://www.honeycomb.io/) is one of the monitoring platforms used at Workleap. The [endpoints](./samples/endpoints/) sample application of this repository is already configured to send traces to Honeycomb but needs a valid Honeycomb API key.
[Honeycomb](https://www.honeycomb.io/) is one of the monitoring platforms used at Workleap. The [endpoints](./samples/endpoints/) sample of this repository is already configured to send traces to Honeycomb but needs a valid Honeycomb API key.

First, create a file named `apikeys` at the root of [samples](./samples/endpoints/) folder.
First, create a file named `.env.local` at the root of the workspace.

``` !#3
workspace
├── samples
├──── apiKeys.js
├── package.json
├── .env.local
```

Then, retrieve a valid [Honeycomb API Key](https://docs.honeycomb.io/get-started/configure/environments/manage-api-keys/) from your Vault (or ask IT a key for Honeycomb's "frontend-platform-team-dev" environment).

Finally, open the newly created `apiKeys.js` file and export an `HoneycombApiKey` constant with the API key as value.
Finally, open the newly created `.env.local` file add a value named `HONEYCOMB_API_KEY`.

```js samples/apiKeys.js
export const HoneycombApiKey = "YOUR_API_KEY";
```

If you don't have access to a Honeycomb API Key but still want to run the [endpoints](./samples/endpoints/) sample, create the `apiKeys.js` file as described above and set the `HoneycombApiKey` to an empty string.

```js samples/apiKeys.js
export const HoneycombApiKey = " ";
```bash .env.local
HONEYCOMB_API_KEY="YOUR_API_KEY";
```

> [!NOTE]
> The `samples/endpoints/apiKeys.js` file is ignored by Git and will not be pushed to the remote repository.
> The `.env.local` file is configured to be ignored by Git and will not be pushed to the remote repository.
### Setup Retype

Expand Down Expand Up @@ -171,10 +165,6 @@ pnpm build-pkg

By default, packages compilation output will be in their respective *dist* directory.

#### Linting errors

If you got linting error, most of the time, they can be fixed automatically using `eslint . --fix`, if not, follow the report provided by `pnpm lint`.

## Deploy the sample applications

### The "basic" sample application
Expand Down
6 changes: 3 additions & 3 deletions docs/guides/setup-honeycomb.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ Let's start by configuring the host application. First, open a terminal at the r

+++ pnpm
```bash
pnpm add @squide/firefly-honeycomb @honeycombio/opentelemetry-web @opentelemetry/api @opentelemetry/auto-instrumentations-web @opentelemetry/instrumentation-fetch @opentelemetry/sdk-trace-web
pnpm add @squide/firefly-honeycomb @honeycombio/opentelemetry-web @opentelemetry/api @opentelemetry/auto-instrumentations-web @opentelemetry/instrumentation-document-load @opentelemetry/instrumentation-fetch @opentelemetry/instrumentation-user-interaction @opentelemetry/instrumentation-xml-http-request @opentelemetry/sdk-trace-web
```
+++ yarn
```bash
yarn add @squide/firefly-honeycomb @honeycombio/opentelemetry-web @opentelemetry/api @opentelemetry/auto-instrumentations-web @opentelemetry/instrumentation-fetch @opentelemetry/sdk-trace-web
yarn add @squide/firefly-honeycomb @honeycombio/opentelemetry-web @opentelemetry/api @opentelemetry/auto-instrumentations-web @opentelemetry/instrumentation-document-load @opentelemetry/instrumentation-fetch @opentelemetry/instrumentation-user-interaction @opentelemetry/instrumentation-xml-http-request @opentelemetry/sdk-trace-web
```
+++ npm
```bash
npm install @squide/firefly-honeycomb @honeycombio/opentelemetry-web @opentelemetry/api @opentelemetry/auto-instrumentations-web @opentelemetry/instrumentation-fetch @opentelemetry/sdk-trace-web
npm install @squide/firefly-honeycomb @honeycombio/opentelemetry-web @opentelemetry/api @opentelemetry/auto-instrumentations-web @opentelemetry/instrumentation-document-load @opentelemetry/instrumentation-fetch @opentelemetry/instrumentation-user-interaction @opentelemetry/instrumentation-xml-http-request @opentelemetry/sdk-trace-web
```
+++

Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
"type": "module",
"license": "Apache-2.0",
"scripts": {
"dev-pkg": "turbo dev --filter=./packages/*",
"dev-basic": "turbo dev --filter=./samples/basic/*",
"dev-basic-webpack": "turbo dev --filter=./samples/basic-webpack/*",
"dev-basic-mix": "turbo dev --filter=./samples/basic-mix/*",
"dev-endpoints": "turbo dev --filter=./samples/endpoints/*",
"dev-pkg": "turbo run dev --filter=./packages/*",
"dev-basic": "turbo run dev --filter=./samples/basic/*",
"dev-basic-webpack": "turbo run dev --filter=./samples/basic-webpack/*",
"dev-basic-mix": "turbo run dev --filter=./samples/basic-mix/*",
"dev-endpoints": "turbo run dev --filter=./samples/endpoints/*",
"dev-docs": "retype start",
"build-pkg": "turbo run build --filter=./packages/*",
"build-basic": "turbo run build --filter=./samples/basic/*",
Expand Down
3 changes: 3 additions & 0 deletions packages/firefly-honeycomb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@
"@honeycombio/opentelemetry-web": "*",
"@opentelemetry/api": "*",
"@opentelemetry/auto-instrumentations-web": "*",
"@opentelemetry/instrumentation-document-load": "*",
"@opentelemetry/instrumentation-fetch": "*",
"@opentelemetry/instrumentation-user-interaction": "*",
"@opentelemetry/instrumentation-xml-http-request": "*",
"@opentelemetry/sdk-trace-web": "*"
},
"dependencies": {
Expand Down
Loading

0 comments on commit 811f20d

Please sign in to comment.