Skip to content

Commit

Permalink
Rename packages with the @GSA-TTS namespace (#471)
Browse files Browse the repository at this point in the history
* Rename packages with the @GSA-TTS namespace.

* Update namespaces in e2e dockerfile
  • Loading branch information
danielnaab authored Jan 31, 2025
1 parent 08cef3c commit 25a6a36
Show file tree
Hide file tree
Showing 221 changed files with 550 additions and 485 deletions.
2 changes: 1 addition & 1 deletion apps/cli/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @atj/cli-app
# @gsa-tts/forms-cli-app

This package defines the platform's command-line interface.

Expand Down
6 changes: 3 additions & 3 deletions apps/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@atj/cli-app",
"name": "@gsa-tts/forms-cli-app",
"version": "1.0.0",
"description": "10x ATJ command-line interface",
"description": "10x Forms Platform command-line interface",
"type": "module",
"license": "CC0",
"main": "src/index.ts",
Expand All @@ -13,7 +13,7 @@
"test": "vitest run --coverage"
},
"dependencies": {
"@atj/infra-core": "workspace:*",
"@gsa-tts/forms-infra-core": "workspace:*",
"commander": "^11.1.0"
}
}
6 changes: 5 additions & 1 deletion apps/cli/src/cli-controller/secrets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import { promises as fs } from 'fs';
import path from 'path';
import { Command } from 'commander';

import { type DeployEnv, commands, getSecretsVault } from '@atj/infra-core';
import {
type DeployEnv,
commands,
getSecretsVault,
} from '@gsa-tts/forms-infra-core';
import { type Context } from './types.js';

export const addSecretCommands = (ctx: Context, cli: Command) => {
Expand Down
4 changes: 2 additions & 2 deletions apps/rest-api/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@atj/form-rest-api",
"name": "@gsa-tts/forms-form-rest-api",
"private": true,
"description": "backend service for handling submitted forms",
"main": "src/index.ts",
Expand All @@ -10,7 +10,7 @@
"dev": "tsup src/* --watch"
},
"dependencies": {
"@atj/forms": "workspace:*"
"@gsa-tts/forms-core": "workspace:*"
},
"devDependencies": {
"@types/aws-lambda": "^8.10.143",
Expand Down
2 changes: 1 addition & 1 deletion apps/server-doj/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# @atj/server-doj
# @gsa-tts/forms-server-doj

Web server to demonstrate forms for DOJ's Office of the Pardon Attorney.
6 changes: 3 additions & 3 deletions apps/server-doj/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@atj/server-doj",
"name": "@gsa-tts/forms-server-doj",
"version": "1.0.0",
"description": "Form server instance for DOJ",
"type": "module",
Expand All @@ -13,8 +13,8 @@
"test": "vitest run --coverage"
},
"dependencies": {
"@atj/database": "workspace:*",
"@atj/server": "workspace:*"
"@gsa-tts/forms-database": "workspace:*",
"@gsa-tts/forms-server": "workspace:*"
},
"devDependencies": {
"@types/supertest": "^6.0.2",
Expand Down
2 changes: 1 addition & 1 deletion apps/server-doj/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createPostgresDatabaseContext } from '@atj/database/context';
import { createPostgresDatabaseContext } from '@gsa-tts/forms-database/context';
import { createCustomServer } from './server.js';

const port = process.env.PORT || 4321;
Expand Down
4 changes: 2 additions & 2 deletions apps/server-doj/src/server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type DatabaseContext } from '@atj/database';
import { createServer } from '@atj/server';
import { type DatabaseContext } from '@gsa-tts/forms-database';
import { createServer } from '@gsa-tts/forms-server';

