Skip to content

Commit

Permalink
feat: add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
caohuilin committed Nov 13, 2024
1 parent ec1d1d8 commit 4863275
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 37 deletions.
3 changes: 3 additions & 0 deletions packages/solutions/app-tools/src/new/compat/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ import {
transformHookRunner,
} from './utils';

/**
* old plugin useHookRunners function result
*/
export function getHookRunners(
context: InternalContext<
AppToolsUserConfig<'shared'>,
Expand Down
21 changes: 3 additions & 18 deletions packages/solutions/app-tools/src/new/compat/utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* Maps old plugin hook function names to new plugin API names
*/
export function transformHookRunner(hookRunnerName: string) {
switch (hookRunnerName) {
case 'beforeConfig':
Expand Down Expand Up @@ -40,24 +43,6 @@ export function transformHookRunner(hookRunnerName: string) {
return 'onBeforeRestart';
case 'htmlPartials':
return 'modifyHtmlPartials';
// case 'config':
// return 'config';
// case 'deploy':
// return 'deploy';
// case 'checkEntryPoint':
// return 'checkEntryPoint';
// case 'modifyEntrypoints':
// return 'modifyEntrypoints';
// case 'modifyFileSystemRoutes':
// return 'modifyFileSystemRoutes';
// case 'modifyServerRoutes':
// return 'modifyServerRoutes';
// case 'generateEntryCode':
// return 'generateEntryCode';
// case '_internalRuntimePlugins':
// return '_internalRuntimePlugins';
// case '_internalServerPlugins':
// return '_internalServerPlugins';
default:
return hookRunnerName;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/solutions/app-tools/src/new/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const initAppContext = ({
apiDirectory: path.resolve(appDirectory, apiDir),
lambdaDirectory: path.resolve(appDirectory, apiDir, 'lambda'),
sharedDirectory: path.resolve(appDirectory, sharedDir),
distDirectory: distDir,
distDirectory: distDir, // Special case: use ' ' to ensure compatibility with older plugins
serverPlugins: [],
internalDirectory: path.resolve(
appDirectory,
Expand Down
18 changes: 0 additions & 18 deletions packages/solutions/app-tools/src/new/types/plugin.ts

This file was deleted.

0 comments on commit 4863275

Please sign in to comment.