diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2578df232..bd67fbc87 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,8 @@ jobs: library: name: Library — lint / test / build runs-on: ubuntu-latest + env: + LIBS: chat,langgraph,ag-ui,render,a2ui,partial-json,licensing steps: - uses: actions/checkout@v6.0.2 - uses: actions/setup-node@v6.3.0 @@ -17,9 +19,9 @@ jobs: node-version: 22 cache: npm - run: npm ci - - run: npx nx lint langgraph - - run: npx nx test langgraph --coverage - - run: npx nx build langgraph --configuration=production + - run: npx nx run-many -t lint --projects=$LIBS + - run: npx nx run-many -t test --projects=$LIBS --coverage + - run: npx nx run-many -t build --projects=$LIBS --configuration=production website: name: Website — lint / build diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index eef1883eb..7272a60c1 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -29,6 +29,12 @@ jobs: - run: npm ci + # Trusted publishing requires npm CLI 11.5.1+. Node 22's bundled npm + # is 10.x which has partial OIDC support but doesn't fully implement + # the trusted-publishing flow against npm registry's OIDC endpoint. + - name: Upgrade npm to support trusted publishing + run: npm install -g npm@latest + - name: Lint, test, build publishable projects run: npx nx run-many -t lint,test,build --projects=$NPM_PUBLISHABLE_PROJECTS --skip-nx-cache diff --git a/AGENTS.md b/AGENTS.md index ba37d00ae..37cca81b6 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -40,7 +40,6 @@ This file is for agents working in this repository. It is contributor-facing, no - `apps/website`: docs and marketing site. - `packages/mcp`: MCP server package (`@ngaf/langgraph-mcp`). - `e2e/agent-e2e`: end-to-end coverage for the workspace. -- `apps/demo` and `apps/demo-e2e`: demo application and related end-to-end coverage. ## Working in This Repo diff --git a/apps/demo-e2e/eslint.config.mjs b/apps/demo-e2e/eslint.config.mjs deleted file mode 100644 index b2e9fac09..000000000 --- a/apps/demo-e2e/eslint.config.mjs +++ /dev/null @@ -1,12 +0,0 @@ -import playwright from 'eslint-plugin-playwright'; -import baseConfig from '../../eslint.config.mjs'; - -export default [ - playwright.configs['flat/recommended'], - ...baseConfig, - { - files: ['**/*.ts', '**/*.js'], - // Override or add rules here - rules: {}, - }, -]; diff --git a/apps/demo-e2e/package.json b/apps/demo-e2e/package.json deleted file mode 100644 index a55915cf6..000000000 --- a/apps/demo-e2e/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "demo-e2e", - "version": "0.0.1", - "private": true -} diff --git a/apps/demo-e2e/playwright.config.ts b/apps/demo-e2e/playwright.config.ts deleted file mode 100644 index adc60565c..000000000 --- a/apps/demo-e2e/playwright.config.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { defineConfig, devices } from '@playwright/test'; -import { nxE2EPreset } from '@nx/playwright/preset'; -import { workspaceRoot } from '@nx/devkit'; - -// For CI, you may want to set BASE_URL to the deployed application. -const baseURL = process.env['BASE_URL'] || 'http://localhost:4200'; - -/** - * Read environment variables from file. - * https://github.com/motdotla/dotenv - */ -// require('dotenv').config(); - -/** - * See https://playwright.dev/docs/test-configuration. - */ -export default defineConfig({ - ...nxE2EPreset(__filename, { testDir: './src' }), - /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ - use: { - baseURL, - /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ - trace: 'on-first-retry', - }, - /* Run your local dev server before starting the tests */ - webServer: { - command: 'npx nx run demo:serve', - url: 'http://localhost:4200', - reuseExistingServer: true, - cwd: workspaceRoot, - }, - projects: [ - { - name: 'chromium', - use: { ...devices['Desktop Chrome'] }, - }, - - { - name: 'firefox', - use: { ...devices['Desktop Firefox'] }, - }, - - { - name: 'webkit', - use: { ...devices['Desktop Safari'] }, - }, - - // Uncomment for mobile browsers support - /* { - name: 'Mobile Chrome', - use: { ...devices['Pixel 5'] }, - }, - { - name: 'Mobile Safari', - use: { ...devices['iPhone 12'] }, - }, */ - - // Uncomment for branded browsers - /* { - name: 'Microsoft Edge', - use: { ...devices['Desktop Edge'], channel: 'msedge' }, - }, - { - name: 'Google Chrome', - use: { ...devices['Desktop Chrome'], channel: 'chrome' }, - } */ - ], -}); diff --git a/apps/demo-e2e/project.json b/apps/demo-e2e/project.json deleted file mode 100644 index f40d7f50d..000000000 --- a/apps/demo-e2e/project.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "demo-e2e", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "projectType": "application", - "sourceRoot": "apps/demo-e2e/src", - "implicitDependencies": ["demo"], - "// targets": "to see all targets run: nx show project demo-e2e --web", - "targets": {} -} diff --git a/apps/demo-e2e/src/example.spec.ts b/apps/demo-e2e/src/example.spec.ts deleted file mode 100644 index fa8f1f335..000000000 --- a/apps/demo-e2e/src/example.spec.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { test, expect } from '@playwright/test'; - -test('has title', async ({ page }) => { - await page.goto('/'); - - // Expect h1 to contain a substring. - expect(await page.locator('h1').innerText()).toContain('Welcome'); -}); diff --git a/apps/demo-e2e/tsconfig.json b/apps/demo-e2e/tsconfig.json deleted file mode 100644 index 82ac3f1b8..000000000 --- a/apps/demo-e2e/tsconfig.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "allowJs": true, - "outDir": "out-tsc/playwright", - "sourceMap": false, - "strict": true, - "noImplicitOverride": true, - "noPropertyAccessFromIndexSignature": true, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true - }, - "include": [ - "**/*.ts", - "**/*.js", - "playwright.config.ts", - "src/**/*.spec.ts", - "src/**/*.spec.js", - "src/**/*.test.ts", - "src/**/*.test.js", - "src/**/*.d.ts" - ], - "exclude": [ - "out-tsc", - "test-output", - "eslint.config.js", - "eslint.config.mjs", - "eslint.config.cjs" - ] -} diff --git a/apps/demo/eslint.config.mjs b/apps/demo/eslint.config.mjs deleted file mode 100644 index 9b3aa715c..000000000 --- a/apps/demo/eslint.config.mjs +++ /dev/null @@ -1,34 +0,0 @@ -import nx from '@nx/eslint-plugin'; -import baseConfig from '../../eslint.config.mjs'; - -export default [ - ...baseConfig, - ...nx.configs['flat/angular'], - ...nx.configs['flat/angular-template'], - { - files: ['**/*.ts'], - rules: { - '@angular-eslint/directive-selector': [ - 'error', - { - type: 'attribute', - prefix: 'app', - style: 'camelCase', - }, - ], - '@angular-eslint/component-selector': [ - 'error', - { - type: 'element', - prefix: 'app', - style: 'kebab-case', - }, - ], - }, - }, - { - files: ['**/*.html'], - // Override or add rules here - rules: {}, - }, -]; diff --git a/apps/demo/project.json b/apps/demo/project.json deleted file mode 100644 index bc58075bc..000000000 --- a/apps/demo/project.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "name": "demo", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "projectType": "application", - "prefix": "app", - "sourceRoot": "apps/demo/src", - "tags": [], - "targets": { - "build": { - "executor": "@angular/build:application", - "outputs": ["{options.outputPath.base}"], - "options": { - "outputPath": { "base": "apps/website/public/demo", "browser": "" }, - "browser": "apps/demo/src/main.ts", - "tsConfig": "apps/demo/tsconfig.app.json", - "assets": [ - { - "glob": "**/*", - "input": "apps/demo/public" - } - ], - "styles": ["apps/demo/src/styles.css"] - }, - "configurations": { - "production": { - "budgets": [ - { - "type": "initial", - "maximumWarning": "500kb", - "maximumError": "1mb" - }, - { - "type": "anyComponentStyle", - "maximumWarning": "4kb", - "maximumError": "8kb" - } - ], - "outputHashing": "none" - }, - "development": { - "optimization": false, - "extractLicenses": false, - "sourceMap": true - } - }, - "defaultConfiguration": "production" - }, - "serve": { - "continuous": true, - "executor": "@angular/build:dev-server", - "configurations": { - "production": { - "buildTarget": "demo:build:production" - }, - "development": { - "buildTarget": "demo:build:development" - } - }, - "defaultConfiguration": "development" - }, - "lint": { - "executor": "@nx/eslint:lint" - }, - "test": { - "executor": "@angular/build:unit-test", - "options": {} - }, - "serve-static": { - "continuous": true, - "executor": "@nx/web:file-server", - "options": { - "buildTarget": "demo:build", - "port": 4200, - "staticFilePath": "dist/apps/demo/browser", - "spa": true - } - } - } -} diff --git a/apps/demo/public/favicon.ico b/apps/demo/public/favicon.ico deleted file mode 100644 index 317ebcb23..000000000 Binary files a/apps/demo/public/favicon.ico and /dev/null differ diff --git a/apps/demo/src/app/app.config.ts b/apps/demo/src/app/app.config.ts deleted file mode 100644 index 50d39c4f8..000000000 --- a/apps/demo/src/app/app.config.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { - ApplicationConfig, - provideBrowserGlobalErrorListeners, -} from '@angular/core'; - -export const appConfig: ApplicationConfig = { - providers: [provideBrowserGlobalErrorListeners()], -}; diff --git a/apps/demo/src/app/app.css b/apps/demo/src/app/app.css deleted file mode 100644 index e69de29bb..000000000 diff --git a/apps/demo/src/app/app.html b/apps/demo/src/app/app.html deleted file mode 100644 index 69da4c31e..000000000 --- a/apps/demo/src/app/app.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/apps/demo/src/app/app.spec.ts b/apps/demo/src/app/app.spec.ts deleted file mode 100644 index 179ca8588..000000000 --- a/apps/demo/src/app/app.spec.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { TestBed } from '@angular/core/testing'; -import { App } from './app'; -import { NxWelcome } from './nx-welcome'; - -describe('App', () => { - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [App, NxWelcome], - }).compileComponents(); - }); - - it('should render title', async () => { - const fixture = TestBed.createComponent(App); - await fixture.whenStable(); - const compiled = fixture.nativeElement as HTMLElement; - expect(compiled.querySelector('h1')?.textContent).toContain('Welcome demo'); - }); -}); diff --git a/apps/demo/src/app/app.ts b/apps/demo/src/app/app.ts deleted file mode 100644 index 991d7546a..000000000 --- a/apps/demo/src/app/app.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Component } from '@angular/core'; -import { NxWelcome } from './nx-welcome'; - -@Component({ - imports: [NxWelcome], - selector: 'app-root', - templateUrl: './app.html', - styleUrl: './app.css', -}) -export class App { - protected title = 'demo'; -} diff --git a/apps/demo/src/app/chat-demo/chat-demo.component.ts b/apps/demo/src/app/chat-demo/chat-demo.component.ts deleted file mode 100644 index 3d726a0a3..000000000 --- a/apps/demo/src/app/chat-demo/chat-demo.component.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { Component, Input, OnInit, Injector, runInInjectionContext } from '@angular/core'; -import { agent } from '@ngaf/langgraph'; - -@Component({ - selector: 'stream-chat-demo', - standalone: false, - template: ` -
-
-
- {{ msg.content }} -
-
Thinking…
-
-
- - -
-
- `, - styles: [` - .chat-demo { font-family: Inter, system-ui, sans-serif; max-width: 560px; } - .messages { min-height: 200px; padding: 16px; display: flex; flex-direction: column; gap: 8px; } - .message { padding: 8px 12px; border-radius: 8px; font-size: 14px; color: #EEF1FF; background: rgba(108,142,255,0.08); } - .message.ai { background: rgba(108,142,255,0.15); } - .loading { font-size: 13px; color: #8B96C8; padding: 8px 12px; } - .input-row { display: flex; gap: 8px; padding: 0 16px 16px; } - .input-row input { flex: 1; padding: 8px 12px; border-radius: 6px; background: rgba(108,142,255,0.04); border: 1px solid rgba(108,142,255,0.15); color: #EEF1FF; font-size: 14px; outline: none; } - .input-row button { padding: 8px 16px; border-radius: 6px; background: #6C8EFF; color: #fff; border: none; font-size: 14px; cursor: pointer; } - `], -}) -export class ChatDemoComponent implements OnInit { - @Input() apiUrl = 'http://localhost:2024'; - @Input() assistantId = 'chat_agent'; - - chat: ReturnType | null = null; - - constructor(private injector: Injector) {} - - ngOnInit() { - // @Input() values are available in ngOnInit, so use runInInjectionContext - runInInjectionContext(this.injector, () => { - this.chat = agent({ - apiUrl: this.apiUrl, - assistantId: this.assistantId, - }); - }); - } - - send(e: Event) { - e.preventDefault(); - const form = e.target as HTMLFormElement; - const input = form.querySelector('input') as HTMLInputElement; - const content = input.value.trim(); - if (!content || !this.chat) return; - input.value = ''; - this.chat.submit({ message: content }); - } -} diff --git a/apps/demo/src/app/chat-demo/chat-demo.module.ts b/apps/demo/src/app/chat-demo/chat-demo.module.ts deleted file mode 100644 index a54d4fbaf..000000000 --- a/apps/demo/src/app/chat-demo/chat-demo.module.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { NgModule, Injector } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { createCustomElement } from '@angular/elements'; -import { ChatDemoComponent } from './chat-demo.component'; - -@NgModule({ - declarations: [ChatDemoComponent], - imports: [CommonModule], -}) -export class ChatDemoModule { - constructor(private injector: Injector) { - const el = createCustomElement(ChatDemoComponent, { injector: this.injector }); - customElements.define('stream-chat-demo', el); - } -} diff --git a/apps/demo/src/app/nx-welcome.ts b/apps/demo/src/app/nx-welcome.ts deleted file mode 100644 index 4bf52aa74..000000000 --- a/apps/demo/src/app/nx-welcome.ts +++ /dev/null @@ -1,874 +0,0 @@ -import { Component, ViewEncapsulation } from '@angular/core'; -import { CommonModule } from '@angular/common'; - -@Component({ - selector: 'app-nx-welcome', - imports: [CommonModule], - template: ` - - - - -
-
- -
-

- Hello there, - Welcome demo 👋 -

-
- -
-
-

- - - - You're up and running -

- What's next? -
-
- - - -
-
- - - -
-

Next steps

-

Here are some things you can do with Nx:

-
- - - - - Build, test and lint your app - -
# Build
-nx build 
-# Test
-nx test 
-# Lint
-nx lint 
-# Run them together!
-nx run-many -t build test lint
-
-
- - - - - View project details - -
nx show project demo
-
- -
- - - - - View interactive project graph - -
nx graph
-
- -
- - - - - Add UI library - -
# Generate UI lib
-nx g @nx/angular:lib ui
-# Add a component
-nx g @nx/angular:component ui/src/lib/button
-
-
-

- Carefully crafted with - - - -

-
-
- `, - styles: [], - encapsulation: ViewEncapsulation.None, -}) -export class NxWelcome {} diff --git a/apps/demo/src/index.html b/apps/demo/src/index.html deleted file mode 100644 index e2335ce2d..000000000 --- a/apps/demo/src/index.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - demo - - - - - - - - diff --git a/apps/demo/src/main.ts b/apps/demo/src/main.ts deleted file mode 100644 index da3b9f746..000000000 --- a/apps/demo/src/main.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { platformBrowser } from '@angular/platform-browser'; -import { NgModule } from '@angular/core'; -import { ChatDemoModule } from './app/chat-demo/chat-demo.module'; - -@NgModule({ imports: [ChatDemoModule] }) -class AppModule {} - -platformBrowser().bootstrapModule(AppModule); diff --git a/apps/demo/src/styles.css b/apps/demo/src/styles.css deleted file mode 100644 index 90d4ee007..000000000 --- a/apps/demo/src/styles.css +++ /dev/null @@ -1 +0,0 @@ -/* You can add global styles to this file, and also import other style files */ diff --git a/apps/demo/tsconfig.app.json b/apps/demo/tsconfig.app.json deleted file mode 100644 index a75ddab7b..000000000 --- a/apps/demo/tsconfig.app.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "../../dist/out-tsc", - "types": [] - }, - "include": ["src/**/*.ts"], - "exclude": ["src/**/*.spec.ts", "src/**/*.test.ts"] -} diff --git a/apps/demo/tsconfig.json b/apps/demo/tsconfig.json deleted file mode 100644 index 631fbe2dc..000000000 --- a/apps/demo/tsconfig.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "noPropertyAccessFromIndexSignature": true, - "experimentalDecorators": true, - "module": "preserve", - "emitDeclarationOnly": false, - "composite": false, - "lib": ["es2022", "dom"] - }, - "angularCompilerOptions": { - "enableI18nLegacyMessageIdFormat": false, - "strictInjectionParameters": true, - "strictInputAccessModifiers": true, - "strictTemplates": true - }, - "files": [], - "include": [], - "references": [ - { - "path": "./tsconfig.app.json" - }, - { - "path": "./tsconfig.spec.json" - } - ] -} diff --git a/apps/demo/tsconfig.spec.json b/apps/demo/tsconfig.spec.json deleted file mode 100644 index 2d36c4974..000000000 --- a/apps/demo/tsconfig.spec.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "../../dist/out-tsc", - "types": ["vitest/globals"] - }, - "include": ["src/**/*.ts", "src/**/*.d.ts"] -} diff --git a/apps/minting-service/vercel.json b/apps/minting-service/vercel.json index 4196c9d81..5c6799aab 100644 --- a/apps/minting-service/vercel.json +++ b/apps/minting-service/vercel.json @@ -1,5 +1,10 @@ { "installCommand": "cd ../.. && npm ci", "buildCommand": "cd ../.. && npx nx build minting-service", - "framework": null + "framework": null, + "git": { + "deploymentEnabled": { + "main": true + } + } } diff --git a/apps/website/project.json b/apps/website/project.json index 765b6441d..d5c4b8603 100644 --- a/apps/website/project.json +++ b/apps/website/project.json @@ -9,7 +9,6 @@ "executor": "@nx/next:build", "outputs": ["{options.outputPath}"], "defaultConfiguration": "production", - "dependsOn": ["demo:build"], "options": { "outputPath": "dist/apps/website" }, @@ -53,7 +52,6 @@ }, "e2e": { "executor": "@nx/playwright:playwright", - "dependsOn": [{ "projects": ["demo"], "target": "build" }], "options": { "config": "apps/website/playwright.config.ts" } diff --git a/apps/website/src/types/custom-elements.d.ts b/apps/website/src/types/custom-elements.d.ts deleted file mode 100644 index 74c91e32b..000000000 --- a/apps/website/src/types/custom-elements.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -declare namespace JSX { - interface IntrinsicElements { - 'stream-chat-demo': React.DetailedHTMLProps, HTMLElement> & { - 'api-url'?: string; - 'assistant-id'?: string; - }; - } -} diff --git a/eslint.config.mjs b/eslint.config.mjs index 91835fe84..d8a38127d 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -10,8 +10,6 @@ export default [ '**/out-tsc', '**/.next', '**/.next/**', - '**/public/demo', - '**/public/demo/**', '**/next-env.d.ts', ], }, diff --git a/package-lock.json b/package-lock.json index f16fbe493..553dec28a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -113,9 +113,6 @@ "tailwind-merge": "^2.5.0" } }, - "apps/demo-e2e": { - "version": "0.0.1" - }, "apps/minting-service": { "name": "@ngaf/minting-service", "version": "0.0.1", @@ -25826,10 +25823,6 @@ "dev": true, "license": "MIT" }, - "node_modules/demo-e2e": { - "resolved": "apps/demo-e2e", - "link": true - }, "node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", diff --git a/tsconfig.json b/tsconfig.json index b9580540f..e2c6fe169 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,12 +5,6 @@ "references": [ { "path": "./apps/website" - }, - { - "path": "./apps/demo" - }, - { - "path": "./apps/demo-e2e" } ] }