Skip to content

Commit

Permalink
final cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
theoephraim committed Dec 17, 2024
1 parent ff84e2a commit ad544af
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .dmno/config.mts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DmnoBaseTypes, defineDmnoService } from 'dmno';
import { DmnoBaseTypes, defineDmnoService, pickFromSchemaObject } from 'dmno';
import { GitDataTypes, GithubDataTypes } from 'dmno/vendor-types';

export default defineDmnoService({
Expand Down
2 changes: 0 additions & 2 deletions packages/docs-site/public/_redirects
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
/docs / 302
/docs/ / 302
2 changes: 1 addition & 1 deletion packages/docs-site/src/components/EmailSignup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<input v-if="isSubmitting" placeholder="Sending..." />
<template v-else>
<input type="text" v-model="email" :placeholder="emailSubmitted ? 'Thanks!' : 'Your email'" />
<a href="#" @click="onSubmit" class="button" v-html="ArrowIconSvg">
<a href="#" @click.prevent="onSubmit" class="button" v-html="ArrowIconSvg">
</a>
</template>

Expand Down
18 changes: 17 additions & 1 deletion packages/signup-api/.dmno/config.mts
Original file line number Diff line number Diff line change
@@ -1,15 +1,31 @@
import { DmnoBaseTypes, defineDmnoService, configPath, switchBy } from 'dmno';
import { DmnoBaseTypes, defineDmnoService, configPath, switchBy, pickFromSchemaObject } from 'dmno';
import { CloudflareWranglerEnvSchema, DmnoWranglerEnvSchema } from '@dmno/cloudflare-platform';
import { EncryptedVaultDmnoPlugin, EncryptedVaultTypes } from '@dmno/encrypted-vault-plugin';
import { OnePasswordDmnoPlugin } from '@dmno/1password-plugin';

const EncryptedVault = new EncryptedVaultDmnoPlugin('vault', {
key: configPath('..', 'DMNO_VAULT_KEY'),
name: 'prod',
});

const onepass = new OnePasswordDmnoPlugin('1pass', {
fallbackToCliBasedAuth: true
});


export default defineDmnoService({
name: 'signup-api',
pick: [],
schema: {
...pickFromSchemaObject(CloudflareWranglerEnvSchema, {
CLOUDFLARE_ACCOUNT_ID: {
value: onepass.itemByReference("op://Shared/Cloudflare/account id"),
},
CLOUDFLARE_API_TOKEN: {
value: onepass.itemByReference("op://Shared/Cloudflare/workers api token"),
},
}),

DMNO_ENV: { // TODO: formalize this
// will be overridden by netlify during deploys - see netlify.toml
value: 'development',
Expand Down
6 changes: 5 additions & 1 deletion packages/signup-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"dev": "pnpm --filter=\"@dmno/signup-api\" run --parallel \"/dev:*/\" ",
"dev:ts": "dmno run -w -- pnpm run build --watch",
"dev:netlify": "netlify dev",
"deploy": "dwrangler pages deploy",
"lint": "eslint src --ext .ts,.cjs,.astro,.md,.mdx",
"lint:fix": "pnpm run lint --fix"
},
Expand All @@ -20,14 +21,17 @@
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20241112.0",
"@dmno/cloudflare-platform": "workspace:*",
"@dmno/encrypted-vault-plugin": "workspace:*",
"@dmno/1password-plugin": "workspace:*",
"@dmno/eslint-config": "workspace:*",
"@dmno/tsconfig": "workspace:*",
"@netlify/functions": "^2.6.3",
"@types/async": "^3.2.24",
"dmno": "workspace:*",
"netlify-cli": "^17.1.0",
"tsup": "catalog:",
"typescript": "catalog:"
"typescript": "catalog:",
"wrangler": "^3.96.0"
}
}
6 changes: 2 additions & 4 deletions packages/signup-api/wrangler.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
[build]
command = "pnpm run build"
watch_dir = "function-src"

name = "signup-api"
pages_build_output_dir = "./dist"
77 changes: 59 additions & 18 deletions pnpm-lock.yaml

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

0 comments on commit ad544af

Please sign in to comment.