diff --git a/.gitea/workflows/publish.yml b/.gitea/workflows/publish.yml new file mode 100644 index 0000000..6e1fc4b --- /dev/null +++ b/.gitea/workflows/publish.yml @@ -0,0 +1,134 @@ +name: Publish + +concurrency: + cancel-in-progress: false + group: publish-${{ github.ref_name }} + +env: + ACT_OWNER: ${{ github.repository_owner }} + ACT_REPOSITORY: ${{ github.repository }} + CGO_ENABLED: 0 + # Default comma-separated list of projects to build+publish. Can be overridden + # when manually dispatching the workflow via the `projects` input. + PUBLISH_PROJECTS: 'reviews-stars' + +on: + push: + tags: + - 'v*.*.*' + workflow_dispatch: + inputs: + projects: + description: 'Comma-separated list of Nx projects to build and publish' + required: false + default: 'reviews-stars' + version: + description: 'Semantic version to publish (e.g. 1.2.3). If omitted for tag runs, the tag name is used.' + required: false + npm_tag: + description: 'NPM dist-tag to use (overrides automatic selection). default: auto (latest for release, next for prerelease)' + required: false + +jobs: + build: + runs-on: ubuntu-latest + outputs: + projects: ${{ steps.set-projects.outputs.projects }} + env: + PUBLISH_PROJECTS: ${{ github.event.inputs.projects || env.PUBLISH_PROJECTS }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - run: git fetch --force --tags + - name: Set up Node.js + uses: actions/setup-node@v6 + with: + node-version: 22 + - name: Install dependencies + run: npm ci --legacy-peer-deps + - name: Build projects + run: | + echo "Projects to build: $PUBLISH_PROJECTS" + npx nx run-many --target=build --projects="$PUBLISH_PROJECTS" + - name: Upload dist artifact + uses: actions/upload-artifact@v4 + with: + name: dist + path: dist + - name: Set projects output (JSON array) + id: set-projects + run: | + # Convert comma-separated list into JSON array + IFS=',' read -ra PROJS <<< "$PUBLISH_PROJECTS" + json='[' + first=true + for p in "${PROJS[@]}"; do + p_trimmed=$(echo "$p" | xargs) + if [ "$first" = true ]; then + json+="\"$p_trimmed\"" + first=false + else + json+=",\"$p_trimmed\"" + fi + done + json+=']' + echo "projects=$json" >> "$GITHUB_OUTPUT" + + publish: + runs-on: ubuntu-latest + needs: build + strategy: + fail-fast: false + matrix: + project: ${{ fromJson(needs.build.outputs.projects) }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Download dist artifact + uses: actions/download-artifact@v4 + with: + name: dist + path: ./ + - name: Set up Node.js + uses: actions/setup-node@v6 + with: + node-version: 22 + - name: Determine version and npm tag + id: set-version + run: | + set -euo pipefail + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + if [ -n "${{ github.event.inputs.version }}" ]; then + VERSION="${{ github.event.inputs.version }}" + else + echo "No version provided for manual dispatch. Exiting." >&2 + exit 1 + fi + else + VERSION="${GITHUB_REF_NAME#v}" + fi + if [ -n "${{ github.event.inputs.npm_tag }}" ]; then + NPM_TAG="${{ github.event.inputs.npm_tag }}" + else + if echo "$VERSION" | grep -q "-"; then + NPM_TAG="next" + else + NPM_TAG="latest" + fi + fi + echo "version=$VERSION" >> "$GITHUB_OUTPUT" + echo "npm_tag=$NPM_TAG" >> "$GITHUB_OUTPUT" + - name: Configure npm auth + run: | + echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Publish project + run: | + echo "Publishing ${{ matrix.project }} with version ${VERSION} and tag ${NPM_TAG}" + node tools/scripts/publish.mjs "${{ matrix.project }}" "${VERSION}" "${NPM_TAG}" + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/apps/.gitkeep b/apps/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/apps/showcase-e2e/.eslintrc.json b/apps/showcase-e2e/.eslintrc.json deleted file mode 100644 index fbf2c97..0000000 --- a/apps/showcase-e2e/.eslintrc.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "extends": ["plugin:playwright/recommended", "../../.eslintrc.json"], - "ignorePatterns": ["!**/*"], - "overrides": [ - { - "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], - "rules": {} - }, - { - "files": ["*.ts", "*.tsx"], - "rules": {} - }, - { - "files": ["*.js", "*.jsx"], - "rules": {} - }, - { - "files": ["src/**/*.{ts,js,tsx,jsx}"], - "rules": {} - } - ] -} diff --git a/apps/showcase-e2e/playwright.config.ts b/apps/showcase-e2e/playwright.config.ts deleted file mode 100644 index 5a13eaa..0000000 --- a/apps/showcase-e2e/playwright.config.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { workspaceRoot } from '@nx/devkit'; -import { nxE2EPreset } from '@nx/playwright/preset'; -import { defineConfig, devices } from '@playwright/test'; - -// 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 serve showcase', - url: 'http://localhost:4200', - reuseExistingServer: !process.env.CI, - 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/showcase-e2e/project.json b/apps/showcase-e2e/project.json deleted file mode 100644 index 866c0d6..0000000 --- a/apps/showcase-e2e/project.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "showcase-e2e", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "sourceRoot": "apps/showcase-e2e/src", - "projectType": "application", - "tags": [], - "implicitDependencies": ["showcase"], - "targets": { - "e2e": { - "executor": "@nx/playwright:playwright", - "outputs": ["{workspaceRoot}/dist/.playwright/apps/showcase-e2e"], - "options": { - "config": "apps/showcase-e2e/playwright.config.ts" - } - }, - "lint": { - "executor": "@nx/eslint:lint" - } - } -} diff --git a/apps/showcase-e2e/src/example.spec.ts b/apps/showcase-e2e/src/example.spec.ts deleted file mode 100644 index fa8f1f3..0000000 --- a/apps/showcase-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/showcase-e2e/tsconfig.json b/apps/showcase-e2e/tsconfig.json deleted file mode 100644 index 114364a..0000000 --- a/apps/showcase-e2e/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "allowJs": true, - "outDir": "../../dist/out-tsc", - "module": "commonjs", - "sourceMap": false - }, - "include": [ - "**/*.ts", - "**/*.js", - "playwright.config.ts", - "src/**/*.spec.ts", - "src/**/*.spec.js", - "src/**/*.test.ts", - "src/**/*.test.js", - "src/**/*.d.ts" - ] -} diff --git a/apps/showcase/.babelrc b/apps/showcase/.babelrc deleted file mode 100644 index f2f3806..0000000 --- a/apps/showcase/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@nx/js/babel"] -} diff --git a/apps/showcase/.eslintrc.json b/apps/showcase/.eslintrc.json deleted file mode 100644 index 9d9c0db..0000000 --- a/apps/showcase/.eslintrc.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "extends": ["../../.eslintrc.json"], - "ignorePatterns": ["!**/*"], - "overrides": [ - { - "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], - "rules": {} - }, - { - "files": ["*.ts", "*.tsx"], - "rules": {} - }, - { - "files": ["*.js", "*.jsx"], - "rules": {} - } - ] -} diff --git a/apps/showcase/.swcrc b/apps/showcase/.swcrc deleted file mode 100644 index a2d5b04..0000000 --- a/apps/showcase/.swcrc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "jsc": { - "parser": { - "syntax": "typescript" - }, - "target": "es2016" - } -} diff --git a/apps/showcase/index.html b/apps/showcase/index.html deleted file mode 100644 index a182dce..0000000 --- a/apps/showcase/index.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - Showcase - - - - - - - - - - - diff --git a/apps/showcase/jest.config.ts b/apps/showcase/jest.config.ts deleted file mode 100644 index acff50d..0000000 --- a/apps/showcase/jest.config.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* eslint-disable */ -export default { - displayName: 'showcase', - preset: '../../jest.preset.js', - setupFilesAfterEnv: ['/src/test-setup.ts'], - transform: { - '^.+\\.[tj]s$': '@swc/jest', - }, - moduleFileExtensions: ['ts', 'js', 'html'], - coverageDirectory: '../../coverage/apps/showcase', -}; diff --git a/apps/showcase/project.json b/apps/showcase/project.json deleted file mode 100644 index f0b19c9..0000000 --- a/apps/showcase/project.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "showcase", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "projectType": "application", - "sourceRoot": "apps/showcase/src", - "tags": [], - "targets": { - "build": { - "executor": "@nx/vite:build", - "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", - "options": { - "outputPath": "dist/apps/showcase" - }, - "configurations": { - "development": { - "mode": "development" - }, - "production": { - "mode": "production" - } - } - }, - "serve": { - "executor": "@nx/vite:dev-server", - "defaultConfiguration": "development", - "options": { - "buildTarget": "showcase:build" - }, - "configurations": { - "development": { - "buildTarget": "showcase:build:development", - "hmr": true - }, - "production": { - "buildTarget": "showcase:build:production", - "hmr": false - } - } - }, - "preview": { - "executor": "@nx/vite:preview-server", - "defaultConfiguration": "development", - "options": { - "buildTarget": "showcase:build" - }, - "configurations": { - "development": { - "buildTarget": "showcase:build:development" - }, - "production": { - "buildTarget": "showcase:build:production" - } - } - }, - "lint": { - "executor": "@nx/eslint:lint" - }, - "test": { - "executor": "@nx/jest:jest", - "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], - "options": { - "jestConfig": "apps/showcase/jest.config.ts" - } - } - } -} diff --git a/apps/showcase/public/favicon.ico b/apps/showcase/public/favicon.ico deleted file mode 100644 index 317ebcb..0000000 Binary files a/apps/showcase/public/favicon.ico and /dev/null differ diff --git a/apps/showcase/src/app/app.element.css b/apps/showcase/src/app/app.element.css deleted file mode 100644 index 256753f..0000000 --- a/apps/showcase/src/app/app.element.css +++ /dev/null @@ -1,499 +0,0 @@ -/* - * Remove template code below - */ -html { - -webkit-text-size-adjust: 100%; - font-family: - ui-sans-serif, - system-ui, - -apple-system, - BlinkMacSystemFont, - 'Segoe UI', - Roboto, - 'Helvetica Neue', - Arial, - 'Noto Sans', - sans-serif, - 'Apple Color Emoji', - 'Segoe UI Emoji', - 'Segoe UI Symbol', - 'Noto Color Emoji'; - line-height: 1.5; - tab-size: 4; - scroll-behavior: smooth; -} -body { - font-family: inherit; - line-height: inherit; - margin: 0; -} -h1, -h2, -p, -pre { - margin: 0; -} -*, -::before, -::after { - box-sizing: border-box; - border-width: 0; - border-style: solid; - border-color: currentColor; -} -h1, -h2 { - font-size: inherit; - font-weight: inherit; -} -a { - color: inherit; - text-decoration: inherit; -} -pre { - font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace; -} -svg { - display: block; - vertical-align: middle; -} - -svg { - shape-rendering: auto; - text-rendering: optimizeLegibility; -} -pre { - background-color: rgba(55, 65, 81, 1); - border-radius: 0.25rem; - color: rgba(229, 231, 235, 1); - font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace; - overflow: scroll; - padding: 0.5rem 0.75rem; -} - -.shadow { - box-shadow: - 0 0 #0000, - 0 0 #0000, - 0 10px 15px -3px rgba(0, 0, 0, 0.1), - 0 4px 6px -2px rgba(0, 0, 0, 0.05); -} -.rounded { - border-radius: 1.5rem; -} - -.wrapper { - width: 100%; -} -.container { - margin-left: auto; - margin-right: auto; - max-width: 768px; - padding-bottom: 3rem; - padding-left: 1rem; - padding-right: 1rem; - color: rgba(55, 65, 81, 1); - width: 100%; -} -#welcome { - margin-top: 2.5rem; -} -#welcome h1 { - font-size: 3rem; - font-weight: 500; - letter-spacing: -0.025em; - line-height: 1; -} -#welcome span { - display: block; - font-size: 1.875rem; - font-weight: 300; - line-height: 2.25rem; - margin-bottom: 0.5rem; -} -#hero { - align-items: center; - background-color: hsla(214, 62%, 21%, 1); - border: none; - box-sizing: border-box; - color: rgba(55, 65, 81, 1); - display: grid; - grid-template-columns: 1fr; - margin-top: 3.5rem; -} -#hero .text-container { - color: rgba(255, 255, 255, 1); - padding: 3rem 2rem; -} -#hero .text-container h2 { - font-size: 1.5rem; - line-height: 2rem; - position: relative; -} -#hero .text-container h2 svg { - color: hsla(162, 47%, 50%, 1); - height: 2rem; - left: -0.25rem; - position: absolute; - top: 0; - width: 2rem; -} -#hero .text-container h2 span { - margin-left: 2.5rem; -} -#hero .text-container a { - background-color: rgba(255, 255, 255, 1); - border-radius: 0.75rem; - color: rgba(55, 65, 81, 1); - display: inline-block; - margin-top: 1.5rem; - padding: 1rem 2rem; - text-decoration: inherit; -} -#hero .logo-container { - display: none; - justify-content: center; - padding-left: 2rem; - padding-right: 2rem; -} -#hero .logo-container svg { - color: rgba(255, 255, 255, 1); - width: 66.666667%; -} - -#middle-content { - align-items: flex-start; - display: grid; - gap: 4rem; - grid-template-columns: 1fr; - margin-top: 3.5rem; -} - -#learning-materials { - padding: 2.5rem 2rem; -} -#learning-materials h2 { - font-weight: 500; - font-size: 1.25rem; - letter-spacing: -0.025em; - line-height: 1.75rem; - padding-left: 1rem; - padding-right: 1rem; -} -.list-item-link { - align-items: center; - border-radius: 0.75rem; - display: flex; - margin-top: 1rem; - padding: 1rem; - transition-property: - background-color, - border-color, - color, - fill, - stroke, - opacity, - box-shadow, - transform, - filter, - backdrop-filter, - -webkit-backdrop-filter; - transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); - transition-duration: 150ms; - width: 100%; -} -.list-item-link svg:first-child { - margin-right: 1rem; - height: 1.5rem; - transition-property: - background-color, - border-color, - color, - fill, - stroke, - opacity, - box-shadow, - transform, - filter, - backdrop-filter, - -webkit-backdrop-filter; - transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); - transition-duration: 150ms; - width: 1.5rem; -} -.list-item-link > span { - flex-grow: 1; - font-weight: 400; - transition-property: - background-color, - border-color, - color, - fill, - stroke, - opacity, - box-shadow, - transform, - filter, - backdrop-filter, - -webkit-backdrop-filter; - transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); - transition-duration: 150ms; -} -.list-item-link > span > span { - color: rgba(107, 114, 128, 1); - display: block; - flex-grow: 1; - font-size: 0.75rem; - font-weight: 300; - line-height: 1rem; - transition-property: - background-color, - border-color, - color, - fill, - stroke, - opacity, - box-shadow, - transform, - filter, - backdrop-filter, - -webkit-backdrop-filter; - transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); - transition-duration: 150ms; -} -.list-item-link svg:last-child { - height: 1rem; - transition-property: all; - transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); - transition-duration: 150ms; - width: 1rem; -} -.list-item-link:hover { - color: rgba(255, 255, 255, 1); - background-color: hsla(162, 47%, 50%, 1); -} -.list-item-link:hover > span { -} -.list-item-link:hover > span > span { - color: rgba(243, 244, 246, 1); -} -.list-item-link:hover svg:last-child { - transform: translateX(0.25rem); -} - -#other-links { -} -.button-pill { - padding: 1.5rem 2rem; - transition-duration: 300ms; - transition-property: - background-color, - border-color, - color, - fill, - stroke, - opacity, - box-shadow, - transform, - filter, - backdrop-filter, - -webkit-backdrop-filter; - transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); - align-items: center; - display: flex; -} -.button-pill svg { - transition-property: - background-color, - border-color, - color, - fill, - stroke, - opacity, - box-shadow, - transform, - filter, - backdrop-filter, - -webkit-backdrop-filter; - transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); - transition-duration: 150ms; - flex-shrink: 0; - width: 3rem; -} -.button-pill > span { - letter-spacing: -0.025em; - font-weight: 400; - font-size: 1.125rem; - line-height: 1.75rem; - padding-left: 1rem; - padding-right: 1rem; -} -.button-pill span span { - display: block; - font-size: 0.875rem; - font-weight: 300; - line-height: 1.25rem; -} -.button-pill:hover svg, -.button-pill:hover { - color: rgba(255, 255, 255, 1) !important; -} -#nx-console:hover { - background-color: rgba(0, 122, 204, 1); -} -#nx-console svg { - color: rgba(0, 122, 204, 1); -} -#nx-console-jetbrains { - margin-top: 2rem; -} -#nx-console-jetbrains:hover { - background-color: rgba(255, 49, 140, 1); -} -#nx-console-jetbrains svg { - color: rgba(255, 49, 140, 1); -} -#nx-repo:hover { - background-color: rgba(24, 23, 23, 1); -} -#nx-repo svg { - color: rgba(24, 23, 23, 1); -} - -#nx-cloud { - margin-bottom: 2rem; - margin-top: 2rem; - padding: 2.5rem 2rem; -} -#nx-cloud > div { - align-items: center; - display: flex; -} -#nx-cloud > div svg { - border-radius: 0.375rem; - flex-shrink: 0; - width: 3rem; -} -#nx-cloud > div h2 { - font-size: 1.125rem; - font-weight: 400; - letter-spacing: -0.025em; - line-height: 1.75rem; - padding-left: 1rem; - padding-right: 1rem; -} -#nx-cloud > div h2 span { - display: block; - font-size: 0.875rem; - font-weight: 300; - line-height: 1.25rem; -} -#nx-cloud p { - font-size: 1rem; - line-height: 1.5rem; - margin-top: 1rem; -} -#nx-cloud pre { - margin-top: 1rem; -} -#nx-cloud a { - color: rgba(107, 114, 128, 1); - display: block; - font-size: 0.875rem; - line-height: 1.25rem; - margin-top: 1.5rem; - text-align: right; -} -#nx-cloud a:hover { - text-decoration: underline; -} - -#commands { - padding: 2.5rem 2rem; - - margin-top: 3.5rem; -} -#commands h2 { - font-size: 1.25rem; - font-weight: 400; - letter-spacing: -0.025em; - line-height: 1.75rem; - padding-left: 1rem; - padding-right: 1rem; -} -#commands p { - font-size: 1rem; - font-weight: 300; - line-height: 1.5rem; - margin-top: 1rem; - padding-left: 1rem; - padding-right: 1rem; -} -details { - align-items: center; - display: flex; - margin-top: 1rem; - padding-left: 1rem; - padding-right: 1rem; - width: 100%; -} -details pre > span { - color: rgba(181, 181, 181, 1); -} -summary { - border-radius: 0.5rem; - display: flex; - font-weight: 400; - padding: 0.5rem; - cursor: pointer; - transition-property: - background-color, - border-color, - color, - fill, - stroke, - opacity, - box-shadow, - transform, - filter, - backdrop-filter, - -webkit-backdrop-filter; - transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); - transition-duration: 150ms; -} -summary:hover { - background-color: rgba(243, 244, 246, 1); -} -summary svg { - height: 1.5rem; - margin-right: 1rem; - width: 1.5rem; -} - -#love { - color: rgba(107, 114, 128, 1); - font-size: 0.875rem; - line-height: 1.25rem; - margin-top: 3.5rem; - opacity: 0.6; - text-align: center; -} -#love svg { - color: rgba(252, 165, 165, 1); - width: 1.25rem; - height: 1.25rem; - display: inline; - margin-top: -0.25rem; -} - -@media screen and (min-width: 768px) { - #hero { - grid-template-columns: repeat(2, minmax(0, 1fr)); - } - #hero .logo-container { - display: flex; - } - #middle-content { - grid-template-columns: repeat(2, minmax(0, 1fr)); - } -} diff --git a/apps/showcase/src/app/app.element.spec.ts b/apps/showcase/src/app/app.element.spec.ts deleted file mode 100644 index cf5ab76..0000000 --- a/apps/showcase/src/app/app.element.spec.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { AppElement } from './app.element'; - -describe('AppElement', () => { - let app: AppElement; - - beforeEach(() => { - app = new AppElement(); - }); - - it('should create successfully', () => { - expect(app).toBeTruthy(); - }); - - it('should have a greeting', () => { - app.connectedCallback(); - - expect(app.querySelector('h1').innerHTML).toContain('Welcome showcase'); - }); -}); diff --git a/apps/showcase/src/app/app.element.ts b/apps/showcase/src/app/app.element.ts deleted file mode 100644 index 423207e..0000000 --- a/apps/showcase/src/app/app.element.ts +++ /dev/null @@ -1,407 +0,0 @@ -import './app.element.css'; - -export class AppElement extends HTMLElement { - public static observedAttributes = []; - - connectedCallback() { - const title = 'showcase'; - this.innerHTML = ` -
-
- -
-

