-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bundle backend as reusable library and create server-doj and server-k…
…ansas demos (#231) * Move doj-demo to packages/server, and create an initial app/server-doj application that imports an Express handler from atj/server. TODO: clean up exports, get typings working. * App handler serving content, but not 100% working * Server package rendering existing client-side behavior correctly. * Add a basic test that confirms the home page is rendered on the DOJ custom server. * Remove debug logging from layout component * Server dev tasks - build esm * Make component signatures in spotlight app consistent with updates for @atj/server * Update docker config for new server-doj and server-kansas apps. * Add server-kansas app * Updates to Terraform to accomodate new server package. * Temporary: Add `astro-library` to deploy, to test TF updates * Log deployEnv on error * Temp: hardcode main deploy for testing * Update deploy script to use arguments for target environment rather that directly pulling the git ref * Try to reference via context: env.*. I don't think this will work, but found some suggestions that it might. * Give up trying to globally declare the deploy env, and pass on each users clause * Build the server entrypoint as part of standard build * Use injected site title in header rather than hardcoded DOJ name. * Remove references to "Spotlight" in the form service * Update a couple build labels * Add back FormRouter.stories.ts * Build before testing. Unfortunate, but we need a build to test the demo servers. * Add symlinks to sample-documents and storybook build * Work-around typing issue with svg icons * mask "no explicit any" eslint warning on svg icon hack * Fix comment in Astro App.Locals declaration * Explicitness on context arg passing * Document new structure in READMEs * Remove debug deploys on astro-library branch. * More generic example title * Autoformat
- Loading branch information
1 parent
30d1af1
commit 69da3eb
Showing
91 changed files
with
906 additions
and
521 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# @atj/server-doj | ||
|
||
Web server to demonstrate forms for DOJ's Office of the Pardon Attorney. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"name": "@atj/server-doj", | ||
"version": "1.0.0", | ||
"description": "Form server instance for DOJ", | ||
"type": "module", | ||
"license": "CC0", | ||
"main": "src/index.ts", | ||
"scripts": { | ||
"start": "node dist/index.js", | ||
"build": "tsup src/* --format esm", | ||
"dev": "tsup src/* --watch --format esm", | ||
"test": "vitest run --coverage" | ||
}, | ||
"dependencies": { | ||
"@atj/server": "workspace:*" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^20.14.8", | ||
"@types/supertest": "^6.0.2", | ||
"supertest": "^7.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { createCustomServer } from './server'; | ||
|
||
const port = process.env.PORT || 4321; | ||
const app = await createCustomServer(); | ||
|
||
app.listen(port, () => { | ||
console.log(`Server running on http://localhost:${port}`); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { createServer } from '@atj/server/dist/index.js'; | ||
|
||
export const createCustomServer = () => { | ||
return createServer({ | ||
title: 'DOJ Form Service', | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import request from 'supertest'; | ||
import { beforeAll, describe, expect, test } from 'vitest'; | ||
|
||
import { createCustomServer } from '../src/server'; | ||
|
||
describe('DOJ Form Service', () => { | ||
let app: any; | ||
|
||
beforeAll(async () => { | ||
app = await createCustomServer(); | ||
}); | ||
|
||
test('renders the home page', async () => { | ||
const response = await request(app).get('/'); | ||
expect(response.ok).toBe(true); | ||
expect(response.text).toMatch(/DOJ Form Service/); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"extends": "../../tsconfig.base.json", | ||
"compilerOptions": { | ||
"module": "ESNext", | ||
"emitDeclarationOnly": true, | ||
"outDir": "./dist" | ||
}, | ||
"include": ["./src/**/*"], | ||
"exclude": ["./dist"], | ||
"references": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dist/ |
Oops, something went wrong.