Skip to content

Commit

Permalink
export type and runtme code separation (elastic#95320) (elastic#95751)
Browse files Browse the repository at this point in the history
Co-authored-by: Kibana Machine <[email protected]>

Co-authored-by: Mikhail Shustov <[email protected]>
  • Loading branch information
kibanamachine and mshustov authored Mar 30, 2021
1 parent 8d44ade commit d4c046f
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 40 deletions.
12 changes: 8 additions & 4 deletions src/plugins/home/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,28 @@

import { PluginInitializerContext } from 'kibana/public';

export {
export type {
FeatureCatalogueSetup,
EnvironmentSetup,
TutorialSetup,
HomePublicPluginSetup,
HomePublicPluginStart,
} from './plugin';
export {

export { FeatureCatalogueCategory } from './services';

export type {
FeatureCatalogueEntry,
FeatureCatalogueSolution,
FeatureCatalogueCategory,
Environment,
TutorialVariables,
TutorialDirectoryNoticeComponent,
TutorialDirectoryHeaderLinkComponent,
TutorialModuleNoticeComponent,
} from './services';
export * from '../common/instruction_variant';

export { INSTRUCTION_VARIANT, getDisplayText } from '../common/instruction_variant';

import { HomePublicPlugin } from './plugin';

export const plugin = (initializerContext: PluginInitializerContext) =>
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/home/public/services/environment/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
* Side Public License, v 1.
*/

export { EnvironmentService, Environment, EnvironmentServiceSetup } from './environment';
export { EnvironmentService } from './environment';
export type { Environment, EnvironmentServiceSetup } from './environment';
6 changes: 3 additions & 3 deletions src/plugins/home/public/services/feature_catalogue/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
* Side Public License, v 1.
*/

export {
FeatureCatalogueCategory,
export { FeatureCatalogueCategory, FeatureCatalogueRegistry } from './feature_catalogue_registry';

export type {
FeatureCatalogueEntry,
FeatureCatalogueSolution,
FeatureCatalogueRegistry,
FeatureCatalogueRegistrySetup,
} from './feature_catalogue_registry';
23 changes: 20 additions & 3 deletions src/plugins/home/public/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,23 @@
* Side Public License, v 1.
*/

export * from './feature_catalogue';
export * from './environment';
export * from './tutorials';
export { FeatureCatalogueCategory, FeatureCatalogueRegistry } from './feature_catalogue';

export type {
FeatureCatalogueEntry,
FeatureCatalogueSolution,
FeatureCatalogueRegistrySetup,
} from './feature_catalogue';

export { EnvironmentService } from './environment';
export type { Environment, EnvironmentServiceSetup } from './environment';

export { TutorialService } from './tutorials';

export type {
TutorialVariables,
TutorialServiceSetup,
TutorialDirectoryNoticeComponent,
TutorialDirectoryHeaderLinkComponent,
TutorialModuleNoticeComponent,
} from './tutorials';
5 changes: 3 additions & 2 deletions src/plugins/home/public/services/tutorials/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
* Side Public License, v 1.
*/

export {
TutorialService,
export { TutorialService } from './tutorial_service';

export type {
TutorialVariables,
TutorialServiceSetup,
TutorialDirectoryNoticeComponent,
Expand Down
9 changes: 5 additions & 4 deletions src/plugins/home/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
* Side Public License, v 1.
*/

export { HomeServerPluginSetup, HomeServerPluginStart } from './plugin';
export { TutorialProvider } from './services';
export { SampleDatasetProvider, SampleDataRegistrySetup } from './services';
export type { HomeServerPluginSetup, HomeServerPluginStart } from './plugin';
export type { TutorialProvider } from './services';
export type { SampleDatasetProvider, SampleDataRegistrySetup } from './services';
import { PluginInitializerContext, PluginConfigDescriptor } from 'kibana/server';
import { HomeServerPlugin } from './plugin';
import { configSchema, ConfigSchema } from '../config';
Expand All @@ -26,4 +26,5 @@ export const config: PluginConfigDescriptor<ConfigSchema> = {
export const plugin = (initContext: PluginInitializerContext) => new HomeServerPlugin(initContext);

export { INSTRUCTION_VARIANT } from '../common/instruction_variant';
export { ArtifactsSchema, TutorialsCategory } from './services/tutorials';
export { TutorialsCategory } from './services/tutorials';
export type { ArtifactsSchema } from './services/tutorials';
19 changes: 10 additions & 9 deletions src/plugins/home/server/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@
// provided to other plugins as APIs
// should model the plugin lifecycle

export { TutorialsRegistry, TutorialsRegistrySetup, TutorialsRegistryStart } from './tutorials';
export {
TutorialsCategory,
export { TutorialsRegistry } from './tutorials';
export type { TutorialsRegistrySetup, TutorialsRegistryStart } from './tutorials';

export { TutorialsCategory } from './tutorials';

export type {
ParamTypes,
InstructionSetSchema,
ParamsSchema,
Expand All @@ -24,10 +27,8 @@ export {
ScopedTutorialContextFactory,
} from './tutorials';

export {
SampleDataRegistry,
SampleDataRegistrySetup,
SampleDataRegistryStart,
} from './sample_data';
export { SampleDataRegistry } from './sample_data';

export type { SampleDataRegistrySetup, SampleDataRegistryStart } from './sample_data';

export { SampleDatasetSchema, SampleDatasetProvider } from './sample_data';
export type { SampleDatasetSchema, SampleDatasetProvider } from './sample_data';
13 changes: 7 additions & 6 deletions src/plugins/home/server/services/sample_data/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
* Side Public License, v 1.
*/

export {
SampleDataRegistry,
SampleDataRegistrySetup,
SampleDataRegistryStart,
} from './sample_data_registry';
export { SampleDataRegistry } from './sample_data_registry';

export { SampleDatasetSchema, SampleDatasetProvider } from './lib/sample_dataset_registry_types';
export type { SampleDataRegistrySetup, SampleDataRegistryStart } from './sample_data_registry';

export type {
SampleDatasetSchema,
SampleDatasetProvider,
} from './lib/sample_dataset_registry_types';
13 changes: 6 additions & 7 deletions src/plugins/home/server/services/tutorials/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@
* Side Public License, v 1.
*/

export {
TutorialsRegistry,
TutorialsRegistrySetup,
TutorialsRegistryStart,
} from './tutorials_registry';
export {
TutorialsCategory,
export { TutorialsRegistry } from './tutorials_registry';
export type { TutorialsRegistrySetup, TutorialsRegistryStart } from './tutorials_registry';

export { TutorialsCategory } from './lib/tutorials_registry_types';

export type {
ParamTypes,
InstructionSetSchema,
ParamsSchema,
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/home/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"outDir": "./target/types",
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true
"declarationMap": true,
"isolatedModules": true
},
"include": [
"common/**/*",
Expand Down

0 comments on commit d4c046f

Please sign in to comment.