mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
refactor(core): add single-page apps as dependencies
This commit is contained in:
parent
f97ebaa3db
commit
1e5b68423a
8 changed files with 22 additions and 6 deletions
|
@ -9,10 +9,7 @@
|
|||
"@logto/cli",
|
||||
"@logto/create"
|
||||
]],
|
||||
"linked": [[
|
||||
"@logto/phrases",
|
||||
"@logto/phrases-ui"
|
||||
]],
|
||||
"linked": [],
|
||||
"//": "END OF CAUTION",
|
||||
"access": "restricted",
|
||||
"baseBranch": "master",
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
"license": "MPL-2.0",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"files": ["dist"],
|
||||
"scripts": {
|
||||
"precommit": "lint-staged",
|
||||
"start": "parcel src/index.html",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
"license": "MPL-2.0",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"files": ["dist"],
|
||||
"scripts": {
|
||||
"precommit": "lint-staged",
|
||||
"start": "parcel src/index.html",
|
||||
|
|
|
@ -3008,9 +3008,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
|
||||
|
@ -3026,6 +3032,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
|
||||
|
|
Loading…
Reference in a new issue