0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

Merge pull request #3661 from logto-io/gao-add-spa-as-dependency

refactor(core): add single-page apps as dependencies
This commit is contained in:
Gao Sun 2023-04-03 17:02:52 +08:00 committed by GitHub
commit 94e03f2768
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 22 additions and 6 deletions

View file

@ -9,10 +9,7 @@
"@logto/cli",
"@logto/create"
]],
"linked": [[
"@logto/phrases",
"@logto/phrases-ui"
]],
"linked": [],
"//": "END OF CAUTION",
"access": "restricted",
"baseBranch": "master",

View file

@ -1,5 +1,6 @@
// See https://pnpm.io/pnpmfile
const fs = require('node:fs/promises');
const path = require('node:path');
// Types are inspected and edited from https://github.com/pnpm/pnpm/blob/ef6c22e129dc3d76998cee33647b70a66d1f36bf/hooks/pnpmfile/src/requireHooks.ts
/**
@ -27,7 +28,10 @@ const hooks = { readPackage: async (pkg) => {
}
// Apply connector's `package.json` to the template
const result = JSON.parse(await fs.readFile('packages/connectors/templates/package.json', 'utf8'));
const result = JSON.parse(
// Use `__dirname` since the `pnpm i` command may be executed in nested workspace directories
await fs.readFile(path.join(__dirname, 'packages/connectors/templates/package.json'), 'utf8')
);
for (const [key, value] of Object.entries(pkg)) {
if (key === '$schema') {
continue;

View file

@ -7,6 +7,7 @@
"license": "MPL-2.0",
"type": "module",
"private": true,
"files": ["dist"],
"scripts": {
"precommit": "lint-staged",
"start": "parcel src/index.html",

View file

@ -30,12 +30,15 @@
"@logto/app-insights": "workspace:^",
"@logto/cli": "workspace:^",
"@logto/connector-kit": "workspace:^",
"@logto/console": "workspace:*",
"@logto/core-kit": "workspace:^",
"@logto/demo-app": "workspace:*",
"@logto/language-kit": "workspace:^",
"@logto/phrases": "workspace:^",
"@logto/phrases-ui": "workspace:^",
"@logto/schemas": "workspace:^",
"@logto/shared": "workspace:^",
"@logto/ui": "workspace:*",
"@silverhand/essentials": "^2.5.0",
"aws-sdk": "^2.1329.0",
"chalk": "^5.0.0",

View file

@ -16,7 +16,7 @@ export default function koaSpaProxy<StateT, ContextT extends IRouterParamContext
): MiddlewareType<StateT, ContextT, ResponseBodyT> {
type Middleware = MiddlewareType<StateT, ContextT, ResponseBodyT>;
const distributionPath = path.join('..', packagePath, 'dist');
const distributionPath = path.join('node_modules/@logto', packagePath, 'dist');
const spaProxy: Middleware = EnvSet.values.isProduction
? serveStatic(distributionPath)

View file

@ -5,6 +5,7 @@
"author": "Silverhand Inc. <contact@silverhand.io>",
"license": "MPL-2.0",
"private": true,
"files": ["dist"],
"scripts": {
"precommit": "lint-staged",
"start": "parcel src/index.html",

View file

@ -4,6 +4,7 @@
"license": "MPL-2.0",
"type": "module",
"private": true,
"files": ["dist"],
"scripts": {
"precommit": "lint-staged",
"start": "parcel src/index.html",

View file

@ -3017,9 +3017,15 @@ importers:
'@logto/connector-kit':
specifier: workspace:^
version: link:../toolkit/connector-kit
'@logto/console':
specifier: workspace:*
version: link:../console
'@logto/core-kit':
specifier: workspace:^
version: link:../toolkit/core-kit
'@logto/demo-app':
specifier: workspace:*
version: link:../demo-app
'@logto/language-kit':
specifier: workspace:^
version: link:../toolkit/language-kit
@ -3035,6 +3041,9 @@ importers:
'@logto/shared':
specifier: workspace:^
version: link:../shared
'@logto/ui':
specifier: workspace:*
version: link:../ui
'@silverhand/essentials':
specifier: ^2.5.0
version: 2.5.0