Skip to content

Commit

Permalink
add readme badges
Browse files Browse the repository at this point in the history
  • Loading branch information
Theo Ephraim authored and theoephraim committed Aug 19, 2024
1 parent 93bf6f5 commit 0ba81f7
Show file tree
Hide file tree
Showing 26 changed files with 163 additions and 61 deletions.
2 changes: 2 additions & 0 deletions .changeset/odd-chefs-live.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# DMNO
# DMNO [![npm](https://img.shields.io/npm/v/dmno?label=dmno)](https://www.npmjs.com/package/dmno)

>Full-stack configuration & secrets.
>Batteries included.
Expand Down
2 changes: 0 additions & 2 deletions example-repo/.dmno/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ const EncryptedVaultSecrets = new EncryptedVaultDmnoPlugin('vault/prod', {
// name: 'dev',
// });



export default defineDmnoService({
name: 'root',
isRoot: true,
Expand Down
4 changes: 2 additions & 2 deletions packages/core/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DMNO Core
# DMNO Core [![npm](https://img.shields.io/npm/v/dmno?label=dmno)](https://www.npmjs.com/package/dmno)

Welcome to `dmno-core` which powers `dmno`, and currently includes the config engine, CLI, and associated tools.
Welcome to `dmno` (core) which powers `dmno`, and currently includes the config engine, CLI, and associated tools.

Check out the [docs](https://dmno.dev/docs) for more information on how to use DMNO.

Expand Down
1 change: 1 addition & 0 deletions packages/docs-site/astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export default defineConfig({
ThemeProvider: './src/components/CustomStarlightThemeProvider.astro',
MobileMenuFooter: './src/components/CustomStarlightMobileMenuFooter.astro',
Banner: './src/components/CustomStarlightBanner.astro',
PageTitle: './src/components/CustomStarlightPageTitle.astro',
},
head: [
{
Expand Down
35 changes: 35 additions & 0 deletions packages/docs-site/src/components/CustomStarlightPageTitle.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
// import { PAGE_TITLE_ID } from "@astrojs/starlight/constants";
import type { Props } from "@astrojs/starlight/props";
// not acutally exported...?
const PAGE_TITLE_ID = '_top';
---

<div>
<h1 id={PAGE_TITLE_ID}>
{Astro.props.entry.data.title}
{Astro.props.entry.data.npmPackage && <div class="page-title-badges">
<a href=`https://www.npmjs.com/package/${Astro.props.entry.data.npmPackage}`>
<img src=`https://img.shields.io/npm/v/${Astro.props.entry.data.npmPackage}?label=${encodeURIComponent(Astro.props.entry.data.npmPackage)}&color=9B55F5` />
</a>
</div>}
</h1>
</div>

<style>
h1 {
margin-top: 1rem;
font-size: var(--sl-text-h1);
line-height: var(--sl-line-height-headings);
font-weight: 600;
color: var(--sl-color-white);
}
.page-title-badges {
margin-top: 8px;
&:empty {
display: none;
}
}
</style>
10 changes: 8 additions & 2 deletions packages/docs-site/src/content/config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import { defineCollection } from 'astro:content';
import { defineCollection, z } from 'astro:content';
import { docsSchema } from '@astrojs/starlight/schema';
import { blogSchema } from 'starlight-blog/schema';

export const collections = {
docs: defineCollection({
schema: docsSchema({ extend: (context) => blogSchema(context) }),
schema: docsSchema({
extend: (context) => (
blogSchema(context).merge(z.object({
npmPackage: z.string().optional(),
}))
),
}),
}),
};
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Astro Integration
description: Use DMNO to manage your Astro app's environment variables for static, hybrid, and server-side rendering.
npmPackage: "@dmno/astro-integration"
---

import AstroLogo from "~icons/logos/astro";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Next.js
description: Use DMNO to manage your Next.js app's environment variables for static, hybrid, and server-side rendering.
npmPackage: "@dmno/nextjs-integration"
---

import { Tabs, TabItem } from '@astrojs/starlight/components'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ While Node.js recently added [native support for loading dotenv files](https://n


## Setup
To get started, install `dmno` and then set up your config schema according to the [schema guide](/docs/guides/schema/).
To get started, install `dmno` and then set up your config schema according to the [schema guide](/docs/guides/schema/). **No additional integration-specific package is needed!**

<TabbedCode packageName="dmno" />

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Remix
description: Use DMNO to manage your Remix app's environment variables for static, hybrid, and server-side rendering.
npmPackage: "@dmno/remix-integration"
---

import { Tabs, TabItem } from '@astrojs/starlight/components'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Vite
description: Use DMNO to add type safety and validation to your Vite project's configuration.
npmPackage: "@dmno/vite-integration"
---

import TabbedCode from '@/components/TabbedCode.astro';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Using DMNO with Netlify
description: Use DMNO while deploying on Netlify
npmPackage: "@dmno/netlify-platform"
---

import AstroLogo from "~icons/logos/astro";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Using DMNO with Vercel
description: Use DMNO while deploying on Vercel
npmPackage: "@dmno/vercel-platform"
---

import VercelLogo from "~icons/logos/vercel";
Expand Down
24 changes: 15 additions & 9 deletions packages/docs-site/src/content/docs/docs/plugins/1password.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: 1Password plugin
description: DMNO's 1Password plugin allows you to securely access your stored secrets in 1Password.
npmPackage: "@dmno/1password-plugin"
---

import { Steps, Icon } from '@astrojs/starlight/components';
Expand Down Expand Up @@ -158,14 +159,27 @@ export default defineDmnoService({
OP_TOKEN: {
extends: OnePasswordTypes.serviceAccountToken,
},
+ SOME_SECRET_ITEM: {
+ SOME_API_KEY: {
+ sensitive: true,
+ value: OnePassBackend.item(),
+ }
},
});
```

And your 1password item may look this:

![1Password blob item example](../../../../assets/docs-images/plugins/1password/blob-item-example.png)

<details>
<summary>Key lookup details and example</summary>

Values are looked up within the linked 1Password item using a simple convention. We expect to find a _text field_ within the item with a label set to the current [service name](/docs/guides/schema/#service-names). The contents of that item are parsed as a [`.env` file](https://dotenvx.com/docs/env-file), and we look up items using the config item key. If no match is found, we will also look in an additional field with the label `_default`.

For example, in the item above, an item with the key `ONE_MORE` would fallback to the value in the `_default` field in any service that wasn't named `root`.
</details>


You can also override the key used to lookup the value in the `.env` blob. This can be useful if you need to save multiple values toggled by some other logic.

```typescript title=".dmno/config.mts"
Expand All @@ -186,14 +200,6 @@ export default defineDmnoService({
});
```

#### Lookup convention example
Values are looked up within the linked 1Password item using a simple convention. We expect to find a _text field_ within the item with a label set to the current [service name](/docs/guides/schema/#service-names). The contents of that item are parsed as a [`.env` file](https://dotenvx.com/docs/env-file), and we look up items using the config item key. If no match is found, we will also look in an additional field with the label `_default`.

![1Password blob item example](../../../../assets/docs-images/plugins/1password/blob-item-example.png)

For example, in the item above, an item with the key `ONE_MORE` would fallback to the value in the `_default` field in any service that wasn't named `root`.


### Using specific 1Password items

If you already have lots of individual items in 1Password, or you just don't want to use the blob method, we provide several methods to wire up individual config items to specific values in 1Password. Note that while 1Password reference URIs (e.g., `op://vaultname/itemname/path`) are easier to use in some ways, they are based on field labels and are not stable, so the other methods are preferred.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: DMNO Encrypted Vaults
description: Store secrets securely in an encrypted vault that you check in to your git repo with DMNO Config.
npmPackage: "@dmno/encrypted-vault-plugin"
---

import TabbedCode from '@/components/TabbedCode.astro';
Expand Down
4 changes: 2 additions & 2 deletions packages/integrations/astro/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Check out the [docs](https://dmno.dev/docs/guides/frameworks/astro/) for more information on how to use DMNO + Astro.
Check out the [docs](https://dmno.dev/docs/integrations/astro/) for more information on how to use [DMNO](https://dmno.dev) + [Astro](https://astro.build/).

*** THIS IS PREVIEW SOFTWARE AND SUBJECT TO RAPID CHANGE ***

If you have any questions, please reach out to us on [Discord](https://chat.dmno.dev).

----

# @dmno/astro-integration
# @dmno/astro-integration [![npm](https://img.shields.io/npm/v/@dmno/astro-integration)](https://www.npmjs.com/package/@dmno/astro-integration)

Provides tooling to integrate dmno into your astro dev/build workflow

Expand Down
4 changes: 2 additions & 2 deletions packages/integrations/nextjs/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Check out the [docs](https://dmno.dev/docs/guides/frameworks/nextjs/) for more information on how to use DMNO + Next.js.
Check out the [docs](https://dmno.dev/docs/integrations/nextjs/) for more information on how to use [DMNO](https://dmno.dev) + [Next.js](https://nextjs.org/).

*** THIS IS PREVIEW SOFTWARE AND SUBJECT TO RAPID CHANGE ***

If you have any questions, please reach out to us on [Discord](https://chat.dmno.dev).

----

# @dmno/nextjs-integration
# @dmno/nextjs-integration [![npm](https://img.shields.io/npm/v/@dmno/nextjs-integration)](https://www.npmjs.com/package/@dmno/nextjs-integration)

Provides tooling to integrate dmno into your nextjs app

Expand Down
4 changes: 2 additions & 2 deletions packages/integrations/remix/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Check out the [docs](https://dmno.dev/docs/guides/frameworks/remix/) for more information on how to use DMNO + [Remix](https://remix.run/).
Check out the [docs](https://dmno.dev/docs/integrations/remix/) for more information on how to use [DMNO](https://dmno.dev) + [Remix](https://remix.run/).

*** THIS IS PREVIEW SOFTWARE AND SUBJECT TO RAPID CHANGE ***

If you have any questions, please reach out to us on [Discord](https://chat.dmno.dev).

----

# @dmno/remix-integration
# @dmno/remix-integration [![npm](https://img.shields.io/npm/v/@dmno/remix-integration)](https://www.npmjs.com/package/@dmno/remix-integration)

Provides tooling to integrate dmno into your Remix dev/build workflow

Expand Down
4 changes: 2 additions & 2 deletions packages/integrations/vite/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Check out the [docs](https://dmno.dev/docs/guides/frameworks/vite/) for more information on how to use DMNO + Vite.
Check out the [docs](https://dmno.dev/docs/integrations/vite/) for more information on how to use [DMNO](https://dmno.dev) + [Vite](https://vitejs.dev/).

*** THIS IS PREVIEW SOFTWARE AND SUBJECT TO RAPID CHANGE ***

If you have any questions, please reach out to us on [Discord](https://chat.dmno.dev).

----

# @dmno/vite-integration
# @dmno/vite-integration [![npm](https://img.shields.io/npm/v/@dmno/vite-integration)](https://www.npmjs.com/package/@dmno/vite-integration)

Provides tooling to integrate dmno into your vite dev/build workflow

Expand Down
9 changes: 9 additions & 0 deletions packages/platforms/netlify/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Check out the [docs](https://dmno.dev/docs/platforms/netlify/) for more information on how to use [DMNO](https://dmno.dev) with [Netlify](https://netlify.com/).

*** THIS IS PREVIEW SOFTWARE AND SUBJECT TO RAPID CHANGE ***

If you have any questions, please reach out to us on [Discord](https://chat.dmno.dev).

----

# @dmno/netlify-platform [![npm](https://img.shields.io/npm/v/@dmno/netlify-platform)](https://www.npmjs.com/package/@dmno/netlify-platform)
9 changes: 9 additions & 0 deletions packages/platforms/vercel/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Check out the [docs](https://dmno.dev/docs/platforms/vercel/) for more information on how to use [DMNO](https://dmno.dev) with [Vercel](https://vercel.com/).

*** THIS IS PREVIEW SOFTWARE AND SUBJECT TO RAPID CHANGE ***

If you have any questions, please reach out to us on [Discord](https://chat.dmno.dev).

----

# @dmno/vercel-platform [![npm](https://img.shields.io/npm/v/@dmno/vercel-platform)](https://www.npmjs.com/package/@dmno/vercel-platform)
33 changes: 19 additions & 14 deletions packages/plugins/1password/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
Check out the [docs](https://dmno.dev/docs/guides/plugins/1password) for more information on how to use DMNO + 1Password.
Check out the [docs](https://dmno.dev/docs/plugins/1password/) for more information on how to use [DMNO](https://dmno.dev) with [1Password](https://1password.com/).

*** THIS IS PREVIEW SOFTWARE AND SUBJECT TO RAPID CHANGE ***

If you have any questions, please reach out to us on [Discord](https://chat.dmno.dev).

----

# @dmno/1password-plugin
# @dmno/1password-plugin [![npm](https://img.shields.io/npm/v/@dmno/1password-plugin)](https://www.npmjs.com/package/@dmno/1password-plugin)

Provides 1password integration for the @dmno config engine

!> This plugin uses the 1password CLI to communicate with their systems. It installs the CLI binary (locally) in a post-install hook

### Data Types
- `OnePasswordServiceAccountToken`
- `OnePasswordVaultId`
- `OnePasswordVaultName`
Securely use your secrets and data from 1password within DMNO Config Engine.

## Plugin

### Initialization

Expand All @@ -27,12 +21,23 @@ const onePassVault = new OnePasswordDmnoPlugin('1pass');

### Value Resolvers


### Fetch from `.env` blob
`onePassVault.item()`

### Fetch item using unique IDs
`onePassVault.item()`
`onePassVault.itemById(vaultId, itemId, fieldId)`

### Fetch item using private link
`onePassVault.itemByLink(itemLink, fieldId)`

### Fetch item using secret reference URI
`onePassVault.itemByReference(itemReferenceUri)`

### Fetch item using "reference"
`onePassVault.itemByReference()`

## Data Types
- `OnePasswordTypes.serviceAccountToken`
- `OnePasswordTypes.uuid`
- `OnePasswordTypes.vaultId`
- `OnePasswordTypes.itemId`
- `OnePasswordTypes.secretReferenceUri`
- `OnePasswordTypes.itemLink`
Loading

0 comments on commit 0ba81f7

Please sign in to comment.