export const createCustomServer = async (db: DatabaseContext): Promise<any> => {
return createServer({
Expand Down
2 changes: 1 addition & 1 deletion apps/server-doj/tests/integration.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import request from 'supertest';
import { describe, expect, test } from 'vitest';

import { createInMemoryDatabaseContext } from '@atj/database/context';
import { createInMemoryDatabaseContext } from '@gsa-tts/forms-database/context';

import { createCustomServer } from '../src/server';

Expand Down
8 changes: 4 additions & 4 deletions apps/spotlight/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@atj/spotlight",
"name": "@gsa-tts/forms-spotlight",
"type": "module",
"version": "0.0.1",
"scripts": {
Expand All @@ -23,9 +23,9 @@
],
"dependencies": {
"@astrojs/react": "^3.6.1",
"@atj/common": "workspace:*",
"@atj/design": "workspace:*",
"@atj/forms": "workspace:*",
"@gsa-tts/forms-common": "workspace:*",
"@gsa-tts/forms-design": "workspace:*",
"@gsa-tts/forms-core": "workspace:*",
"astro": "^4.16.18",
"qs": "^6.13.0",
"react": "^18.3.1",
Expand Down
2 changes: 1 addition & 1 deletion apps/spotlight/src/components/AppAvailableFormList.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { ErrorBoundary } from 'react-error-boundary';

import { AvailableFormList } from '@atj/design';
import { AvailableFormList } from '@gsa-tts/forms-design';

import { getAppContext } from '../context.js';
import { getFormManagerUrlById, getFormUrl } from '../routes.js';
Expand Down
2 changes: 1 addition & 1 deletion apps/spotlight/src/components/AppFormManager.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import { FormManager } from '@atj/design';
import { FormManager } from '@gsa-tts/forms-design';

import { getAppContext } from '../context.js';
import { getFormManagerUrlById, getFormUrl } from '../routes.js';
Expand Down
2 changes: 1 addition & 1 deletion apps/spotlight/src/components/Header.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import closeSvg from '@atj/design/static/uswds/img/usa-icons/close.svg';
import closeSvg from '@gsa-tts/forms-design/static/uswds/img/usa-icons/close.svg';
import * as routes from '../routes';
import { Image } from 'astro:assets';
import { getPublicDirUrl } from '../routes';
Expand Down
6 changes: 3 additions & 3 deletions apps/spotlight/src/components/UsaBanner.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
import iconDotGov from '@atj/design/static/uswds/img/icon-dot-gov.svg';
import iconHttps from '@atj/design/static/uswds/img/icon-https.svg';
import usFlagSmall from '@atj/design/static/uswds/img/us_flag_small.png';
import iconDotGov from '@gsa-tts/forms-design/static/uswds/img/icon-dot-gov.svg';
import iconHttps from '@gsa-tts/forms-design/static/uswds/img/icon-https.svg';
import usFlagSmall from '@gsa-tts/forms-design/static/uswds/img/us_flag_small.png';
---

<section class="usa-banner" aria-label="Official government website">
Expand Down
8 changes: 4 additions & 4 deletions apps/spotlight/src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import {
type FormService,
createFormService,
parsePdf,
} from '@atj/forms';
import { defaultFormConfig } from '@atj/forms';
import { BrowserFormRepository } from '@atj/forms/context';
} from '@gsa-tts/forms-core';
import { defaultFormConfig } from '@gsa-tts/forms-core';
import { BrowserFormRepository } from '@gsa-tts/forms-core/context';

import { type GithubRepository } from './lib/github.js';
import { createTestBrowserFormService } from '@atj/forms/context';
import { createTestBrowserFormService } from '@gsa-tts/forms-core/context';

export type AppContext = {
baseUrl: `${string}/`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ import {
useParams,
} from 'react-router-dom';

import { defaultPatternComponents, Form } from '@atj/design';
import { defaultFormConfig, getRouteDataFromQueryString } from '@atj/forms';
import { defaultPatternComponents, Form } from '@gsa-tts/forms-design';
import {
defaultFormConfig,
getRouteDataFromQueryString,
} from '@gsa-tts/forms-core';

import { getAppContext } from '../../../context.js';
import { useFormPageStore } from '../store/index.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type FormSession, type RouteData } from '@atj/forms';
import { type FormSession, type RouteData } from '@gsa-tts/forms-core';
import { type FormPageContext } from './index.js';

export type FormSessionResponse =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type ServiceMethod, createService } from '@atj/common';
import { type ServiceMethod, createService } from '@gsa-tts/forms-common';

import { type AppContext, getAppContext } from '../../../../context.js';
import { type GetFormSession, getFormSession } from './get-form-session.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type FormRoute } from '@atj/forms';
import { type FormRoute } from '@gsa-tts/forms-core';
import { type FormPageContext } from './index.js';
import { getFormSession } from './get-form-session.js';

Expand Down
2 changes: 1 addition & 1 deletion apps/spotlight/src/lib/initialize.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
* Global initialization script.
*/
import '@atj/design';
import '@gsa-tts/forms-design';
2 changes: 1 addition & 1 deletion apps/spotlight/src/styles.css
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@import '@atj/design/static/uswds/styles/styles.css';
@import '@gsa-tts/forms-design/static/uswds/styles/styles.css';
4 changes: 2 additions & 2 deletions documents/adr/0007-initial-css-strategy.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ The project team desires a method of managing CSS using a method that maximizes

## Decision

The project team will theme USWDS via an encapsulated build (`@atj/design`). Any USWDS-related configuration or initialization will reside in this package.
The project team will theme USWDS via an encapsulated build (`@gsa-tts/forms-design`). Any USWDS-related configuration or initialization will reside in this package.

The Spotlight frontend will leverage this package via CSS imports. Where necessary, the Spotlight frontend application will use straight CSS.

## Consequences

There is a bit more pomp and circumstance required to leverage styles that are in a separate project (`@atj/design`) than there is when importing SASS directly via Astro.
There is a bit more pomp and circumstance required to leverage styles that are in a separate project (`@gsa-tts/forms-design`) than there is when importing SASS directly via Astro.

This decision is easily reversed if there proves to not be benefit from the extra modularization.
2 changes: 1 addition & 1 deletion documents/adr/0009-design-assets-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The project team requires a method of organizing frontend components that facili

## Decision

The project team will use [Storybook](https://storybook.js.org/) as development aid, component documentation, and collaboration tool. Storybook and corresponding React components will be located in the @atj/design namespace. The Storybook build will be bundled with the Spotlight build and deployed to Cloud.gov Pages.
The project team will use [Storybook](https://storybook.js.org/) as development aid, component documentation, and collaboration tool. Storybook and corresponding React components will be located in the @gsa-tts/forms-design namespace. The Storybook build will be bundled with the Spotlight build and deployed to Cloud.gov Pages.

The Spotlight frontend will leverage this package via CSS imports. Where necessary, the Spotlight frontend application will use straight CSS.

Expand Down
2 changes: 1 addition & 1 deletion e2e/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RUN npm install -g serve
EXPOSE 9090
EXPOSE 9191
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN pnpm build --filter=@atj/spotlight --filter=@atj/design
RUN pnpm build --filter=@gsa-tts/forms-spotlight --filter=@gsa-tts/forms-design
WORKDIR ./e2e
RUN serve ../apps/spotlight/dist -p 9090 -L & while ! nc -z localhost 9090; do sleep 1; done; pnpm playwright test;
RUN serve ../packages/design/storybook-static -p 9191 -L & while ! nc -z localhost 9191; do sleep 1; done; pnpm --filter=end-to-end-tests test:storybook --url http://localhost:9191 --config-dir ../packages/design/.storybook/ --browsers firefox chromium
Expand Down
2 changes: 1 addition & 1 deletion e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"path-to-regexp": "^8.2.0"
},
"dependencies": {
"@atj/common": "workspace:*"
"@gsa-tts/forms-common": "workspace:*"
}
}
2 changes: 1 addition & 1 deletion e2e/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default defineConfig({

/* Run your local dev server before starting the tests */
// webServer: {
// command: 'pnpm dev --filter=@atj/spotlight',
// command: 'pnpm dev --filter=@gsa-tts/forms-spotlight',
// url: 'http://localhost:4321',
// reuseExistingServer: !process.env.CI,
// },
Expand Down
2 changes: 1 addition & 1 deletion infra/cdktf/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @atj/infra
# @gsa-tts/forms-infra

Infrastructure-as-code (IaC) for the project, implemented with [Terraform CDK](https://github.com/hashicorp/terraform-cdk).

Expand Down
3 changes: 2 additions & 1 deletion infra/cdktf/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@atj/infra-cdktf",
"name": "@gsa-tts/forms-infra-cdktf",
"version": "1.0.0",
"description": "10x Forms Platform Terraform CDK",
"main": "src/index.js",
"types": "src/index.ts",
"scripts": {
Expand Down
8 changes: 4 additions & 4 deletions infra/core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@atj/infra-core",
"name": "@gsa-tts/forms-infra-core",
"version": "1.0.0",
"description": "10x ATJ secrets storage backend",
"description": "10x Forms Platform core infrastructure management",
"type": "module",
"license": "CC0",
"main": "dist/index.js",
Expand All @@ -13,8 +13,8 @@
"test": "vitest run --coverage"
},
"dependencies": {
"@atj/common": "workspace:*",
"@atj/forms": "workspace:*",
"@gsa-tts/forms-common": "workspace:*",
"@gsa-tts/forms-core": "workspace:*",
"@aws-sdk/client-ssm": "^3.624.0",
"zod": "^3.23.8"
}
Expand Down
2 changes: 1 addition & 1 deletion infra/core/src/lib/adapters/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { promises as fs } from 'fs';

import * as r from '@atj/common';
import * as r from '@gsa-tts/forms-common';

import { AWSParameterStoreSecretsVault } from './aws-param-store.js';
import { getSecretMapFromJsonString, type SecretsVault } from '../types.js';
Expand Down
2 changes: 1 addition & 1 deletion infra/core/src/lib/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as z from 'zod';
import { type Result } from '@atj/common';
import { type Result } from '@gsa-tts/forms-common';

export type SecretKey = string;
export type SecretValue = string | undefined;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"license": "CC0",
"packageManager": "[email protected]",
"scripts": {
"build": "turbo run build --filter=!@atj/infra-cdktf",
"build": "turbo run build --filter=!@gsa-tts/forms-infra-cdktf",
"clean": "turbo run clean",
"clean:modules": "find $(git rev-parse --show-toplevel) -name 'node_modules' -type d -prune -exec rm -rf '{}' +",
"clean:dist": "find $(git rev-parse --show-toplevel) -name 'dist' -type d -prune -exec rm -rf '{}' +",
Expand Down
8 changes: 4 additions & 4 deletions packages/auth/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@atj/auth",
"name": "@gsa-tts/forms-auth",
"version": "1.0.0",
"description": "10x ATJ auth module",
"description": "10x Forms Platform auth module",
"type": "module",
"license": "CC0",
"main": "dist/index.js",
Expand All @@ -13,8 +13,8 @@
"test": "vitest run --coverage"
},
"dependencies": {
"@atj/common": "workspace:^",
"@atj/database": "workspace:*",
"@gsa-tts/forms-common": "workspace:^",
"@gsa-tts/forms-database": "workspace:*",
"@lucia-auth/adapter-postgresql": "^3.1.2",
"@lucia-auth/adapter-sqlite": "^3.0.2",
"arctic": "^1.9.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/auth/src/context/test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Cookie, Lucia } from 'lucia';
import { vi } from 'vitest';

import { createInMemoryDatabaseContext } from '@atj/database/context';
import { createInMemoryDatabaseContext } from '@gsa-tts/forms-database/context';

import { AuthServiceContext, UserSession } from '../index.js';
import { createSqliteLuciaAdapter } from '../lucia.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/auth/src/lucia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BetterSqlite3Adapter } from '@lucia-auth/adapter-sqlite';
import { type Database as Sqlite3Database } from 'better-sqlite3';
import { Lucia } from 'lucia';

import { type Database } from '@atj/database';
import { type Database } from '@gsa-tts/forms-database';

/**
* Factory function to create a SQLite Lucia adapter.
Expand Down
5 changes: 4 additions & 1 deletion packages/auth/src/repository/create-session.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { expect, it } from 'vitest';

import { type DbTestContext, describeDatabase } from '@atj/database/testing';
import {
type DbTestContext,
describeDatabase,
} from '@gsa-tts/forms-database/testing';
import { createUser } from './create-user.js';
import { createSession } from './create-session.js';

Expand Down
2 changes: 1 addition & 1 deletion packages/auth/src/repository/create-session.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type DatabaseContext, dateValue } from '@atj/database';
import { type DatabaseContext, dateValue } from '@gsa-tts/forms-database';

type Session = {
id: string;
Expand Down
5 changes: 4 additions & 1 deletion packages/auth/src/repository/create-user.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { expect, it } from 'vitest';

import { type DbTestContext, describeDatabase } from '@atj/database/testing';
import {
type DbTestContext,
describeDatabase,
} from '@gsa-tts/forms-database/testing';

import { createUser } from './create-user.js';

Expand Down
2 changes: 1 addition & 1 deletion packages/auth/src/repository/create-user.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { randomUUID } from 'crypto';

import { type DatabaseContext } from '@atj/database';
import { type DatabaseContext } from '@gsa-tts/forms-database';

/**
* Asynchronously creates a new user record in the database.
Expand Down
Loading

0 comments on commit 25a6a36

Please sign in to comment.