Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -376,11 +376,8 @@ jobs:
- name: Setup Playwright
uses: ./.github/actions/setup-playwright

- name: Build TS packages
run: yarn nx run-many -t build --exclude=ghost-admin

- name: Build Admin
run: yarn nx run ghost-admin:build:dev
run: yarn nx run @tryghost/admin:build:dev

- name: Run Playwright tests locally
run: yarn test:browser
Expand Down
2 changes: 1 addition & 1 deletion apps/activitypub/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dist
types
types/generated
playwright-report
test-results
7 changes: 6 additions & 1 deletion apps/activitypub/tailwind.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ const adminXPreset = require('@tryghost/shade/tailwind.cjs');

module.exports = {
presets: [adminXPreset('.shade-activitypub')],
content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}', '../../node_modules/@tryghost/shade/es/**/*.{js,ts,jsx,tsx}'],
content: [
'./index.html',
'./src/**/*.{js,ts,jsx,tsx}',
'../../node_modules/@tryghost/shade/src/**/*.{js,ts,jsx,tsx}',
'../../node_modules/@tryghost/shade/es/**/*.{js,ts,jsx,tsx}'
],
theme: {
extend: {
keyframes: {
Expand Down
16 changes: 0 additions & 16 deletions apps/activitypub/tsconfig.declaration.json

This file was deleted.

16 changes: 14 additions & 2 deletions apps/activitypub/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"noEmit": false,
"composite": true,
"declaration": true,
"declarationMap": true,
"declarationDir": "./types/generated",
"emitDeclarationOnly": true,
"tsBuildInfoFile": "./types/generated/tsconfig.tsbuildinfo",
"rootDir": "./src",
"jsx": "react-jsx",

/* Linting */
Expand All @@ -31,5 +38,10 @@
"@views/*": ["views/*"]
}
},
"include": ["src", "test"]
"include": ["src"],
"exclude": ["src/**/*.stories.tsx", "src/**/*.test.ts", "src/**/*.test.tsx"],
"references": [
{ "path": "../admin-x-framework/tsconfig.json" },
{ "path": "../shade/tsconfig.json" }
]
}
2 changes: 1 addition & 1 deletion apps/admin-x-design-system/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
es
types
types/generated
4 changes: 2 additions & 2 deletions apps/admin-x-design-system/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
"author": "Ghost Foundation",
"private": true,
"main": "es/index.js",
"types": "types/index.d.ts",
"types": "types/generated/index.d.ts",
"sideEffects": false,
"scripts": {
"dev": "vite build --watch",
"build": "tsc -p tsconfig.declaration.json && vite build",
"build": "tsc -p tsconfig.json && vite build",
"prepare": "yarn build",
"test": "yarn test:unit",
"test:unit": "yarn test:types && vitest run",
Expand Down
15 changes: 0 additions & 15 deletions apps/admin-x-design-system/tsconfig.declaration.json

This file was deleted.

9 changes: 9 additions & 0 deletions apps/admin-x-design-system/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": false,
"composite": true,
"declaration": true,
"declarationMap": true,
"declarationDir": "./types/generated",
"emitDeclarationOnly": true,
"tsBuildInfoFile": "./types/generated/tsconfig.tsbuildinfo",
"rootDir": "./src",
"jsx": "react-jsx",

/* Linting */
Expand All @@ -19,5 +27,6 @@
"noFallthroughCasesInSwitch": true
},
"include": ["src"],
"exclude": ["src/**/*.stories.tsx", "src/**/*.test.ts", "src/**/*.test.tsx"],
"references": [{ "path": "./tsconfig.node.json" }]
}
2 changes: 2 additions & 0 deletions apps/admin-x-design-system/tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"compilerOptions": {
"composite": true,
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
"outDir": "./node_modules/.tmp/tsconfig.node",
"skipLibCheck": true,
"module": "ESNext",
"moduleResolution": "bundler",
Expand Down
2 changes: 1 addition & 1 deletion apps/admin-x-framework/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
dist
types
types/generated
78 changes: 47 additions & 31 deletions apps/admin-x-framework/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,60 +7,75 @@
"private": true,
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/index.cjs",
"types": "./types/index.d.ts"
"import": "./src/index.ts",
"types": "./types/generated/index.d.ts",
"require": "./dist/index.cjs"
},
"./errors": {
"import": "./dist/errors.js",
"require": "./dist/errors.cjs",
"types": "./types/errors.d.ts"
"import": "./src/errors.ts",
"types": "./types/generated/errors.d.ts",
"require": "./dist/errors.cjs"
},
"./helpers": {
"import": "./dist/helpers.js",
"require": "./dist/helpers.cjs",
"types": "./types/helpers.d.ts"
"import": "./src/helpers.ts",
"types": "./types/generated/helpers.d.ts",
"require": "./dist/helpers.cjs"
},
"./hooks": {
"import": "./dist/hooks.js",
"require": "./dist/hooks.cjs",
"types": "./types/hooks.d.ts"
"import": "./src/hooks.ts",
"types": "./types/generated/hooks.d.ts",
"require": "./dist/hooks.cjs"
},
"./routing": {
"import": "./dist/routing.js",
"require": "./dist/routing.cjs",
"types": "./types/routing.d.ts"
"import": "./src/routing.ts",
"types": "./types/generated/routing.d.ts",
"require": "./dist/routing.cjs"
},
"./api/*": {
"import": "./dist/api/*.js",
"require": "./dist/api/*.cjs",
"types": "./types/api/*.d.ts"
"import": "./src/api/*.ts",
"types": "./types/generated/api/*.d.ts",
"require": "./dist/api/*.cjs"
},
"./utils/post-utils": {
"import": "./dist/utils/post-utils.js",
"require": "./dist/utils/post-utils.cjs",
"types": "./types/utils/post-utils.d.ts"
"import": "./src/utils/post-utils.ts",
"types": "./types/generated/utils/post-utils.d.ts",
"require": "./dist/utils/post-utils.cjs"
},
"./vite": {
"import": "./dist/vite.js",
"require": "./dist/vite.cjs",
"types": "./types/vite.d.ts"
"import": "./src/vite.ts",
"types": "./types/generated/vite.d.ts",
"require": "./dist/vite.cjs"
},
"./playwright": {
"import": "./dist/playwright.js",
"require": "./dist/playwright.cjs",
"types": "./types/playwright.d.ts"
"import": "./src/playwright.ts",
"types": "./types/generated/playwright.d.ts",
"require": "./dist/playwright.cjs"
},
"./test/render": {
"import": "./src/test/render.tsx",
"types": "./types/generated/test/render.d.ts",
"require": "./dist/test/render.cjs"
},
"./test/render-shade": {
"import": "./src/test/render-shade.tsx",
"types": "./types/generated/test/render-shade.d.ts",
"require": "./dist/test/render-shade.cjs"
},
"./test/test-utils": {
"import": "./src/test/test-utils.tsx",
"types": "./types/generated/test/test-utils.d.ts",
"require": "./dist/test/test-utils.cjs"
},
"./test/*": {
"import": "./dist/test/*.js",
"require": "./dist/test/*.cjs",
"types": "./types/test/*.d.ts"
"import": "./src/test/*.ts",
"types": "./types/generated/test/*.d.ts",
"require": "./dist/test/*.cjs"
}
},
"sideEffects": false,
"scripts": {
"dev": "vite build --watch",
"build": "tsc -p tsconfig.declaration.json && vite build",
"build": "tsc -p tsconfig.json && vite build",
"prepare": "yarn build",
"test": "yarn test:types && yarn test:unit",
"test:types": "tsc --noEmit",
Expand Down Expand Up @@ -88,6 +103,7 @@
"vite": "5.4.20",
"vite-plugin-css-injected-by-js": "3.5.2",
"vite-plugin-svgr": "3.3.0",
"vite-tsconfig-paths": "5.1.4",
"vitest": "1.6.1"
},
"dependencies": {
Expand Down
3 changes: 2 additions & 1 deletion apps/admin-x-framework/src/playwright.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {defineConfig, devices, PlaywrightTestConfig} from '@playwright/test';
import {defineConfig, devices} from '@playwright/test';
import type {PlaywrightTestConfig} from '@playwright/test';

export const E2E_PORT = 5173;

Expand Down
10 changes: 8 additions & 2 deletions apps/admin-x-framework/src/vite.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import react from '@vitejs/plugin-react';
import {PluginOption, UserConfig, mergeConfig} from 'vite';
import {resolve} from 'path';
import {mergeConfig} from 'vite';
import type {PluginOption, UserConfig} from 'vite';
import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js';
import svgr from 'vite-plugin-svgr';
import tsconfigPaths from 'vite-tsconfig-paths';
import {defineConfig} from 'vitest/config';

const externalPlugin = ({externals}: { externals: Record<string, string> }): PluginOption => {
Expand Down Expand Up @@ -34,6 +37,9 @@ export default function adminXViteConfig({packageName, entry, overrides}: {packa
const defaultConfig = defineConfig({
logLevel: process.env.CI ? 'info' : 'warn',
plugins: [
tsconfigPaths({
root: resolve(process.cwd(), '..')
}) as unknown as PluginOption,
svgr(),
react(),
externalPlugin({
Expand Down Expand Up @@ -83,5 +89,5 @@ export default function adminXViteConfig({packageName, entry, overrides}: {packa
}
});

return mergeConfig(defaultConfig, overrides || {});
return mergeConfig(defaultConfig as UserConfig, overrides || {});
};
15 changes: 0 additions & 15 deletions apps/admin-x-framework/tsconfig.declaration.json

This file was deleted.

17 changes: 15 additions & 2 deletions apps/admin-x-framework/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": false,
"composite": true,
"declaration": true,
"declarationMap": true,
"declarationDir": "./types/generated",
"emitDeclarationOnly": true,
"tsBuildInfoFile": "./types/generated/tsconfig.tsbuildinfo",
"rootDir": "./src",
"jsx": "react-jsx",

/* Linting */
Expand All @@ -18,6 +26,11 @@
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src", "test"],
"references": [{ "path": "./tsconfig.node.json" }]
"include": ["src"],
"exclude": ["src/**/*.stories.tsx", "src/**/*.test.ts", "src/**/*.test.tsx"],
"references": [
{ "path": "../admin-x-design-system/tsconfig.json" },
{ "path": "../shade/tsconfig.json" },
{ "path": "./tsconfig.node.json" }
]
}
2 changes: 2 additions & 0 deletions apps/admin-x-framework/tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"compilerOptions": {
"composite": true,
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
"outDir": "./node_modules/.tmp/tsconfig.node",
"skipLibCheck": true,
"module": "ESNext",
"moduleResolution": "bundler",
Expand Down
5 changes: 5 additions & 0 deletions apps/admin-x-settings/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dist
dist-ssr
types/generated
playwright-report
test-results
5 changes: 5 additions & 0 deletions apps/admin-x-settings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@
},
"nx": {
"targets": {
"build": {
"dependsOn": [
"^build"
]
},
"dev": {
"dependsOn": [
"^build"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ import UnsplashModal from '../../settings/advanced/integrations/unsplash-modal';
import UserDetailModal from '../../settings/general/user-detail-modal';
import ZapierModal from '../../settings/advanced/integrations/zapier-modal';

const modals = {
export type ModalComponent<Props = any> = React.FC<NiceModalHocProps & RoutingModalProps & Props>;

const modals: Record<string, ModalComponent<any>> = {
AddIntegrationModal,
AddNewsletterModal,
AddRecommendationModal,
Expand Down Expand Up @@ -62,10 +64,8 @@ const modals = {
// EditOfferModal,
AboutModal,
OfferSuccess
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} satisfies {[key: string]: ModalComponent<any>};
};

export default modals;

export type ModalName = keyof typeof modals;
export type ModalComponent<Props = object> = React.FC<NiceModalHocProps & RoutingModalProps & Props>;
Loading