- Hello there, - Welcome ${title} 👋 -

-
- - -
-
-

- - - - You're up and running -

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

Next steps

-

Here are some things you can do with Nx:

-
- - - - - Add UI library - -
# Generate UI lib
-nx g @nx/angular:lib ui
-
-# Add a component
-nx g @nx/angular:component ui/src/lib/button
-
-
- - - - - View interactive project graph - -
nx graph
-
-
- - - - - Run affected commands - -
# see what's been affected by changes
-nx affected:graph
-
-# run tests for current changes
-nx affected:test
-
-# run e2e tests for current changes
-nx affected:e2e
-
-
- -

- Carefully crafted with - - - -

-
-
- `; - } -} -customElements.define('z-elements-root', AppElement); diff --git a/apps/showcase/src/assets/.gitkeep b/apps/showcase/src/assets/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/apps/showcase/src/main.ts b/apps/showcase/src/main.ts deleted file mode 100644 index fdb879d..0000000 --- a/apps/showcase/src/main.ts +++ /dev/null @@ -1 +0,0 @@ -import './app/app.element'; diff --git a/apps/showcase/src/styles.css b/apps/showcase/src/styles.css deleted file mode 100644 index 90d4ee0..0000000 --- a/apps/showcase/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/showcase/src/test-setup.ts b/apps/showcase/src/test-setup.ts deleted file mode 100644 index e69de29..0000000 diff --git a/apps/showcase/tsconfig.app.json b/apps/showcase/tsconfig.app.json deleted file mode 100644 index 3253fc8..0000000 --- a/apps/showcase/tsconfig.app.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "../../dist/out-tsc", - "types": ["node"] - }, - "exclude": ["src/**/*.spec.ts", "src/**/*.test.ts"], - "include": ["src/**/*.ts"] -} diff --git a/apps/showcase/tsconfig.json b/apps/showcase/tsconfig.json deleted file mode 100644 index cee4bba..0000000 --- a/apps/showcase/tsconfig.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "files": [], - "compilerOptions": { - "target": "ESNext", - "useDefineForClassFields": true, - "module": "ESNext", - "lib": ["ESNext", "DOM"], - "moduleResolution": "Node", - "strict": true, - "resolveJsonModule": true, - "isolatedModules": true, - "esModuleInterop": true, - "noEmit": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noImplicitReturns": true, - "skipLibCheck": true, - "types": ["vite/client"] - }, - "include": ["src"], - "references": [ - { - "path": "./tsconfig.app.json" - }, - { - "path": "./tsconfig.spec.json" - } - ] -} diff --git a/apps/showcase/tsconfig.spec.json b/apps/showcase/tsconfig.spec.json deleted file mode 100644 index 9e1c0c7..0000000 --- a/apps/showcase/tsconfig.spec.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "../../dist/out-tsc", - "module": "commonjs", - "types": ["jest", "node"] - }, - "files": ["src/test-setup.ts"], - "include": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts"] -} diff --git a/apps/showcase/vite.config.ts b/apps/showcase/vite.config.ts deleted file mode 100644 index c80091d..0000000 --- a/apps/showcase/vite.config.ts +++ /dev/null @@ -1,34 +0,0 @@ -/// -import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; -import { defineConfig } from 'vite'; - -export default defineConfig({ - root: __dirname, - cacheDir: '../../node_modules/.vite/apps/showcase', - - server: { - port: 4200, - host: 'localhost', - }, - - preview: { - port: 4300, - host: 'localhost', - }, - - plugins: [nxViteTsPaths()], - - // Uncomment this if you are using workers. - // worker: { - // plugins: [ nxViteTsPaths() ], - // }, - - build: { - outDir: '../../dist/apps/showcase', - emptyOutDir: true, - reportCompressedSize: true, - commonjsOptions: { - transformMixedEsModules: true, - }, - }, -}); diff --git a/libs/_internal/directives/src/lib/async-directive.ts b/libs/_internal/directives/src/lib/async-directive.ts index 30d5d3e..c5d2979 100644 --- a/libs/_internal/directives/src/lib/async-directive.ts +++ b/libs/_internal/directives/src/lib/async-directive.ts @@ -1,7 +1,7 @@ import { noChange } from 'lit'; import { AsyncDirective, directive } from 'lit/async-directive.js'; -import { Observable, Subject, tap } from 'rxjs'; +import { Observable, Subject, takeUntil, tap } from 'rxjs'; class Async extends AsyncDirective { /** Private variables */ @@ -23,6 +23,7 @@ class Async extends AsyncDirective { render(observable: Observable) { observable .pipe( + takeUntil(this.destroy$), tap((value: unknown) => { this.setValue(value); }), diff --git a/libs/_internal/styles/src/lib/variable.func.ts b/libs/_internal/styles/src/lib/variable.func.ts index 9a68015..0c49ecc 100644 --- a/libs/_internal/styles/src/lib/variable.func.ts +++ b/libs/_internal/styles/src/lib/variable.func.ts @@ -1,5 +1,5 @@ import { unsafeCSS } from 'lit'; -export function variable(variableName: string, defaultValue?: string) { +export function variable(variableName: `--${string}`, defaultValue?: string) { return unsafeCSS(`var(${variableName}${defaultValue ? `, ${defaultValue}` : ''})`); }