diff --git a/apps/admin/src/Extensions.tsx b/apps/admin/src/Extensions.tsx index 00cd662531a..cf289007f7f 100644 --- a/apps/admin/src/Extensions.tsx +++ b/apps/admin/src/Extensions.tsx @@ -1,4 +1,5 @@ // This file is automatically updated via scaffolding utilities. +// Learn more about extensions: https://webiny.link/extensions import React from "react"; export const Extensions = () => { diff --git a/apps/api/graphql/package.json b/apps/api/graphql/package.json index ec379b18818..fafa0b465c9 100644 --- a/apps/api/graphql/package.json +++ b/apps/api/graphql/package.json @@ -23,7 +23,6 @@ "@webiny/api-headless-cms-ddb": "0.0.0", "@webiny/api-headless-cms-tasks": "0.0.0", "@webiny/api-i18n": "0.0.0", - "@webiny/api-i18n-content": "0.0.0", "@webiny/api-i18n-ddb": "0.0.0", "@webiny/api-log": "0.0.0", "@webiny/api-page-builder": "0.0.0", @@ -31,12 +30,12 @@ "@webiny/api-page-builder-import-export": "0.0.0", "@webiny/api-page-builder-import-export-so-ddb": "0.0.0", "@webiny/api-page-builder-so-ddb": "0.0.0", - "@webiny/api-prerendering-service": "0.0.0", "@webiny/api-prerendering-service-aws": "0.0.0", "@webiny/api-record-locking": "0.0.0", "@webiny/api-security": "0.0.0", "@webiny/api-security-cognito": "0.0.0", "@webiny/api-security-so-ddb": "0.0.0", + "@webiny/api-serverless-cms": "0.0.0", "@webiny/api-tenancy": "0.0.0", "@webiny/api-tenancy-so-ddb": "0.0.0", "@webiny/api-tenant-manager": "0.0.0", diff --git a/apps/api/graphql/src/extensions.ts b/apps/api/graphql/src/extensions.ts index 658b605320b..8fe26e9ecfd 100644 --- a/apps/api/graphql/src/extensions.ts +++ b/apps/api/graphql/src/extensions.ts @@ -1,4 +1,5 @@ // This file is automatically updated via scaffolding utilities. +// Learn more about extensions: https://webiny.link/extensions export const extensions = () => { return []; }; diff --git a/apps/api/graphql/src/plugins/continuingTask.ts b/apps/api/graphql/src/plugins/continuingTask.ts index 8a09a021bbf..612d873be38 100644 --- a/apps/api/graphql/src/plugins/continuingTask.ts +++ b/apps/api/graphql/src/plugins/continuingTask.ts @@ -1,5 +1,5 @@ import { createTaskDefinition } from "@webiny/tasks"; -import { Context } from "../types"; +import { Context } from "@webiny/api-serverless-cms"; import { ITaskResponseContinueOptions } from "@webiny/tasks/response/abstractions"; const MAX_RUNS = 5; diff --git a/apps/api/graphql/src/security.okta.ts b/apps/api/graphql/src/security.okta.ts index 08d80c13c08..563c6e58716 100644 --- a/apps/api/graphql/src/security.okta.ts +++ b/apps/api/graphql/src/security.okta.ts @@ -11,7 +11,7 @@ import anonymousAuthorization from "@webiny/api-security/plugins/anonymousAuthor import tenantLinkAuthorization from "@webiny/api-security/plugins/tenantLinkAuthorization"; import createAdminUsersApp from "@webiny/api-admin-users"; import { createStorageOperations as createAdminUsersStorageOperations } from "@webiny/api-admin-users-so-ddb"; -import { Context } from "./types"; +import { Context } from "@webiny/api-serverless-cms"; export default ({ documentClient }: { documentClient: DynamoDBDocument }) => [ /** diff --git a/apps/api/graphql/src/types.ts b/apps/api/graphql/src/types.ts deleted file mode 100644 index 73ccf9a4286..00000000000 --- a/apps/api/graphql/src/types.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { I18NContext } from "@webiny/api-i18n/types"; -import { I18NContentContext } from "@webiny/api-i18n-content/types"; -import { PbContext } from "@webiny/api-page-builder/graphql/types"; -import { PrerenderingServiceClientContext } from "@webiny/api-prerendering-service/client/types"; -import { FileManagerContext } from "@webiny/api-file-manager/types"; -import { FormBuilderContext } from "@webiny/api-form-builder/types"; -import { CmsContext } from "@webiny/api-headless-cms/types"; -import { AcoContext } from "@webiny/api-aco/types"; -import { PbAcoContext } from "@webiny/api-page-builder-aco/types"; -import { Context as TasksContext } from "@webiny/tasks/types"; -import { HcmsAcoContext } from "@webiny/api-headless-cms-aco/types"; -import { HcmsTasksContext } from "@webiny/api-headless-cms-tasks/types"; - -// When working with the `context` object (for example while defining a new GraphQL resolver function), -// you can import this interface and assign it to it. This will give you full autocomplete functionality -// and type safety. The easiest way to import it would be via the following import statement: -// import { Context } from "~/types"; -// Feel free to extend it with additional context interfaces, if needed. Also, please do not change the -// name of the interface, as existing scaffolding utilities may rely on it during the scaffolding process. -export interface Context - extends I18NContext, - I18NContentContext, - PbContext, - PrerenderingServiceClientContext, - FileManagerContext, - CmsContext, - FormBuilderContext, - AcoContext, - TasksContext, - PbAcoContext, - HcmsAcoContext, - HcmsTasksContext {} diff --git a/apps/api/graphql/tsconfig.json b/apps/api/graphql/tsconfig.json index 0c9b4fe533d..d1befe71e7c 100644 --- a/apps/api/graphql/tsconfig.json +++ b/apps/api/graphql/tsconfig.json @@ -53,9 +53,6 @@ { "path": "../../../packages/api-i18n/tsconfig.build.json" }, - { - "path": "../../../packages/api-i18n-content/tsconfig.build.json" - }, { "path": "../../../packages/api-i18n-ddb/tsconfig.build.json" }, @@ -75,7 +72,7 @@ "path": "../../../packages/api-page-builder-so-ddb/tsconfig.build.json" }, { - "path": "../../../packages/api-prerendering-service/tsconfig.build.json" + "path": "../../../packages/api-prerendering-service-aws/tsconfig.build.json" }, { "path": "../../../packages/api-security/tsconfig.build.json" @@ -86,6 +83,9 @@ { "path": "../../../packages/api-security-so-ddb/tsconfig.build.json" }, + { + "path": "../../../packages/api-serverless-cms/tsconfig.build.json" + }, { "path": "../../../packages/api-tenancy/tsconfig.build.json" }, @@ -165,8 +165,6 @@ "@webiny/api-record-locking": ["../../../packages/api-record-locking/src"], "@webiny/api-i18n/*": ["../../../packages/api-i18n/src/*"], "@webiny/api-i18n": ["../../../packages/api-i18n/src"], - "@webiny/api-i18n-content/*": ["../../../packages/api-i18n-content/src/*"], - "@webiny/api-i18n-content": ["../../../packages/api-i18n-content/src"], "@webiny/api-i18n-ddb/*": ["../../../packages/api-i18n-ddb/src/*"], "@webiny/api-i18n-ddb": ["../../../packages/api-i18n-ddb/src"], "@webiny/api-page-builder/*": ["../../../packages/api-page-builder/src/*"], @@ -187,14 +185,19 @@ ], "@webiny/api-page-builder-so-ddb/*": ["../../../packages/api-page-builder-so-ddb/src/*"], "@webiny/api-page-builder-so-ddb": ["../../../packages/api-page-builder-so-ddb/src"], - "@webiny/api-prerendering-service/*": ["../../../packages/api-prerendering-service/src/*"], - "@webiny/api-prerendering-service": ["../../../packages/api-prerendering-service/src"], + "@webiny/api-prerendering-service-aws/*": [ + "../../../packages/api-prerendering-service-aws/src/*" + ], + "@webiny/api-prerendering-service-aws": [ + "../../../packages/api-prerendering-service-aws/src" + ], "@webiny/api-security/*": ["../../../packages/api-security/src/*"], "@webiny/api-security": ["../../../packages/api-security/src"], "@webiny/api-security-cognito/*": ["../../../packages/api-security-cognito/src/*"], "@webiny/api-security-cognito": ["../../../packages/api-security-cognito/src"], "@webiny/api-security-so-ddb/*": ["../../../packages/api-security-so-ddb/src/*"], "@webiny/api-security-so-ddb": ["../../../packages/api-security-so-ddb/src"], + "@webiny/api-serverless-cms": ["../../../packages/api-serverless-cms/src"], "@webiny/api-tenancy/*": ["../../../packages/api-tenancy/src/*"], "@webiny/api-tenancy": ["../../../packages/api-tenancy/src"], "@webiny/api-tenancy-so-ddb/*": ["../../../packages/api-tenancy-so-ddb/src/*"], diff --git a/apps/website/src/Extensions.tsx b/apps/website/src/Extensions.tsx index 00cd662531a..cf289007f7f 100644 --- a/apps/website/src/Extensions.tsx +++ b/apps/website/src/Extensions.tsx @@ -1,4 +1,5 @@ // This file is automatically updated via scaffolding utilities. +// Learn more about extensions: https://webiny.link/extensions import React from "react"; export const Extensions = () => { diff --git a/packages/cli-plugin-extensions/src/downloadAndLinkExtension.ts b/packages/cli-plugin-extensions/src/downloadAndLinkExtension.ts index a32e2f4a1ac..4cea22bedb9 100644 --- a/packages/cli-plugin-extensions/src/downloadAndLinkExtension.ts +++ b/packages/cli-plugin-extensions/src/downloadAndLinkExtension.ts @@ -13,6 +13,7 @@ import { Extension } from "./extensions/Extension"; import glob from "fast-glob"; import { CliContext } from "@webiny/cli/types"; import { Ora } from "ora"; +import { ExtensionJson, ExtensionMessage } from "~/types"; const EXTENSIONS_ROOT_FOLDER = "extensions"; const S3_BUCKET_NAME = "webiny-examples"; @@ -87,6 +88,7 @@ export const downloadAndLinkExtension = async ({ await setTimeout(1000); let extensionsFolderToCopyPath = path.join(downloadFolderPath, "extensions"); + let extensionJsonPath = path.join(downloadFolderPath, "extension.json"); // If we have `extensions` folder in the root of the downloaded extension. // it means the example extension is not versioned, and we can just copy it. @@ -106,8 +108,14 @@ export const downloadAndLinkExtension = async ({ ); extensionsFolderToCopyPath = path.join(downloadFolderPath, versionToUse, "extensions"); + extensionJsonPath = path.join(downloadFolderPath, versionToUse, "extension.json"); } + const extensionJsonExists = fs.existsSync(extensionJsonPath); + const extensionJson: ExtensionJson = extensionJsonExists + ? JSON.parse(fs.readFileSync(extensionJsonPath, "utf-8")) + : {}; + await fsAsync.cp(extensionsFolderToCopyPath, EXTENSIONS_ROOT_FOLDER, { recursive: true }); @@ -137,6 +145,8 @@ export const downloadAndLinkExtension = async ({ await linkAllExtensions(); await runYarnInstall(); + const nextStepsToDisplay: ExtensionMessage[] = []; + if (downloadedExtensions.length === 1) { const [downloadedExtension] = downloadedExtensions; ora.succeed( @@ -145,13 +155,7 @@ export const downloadAndLinkExtension = async ({ )}.` ); - const nextSteps = downloadedExtension.getNextSteps(); - - console.log(); - console.log(chalk.bold("Next Steps")); - nextSteps.forEach(message => { - console.log(`‣ ${message}`); - }); + nextStepsToDisplay.push(...downloadedExtension.getNextSteps()); } else { const paths = downloadedExtensions.map(ext => ext.getLocation()); ora.succeed("Multiple extensions downloaded successfully in:"); @@ -160,13 +164,50 @@ export const downloadAndLinkExtension = async ({ }); } + // Next Steps section. + const nextStepsFromExtensionJson = extensionJson.nextSteps; + if (nextStepsFromExtensionJson) { + const { clearExisting, messages } = nextStepsFromExtensionJson; + if (clearExisting) { + nextStepsToDisplay.length = 0; + } + + if (Array.isArray(messages)) { + nextStepsToDisplay.push(...messages); + } + } + + console.log(); + console.log(chalk.bold("Next Steps")); + nextStepsToDisplay.forEach(({ text, variables = [] }) => { + console.log(`‣ ${text}`, ...variables.map(v => context.success.hl(v))); + }); + + // Additional Notes section. + const additionalNotesToDisplay: ExtensionMessage[] = [ + { + text: `if you already have the %s command running, you'll need to restart it`, + variables: ["webiny watch"] + } + ]; + + const additionalNotesFromExtensionJson = extensionJson.additionalNotes; + if (additionalNotesFromExtensionJson) { + const { clearExisting, messages } = additionalNotesFromExtensionJson; + if (clearExisting) { + additionalNotesToDisplay.length = 0; + } + + if (Array.isArray(messages)) { + additionalNotesToDisplay.push(...messages); + } + } + console.log(); console.log(chalk.bold("Additional Notes")); - console.log( - `‣ note that if you already have the ${context.success.hl( - "webiny watch" - )} command running, you'll need to restart it` - ); + additionalNotesToDisplay.forEach(({ text, variables = [] }) => { + console.log(`‣ ${text}`, ...variables.map(v => context.success.hl(v))); + }); } catch (e) { switch (e.code) { case "NO_OBJECTS_FOUND": diff --git a/packages/cli-plugin-extensions/src/extensions/AbstractExtension.ts b/packages/cli-plugin-extensions/src/extensions/AbstractExtension.ts index 69010f85308..92343434cb7 100644 --- a/packages/cli-plugin-extensions/src/extensions/AbstractExtension.ts +++ b/packages/cli-plugin-extensions/src/extensions/AbstractExtension.ts @@ -1,3 +1,5 @@ +import { ExtensionMessage } from "~/types"; + export interface ExtensionTypeConstructorParams { name: string; type: string; @@ -14,7 +16,7 @@ export abstract class AbstractExtension { abstract link(): Promise; - abstract getNextSteps(): string[]; + abstract getNextSteps(): ExtensionMessage[]; getPackageJsonPath(): string { return `${this.params.location}/package.json`; diff --git a/packages/cli-plugin-extensions/src/extensions/AdminExtension.ts b/packages/cli-plugin-extensions/src/extensions/AdminExtension.ts index bfb4caa770a..68691fea68e 100644 --- a/packages/cli-plugin-extensions/src/extensions/AdminExtension.ts +++ b/packages/cli-plugin-extensions/src/extensions/AdminExtension.ts @@ -1,11 +1,11 @@ import { AbstractExtension } from "./AbstractExtension"; import path from "path"; import { EXTENSIONS_ROOT_FOLDER } from "~/utils/constants"; -import chalk from "chalk"; import { JsxFragment, Node, Project } from "ts-morph"; import { formatCode } from "@webiny/cli-plugin-scaffold/utils"; import { updateDependencies, updateWorkspaces } from "~/utils"; import Case from "case"; +import { ExtensionMessage } from "~/types"; export class AdminExtension extends AbstractExtension { async link() { @@ -20,7 +20,7 @@ export class AdminExtension extends AbstractExtension { await updateWorkspaces(this.params.location); } - getNextSteps(): string[] { + getNextSteps(): ExtensionMessage[] { let { location: extensionsFolderPath } = this.params; if (!extensionsFolderPath) { extensionsFolderPath = `${EXTENSIONS_ROOT_FOLDER}/${this.params.name}`; @@ -30,11 +30,12 @@ export class AdminExtension extends AbstractExtension { const indexTsxFilePath = `${extensionsFolderPath}/src/index.tsx`; return [ - `run ${chalk.green(watchCommand)} to start local development`, - `open ${chalk.green(indexTsxFilePath)} and start coding`, - `to install additional dependencies, run ${chalk.green( - `yarn workspace ${this.params.packageName} add ` - )}` + { text: `run %s to start local development`, variables: [watchCommand] }, + { text: `open %s and start coding`, variables: [indexTsxFilePath] }, + { + text: `to install additional dependencies, run %s`, + variables: [`yarn workspace ${this.params.packageName} add `] + } ]; } diff --git a/packages/cli-plugin-extensions/src/extensions/ApiExtension.ts b/packages/cli-plugin-extensions/src/extensions/ApiExtension.ts index 8cc85806e4a..5cb4bad4d06 100644 --- a/packages/cli-plugin-extensions/src/extensions/ApiExtension.ts +++ b/packages/cli-plugin-extensions/src/extensions/ApiExtension.ts @@ -1,11 +1,11 @@ import { AbstractExtension } from "./AbstractExtension"; import path from "path"; import { EXTENSIONS_ROOT_FOLDER } from "~/utils/constants"; -import chalk from "chalk"; import { ArrayLiteralExpression, Node, Project } from "ts-morph"; import { formatCode } from "@webiny/cli-plugin-scaffold/utils"; import { updateDependencies, updateWorkspaces } from "~/utils"; import Case from "case"; +import { ExtensionMessage } from "~/types"; export class ApiExtension extends AbstractExtension { async link() { @@ -20,21 +20,22 @@ export class ApiExtension extends AbstractExtension { await updateWorkspaces(this.params.location); } - getNextSteps(): string[] { + getNextSteps(): ExtensionMessage[] { let { location: extensionsFolderPath } = this.params; if (!extensionsFolderPath) { extensionsFolderPath = `${EXTENSIONS_ROOT_FOLDER}/${this.params.name}`; } const watchCommand = `yarn webiny watch api --env dev`; - const indexTsxFilePath = `${extensionsFolderPath}/src/index.ts`; + const indexTsFilePath = `${extensionsFolderPath}/src/index.ts`; return [ - `run ${chalk.green(watchCommand)} to start local development`, - `open ${chalk.green(indexTsxFilePath)} and start coding`, - `to install additional dependencies, run ${chalk.green( - `yarn workspace ${this.params.packageName} add ` - )}` + { text: `run %s to start local development`, variables: [watchCommand] }, + { text: `open %s and start coding`, variables: [indexTsFilePath] }, + { + text: `to install additional dependencies, run %s`, + variables: [`yarn workspace ${this.params.packageName} add `] + } ]; } diff --git a/packages/cli-plugin-extensions/src/extensions/Extension.ts b/packages/cli-plugin-extensions/src/extensions/Extension.ts index 3beba7b8c85..76e8fd4dc52 100644 --- a/packages/cli-plugin-extensions/src/extensions/Extension.ts +++ b/packages/cli-plugin-extensions/src/extensions/Extension.ts @@ -7,6 +7,7 @@ import loadJson from "load-json-file"; import { PackageJson } from "@webiny/cli-plugin-scaffold/types"; import path from "path"; import { WebsiteExtension } from "~/extensions/WebsiteExtension"; +import { ExtensionMessage } from "~/types"; type PackageJsonPath = string; @@ -47,7 +48,7 @@ export class Extension extends AbstractExtension { await this.extension.link(); } - getNextSteps(): string[] { + getNextSteps(): ExtensionMessage[] { return this.extension.getNextSteps(); } diff --git a/packages/cli-plugin-extensions/src/extensions/PbElementExtension.ts b/packages/cli-plugin-extensions/src/extensions/PbElementExtension.ts index c49767a149c..6b768e82341 100644 --- a/packages/cli-plugin-extensions/src/extensions/PbElementExtension.ts +++ b/packages/cli-plugin-extensions/src/extensions/PbElementExtension.ts @@ -1,11 +1,11 @@ import { AbstractExtension } from "./AbstractExtension"; import path from "path"; import { EXTENSIONS_ROOT_FOLDER } from "~/utils/constants"; -import chalk from "chalk"; import { JsxFragment, Node, Project } from "ts-morph"; import { formatCode } from "@webiny/cli-plugin-scaffold/utils"; import { updateDependencies, updateWorkspaces } from "~/utils"; import Case from "case"; +import { ExtensionMessage } from "~/types"; export class PbElementExtension extends AbstractExtension { async link() { @@ -25,7 +25,7 @@ export class PbElementExtension extends AbstractExtension { await updateWorkspaces(this.params.location); } - getNextSteps(): string[] { + getNextSteps(): ExtensionMessage[] { let { location: extensionsFolderPath } = this.params; if (!extensionsFolderPath) { extensionsFolderPath = `${EXTENSIONS_ROOT_FOLDER}/${this.params.name}`; @@ -36,13 +36,15 @@ export class PbElementExtension extends AbstractExtension { const indexTsxFilePath = `${extensionsFolderPath}/src/index.tsx`; return [ - [ - `run the following commands to start local development:`, - ` ∙ ${chalk.green(watchCommandAdmin)}`, - ` ∙ ${chalk.green(watchCommandWebsite)}` - ].join("\n"), - - `open ${chalk.green(indexTsxFilePath)} and start coding` + { + text: [ + `run the following commands to start local development:`, + ` ∙ %s`, + ` ∙ %s` + ].join("\n"), + variables: [watchCommandAdmin, watchCommandWebsite] + }, + { text: `open %s and start coding`, variables: [indexTsxFilePath] } ]; } diff --git a/packages/cli-plugin-extensions/src/extensions/WebsiteExtension.ts b/packages/cli-plugin-extensions/src/extensions/WebsiteExtension.ts index 875d29f010f..12b8fd0d8ca 100644 --- a/packages/cli-plugin-extensions/src/extensions/WebsiteExtension.ts +++ b/packages/cli-plugin-extensions/src/extensions/WebsiteExtension.ts @@ -1,11 +1,11 @@ import { AbstractExtension } from "./AbstractExtension"; import path from "path"; import { EXTENSIONS_ROOT_FOLDER } from "~/utils/constants"; -import chalk from "chalk"; import { JsxFragment, Node, Project } from "ts-morph"; import { formatCode } from "@webiny/cli-plugin-scaffold/utils"; import { updateDependencies, updateWorkspaces } from "~/utils"; import Case from "case"; +import { ExtensionMessage } from "~/types"; export class WebsiteExtension extends AbstractExtension { async link() { @@ -20,7 +20,7 @@ export class WebsiteExtension extends AbstractExtension { await updateWorkspaces(this.params.location); } - getNextSteps(): string[] { + getNextSteps(): ExtensionMessage[] { let { location: extensionsFolderPath } = this.params; if (!extensionsFolderPath) { extensionsFolderPath = `${EXTENSIONS_ROOT_FOLDER}/${this.params.name}`; @@ -30,11 +30,12 @@ export class WebsiteExtension extends AbstractExtension { const indexTsxFilePath = `${extensionsFolderPath}/src/index.tsx`; return [ - `run ${chalk.green(watchCommand)} to start a new local development session`, - `open ${chalk.green(indexTsxFilePath)} and start coding`, - `to install additional dependencies, run ${chalk.green( - `yarn workspace ${this.params.packageName} add ` - )}` + { text: `run %s to start local development`, variables: [watchCommand] }, + { text: `open %s and start coding`, variables: [indexTsxFilePath] }, + { + text: `to install additional dependencies, run %s`, + variables: [`yarn workspace ${this.params.packageName} add `] + } ]; } diff --git a/packages/cli-plugin-extensions/src/extensions/WorkspaceExtension.ts b/packages/cli-plugin-extensions/src/extensions/WorkspaceExtension.ts index 954fd8a58e5..7eb129bf61f 100644 --- a/packages/cli-plugin-extensions/src/extensions/WorkspaceExtension.ts +++ b/packages/cli-plugin-extensions/src/extensions/WorkspaceExtension.ts @@ -1,12 +1,13 @@ import { AbstractExtension } from "./AbstractExtension"; import { updateWorkspaces } from "~/utils"; +import { ExtensionMessage } from "~/types"; export class WorkspaceExtension extends AbstractExtension { async link() { await updateWorkspaces(this.params.location); } - getNextSteps(): string[] { + getNextSteps(): ExtensionMessage[] { return []; } } diff --git a/packages/cli-plugin-extensions/src/generateExtension.ts b/packages/cli-plugin-extensions/src/generateExtension.ts index 55ece0fe8a3..35b5a9fa9c0 100644 --- a/packages/cli-plugin-extensions/src/generateExtension.ts +++ b/packages/cli-plugin-extensions/src/generateExtension.ts @@ -162,7 +162,7 @@ export const generateExtension = async ({ input, ora, context }: GenerateExtensi console.log(); console.log(chalk.bold("Additional Notes")); console.log( - `‣ note that if you already have the ${context.success.hl( + `‣ if you already have the ${context.success.hl( "webiny watch" )} command running, you'll need to restart it` ); diff --git a/packages/cli-plugin-extensions/src/types.ts b/packages/cli-plugin-extensions/src/types.ts index 9d76afc39f3..911021ef7e7 100644 --- a/packages/cli-plugin-extensions/src/types.ts +++ b/packages/cli-plugin-extensions/src/types.ts @@ -16,3 +16,19 @@ export type ExtensionsCommandParams = | ExtensionCommandDownloadFromParams | ExtensionCommandGenerateParams | ExtensionCommandNoParams; + +export interface ExtensionMessage { + text: string; + variables?: string[]; +} + +export type ExtensionJson = Partial<{ + nextSteps: { + clearExisting: boolean; + messages: ExtensionMessage[]; + }; + additionalNotes: { + clearExisting?: boolean; + messages: ExtensionMessage[]; + }; +}>; diff --git a/packages/cwp-template-aws/template/common/apps/admin/src/Extensions.tsx b/packages/cwp-template-aws/template/common/apps/admin/src/Extensions.tsx index 00cd662531a..cf289007f7f 100644 --- a/packages/cwp-template-aws/template/common/apps/admin/src/Extensions.tsx +++ b/packages/cwp-template-aws/template/common/apps/admin/src/Extensions.tsx @@ -1,4 +1,5 @@ // This file is automatically updated via scaffolding utilities. +// Learn more about extensions: https://webiny.link/extensions import React from "react"; export const Extensions = () => { diff --git a/packages/cwp-template-aws/template/common/apps/website/src/Extensions.tsx b/packages/cwp-template-aws/template/common/apps/website/src/Extensions.tsx index 00cd662531a..cf289007f7f 100644 --- a/packages/cwp-template-aws/template/common/apps/website/src/Extensions.tsx +++ b/packages/cwp-template-aws/template/common/apps/website/src/Extensions.tsx @@ -1,4 +1,5 @@ // This file is automatically updated via scaffolding utilities. +// Learn more about extensions: https://webiny.link/extensions import React from "react"; export const Extensions = () => { diff --git a/packages/cwp-template-aws/template/ddb-es/apps/api/graphql/package.json b/packages/cwp-template-aws/template/ddb-es/apps/api/graphql/package.json index 525154247ab..61806c4f23d 100644 --- a/packages/cwp-template-aws/template/ddb-es/apps/api/graphql/package.json +++ b/packages/cwp-template-aws/template/ddb-es/apps/api/graphql/package.json @@ -18,7 +18,6 @@ "@webiny/api-form-builder-so-ddb-es": "latest", "@webiny/api-i18n": "latest", "@webiny/api-i18n-ddb": "latest", - "@webiny/api-i18n-content": "latest", "@webiny/api-headless-cms": "latest", "@webiny/api-headless-cms-aco": "latest", "@webiny/api-headless-cms-ddb-es": "latest", @@ -31,7 +30,7 @@ "@webiny/api-page-builder-import-export": "latest", "@webiny/api-page-builder-import-export-so-ddb": "latest", "@webiny/api-elasticsearch": "latest", - "@webiny/api-prerendering-service": "latest", + "@webiny/api-prerendering-service-aws": "latest", "@webiny/api-security": "latest", "@webiny/api-security-so-ddb": "latest", "@webiny/api-security-cognito": "latest", diff --git a/packages/cwp-template-aws/template/ddb-es/apps/api/graphql/src/extensions.ts b/packages/cwp-template-aws/template/ddb-es/apps/api/graphql/src/extensions.ts index 658b605320b..8fe26e9ecfd 100644 --- a/packages/cwp-template-aws/template/ddb-es/apps/api/graphql/src/extensions.ts +++ b/packages/cwp-template-aws/template/ddb-es/apps/api/graphql/src/extensions.ts @@ -1,4 +1,5 @@ // This file is automatically updated via scaffolding utilities. +// Learn more about extensions: https://webiny.link/extensions export const extensions = () => { return []; }; diff --git a/packages/cwp-template-aws/template/ddb-es/apps/api/graphql/src/types.ts b/packages/cwp-template-aws/template/ddb-es/apps/api/graphql/src/types.ts deleted file mode 100644 index 43ecee27cb5..00000000000 --- a/packages/cwp-template-aws/template/ddb-es/apps/api/graphql/src/types.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { ClientContext } from "@webiny/handler-client/types"; -import { ElasticsearchContext } from "@webiny/api-elasticsearch/types"; -import { TenancyContext } from "@webiny/api-tenancy/types"; -import { SecurityContext } from "@webiny/api-security/types"; -import { I18NContext } from "@webiny/api-i18n/types"; -import { I18NContentContext } from "@webiny/api-i18n-content/types"; -import { PbContext } from "@webiny/api-page-builder/graphql/types"; -import { PrerenderingServiceClientContext } from "@webiny/api-prerendering-service/client/types"; -import { FileManagerContext } from "@webiny/api-file-manager/types"; -import { FormBuilderContext } from "@webiny/api-form-builder/types"; -import { CmsContext } from "@webiny/api-headless-cms/types"; -import { AcoContext } from "@webiny/api-aco/types"; -import { PbAcoContext } from "@webiny/api-page-builder-aco/types"; -import { HcmsAcoContext } from "@webiny/api-headless-cms-aco/types"; -import { HcmsTasksContext } from "@webiny/api-headless-cms-tasks-ddb-es/types"; - -// When working with the `context` object (for example while defining a new GraphQL resolver function), -// you can import this interface and assign it to it. This will give you full autocomplete functionality -// and type safety. The easiest way to import it would be via the following import statement: -// import { Context } from "~/types"; -// Feel free to extend it with additional context interfaces, if needed. Also, please do not change the -// name of the interface, as existing scaffolding utilities may rely on it during the scaffolding process. -export interface Context - extends ClientContext, - ElasticsearchContext, - TenancyContext, - SecurityContext, - I18NContext, - I18NContentContext, - PbContext, - PrerenderingServiceClientContext, - FileManagerContext, - FormBuilderContext, - AcoContext, - PbAcoContext, - HcmsAcoContext, - HcmsTasksContext, - CmsContext {} diff --git a/packages/cwp-template-aws/template/ddb-os/apps/api/graphql/package.json b/packages/cwp-template-aws/template/ddb-os/apps/api/graphql/package.json index 6cbf29f1ba4..2f9d74bca80 100644 --- a/packages/cwp-template-aws/template/ddb-os/apps/api/graphql/package.json +++ b/packages/cwp-template-aws/template/ddb-os/apps/api/graphql/package.json @@ -18,7 +18,6 @@ "@webiny/api-form-builder-so-ddb-es": "latest", "@webiny/api-i18n": "latest", "@webiny/api-i18n-ddb": "latest", - "@webiny/api-i18n-content": "latest", "@webiny/api-headless-cms": "latest", "@webiny/api-headless-cms-aco": "latest", "@webiny/api-headless-cms-ddb-es": "latest", @@ -31,7 +30,7 @@ "@webiny/api-page-builder-import-export": "latest", "@webiny/api-page-builder-import-export-so-ddb": "latest", "@webiny/api-elasticsearch": "latest", - "@webiny/api-prerendering-service": "latest", + "@webiny/api-prerendering-service-aws": "latest", "@webiny/api-security": "latest", "@webiny/api-security-so-ddb": "latest", "@webiny/api-security-cognito": "latest", diff --git a/packages/cwp-template-aws/template/ddb-os/apps/api/graphql/src/extensions.ts b/packages/cwp-template-aws/template/ddb-os/apps/api/graphql/src/extensions.ts index 658b605320b..8fe26e9ecfd 100644 --- a/packages/cwp-template-aws/template/ddb-os/apps/api/graphql/src/extensions.ts +++ b/packages/cwp-template-aws/template/ddb-os/apps/api/graphql/src/extensions.ts @@ -1,4 +1,5 @@ // This file is automatically updated via scaffolding utilities. +// Learn more about extensions: https://webiny.link/extensions export const extensions = () => { return []; }; diff --git a/packages/cwp-template-aws/template/ddb-os/apps/api/graphql/src/types.ts b/packages/cwp-template-aws/template/ddb-os/apps/api/graphql/src/types.ts deleted file mode 100644 index 43ecee27cb5..00000000000 --- a/packages/cwp-template-aws/template/ddb-os/apps/api/graphql/src/types.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { ClientContext } from "@webiny/handler-client/types"; -import { ElasticsearchContext } from "@webiny/api-elasticsearch/types"; -import { TenancyContext } from "@webiny/api-tenancy/types"; -import { SecurityContext } from "@webiny/api-security/types"; -import { I18NContext } from "@webiny/api-i18n/types"; -import { I18NContentContext } from "@webiny/api-i18n-content/types"; -import { PbContext } from "@webiny/api-page-builder/graphql/types"; -import { PrerenderingServiceClientContext } from "@webiny/api-prerendering-service/client/types"; -import { FileManagerContext } from "@webiny/api-file-manager/types"; -import { FormBuilderContext } from "@webiny/api-form-builder/types"; -import { CmsContext } from "@webiny/api-headless-cms/types"; -import { AcoContext } from "@webiny/api-aco/types"; -import { PbAcoContext } from "@webiny/api-page-builder-aco/types"; -import { HcmsAcoContext } from "@webiny/api-headless-cms-aco/types"; -import { HcmsTasksContext } from "@webiny/api-headless-cms-tasks-ddb-es/types"; - -// When working with the `context` object (for example while defining a new GraphQL resolver function), -// you can import this interface and assign it to it. This will give you full autocomplete functionality -// and type safety. The easiest way to import it would be via the following import statement: -// import { Context } from "~/types"; -// Feel free to extend it with additional context interfaces, if needed. Also, please do not change the -// name of the interface, as existing scaffolding utilities may rely on it during the scaffolding process. -export interface Context - extends ClientContext, - ElasticsearchContext, - TenancyContext, - SecurityContext, - I18NContext, - I18NContentContext, - PbContext, - PrerenderingServiceClientContext, - FileManagerContext, - FormBuilderContext, - AcoContext, - PbAcoContext, - HcmsAcoContext, - HcmsTasksContext, - CmsContext {} diff --git a/packages/cwp-template-aws/template/ddb/apps/api/graphql/package.json b/packages/cwp-template-aws/template/ddb/apps/api/graphql/package.json index e6a55c33772..143b908d591 100644 --- a/packages/cwp-template-aws/template/ddb/apps/api/graphql/package.json +++ b/packages/cwp-template-aws/template/ddb/apps/api/graphql/package.json @@ -18,7 +18,6 @@ "@webiny/api-form-builder-so-ddb": "latest", "@webiny/api-i18n": "latest", "@webiny/api-i18n-ddb": "latest", - "@webiny/api-i18n-content": "latest", "@webiny/api-headless-cms": "latest", "@webiny/api-headless-cms-aco": "latest", "@webiny/api-headless-cms-ddb": "latest", @@ -30,7 +29,7 @@ "@webiny/api-page-builder-so-ddb": "latest", "@webiny/api-page-builder-import-export": "latest", "@webiny/api-page-builder-import-export-so-ddb": "latest", - "@webiny/api-prerendering-service": "latest", + "@webiny/api-prerendering-service-aws": "latest", "@webiny/api-security": "latest", "@webiny/api-security-cognito": "latest", "@webiny/api-security-so-ddb": "latest", diff --git a/packages/cwp-template-aws/template/ddb/apps/api/graphql/src/extensions.ts b/packages/cwp-template-aws/template/ddb/apps/api/graphql/src/extensions.ts index 658b605320b..8fe26e9ecfd 100644 --- a/packages/cwp-template-aws/template/ddb/apps/api/graphql/src/extensions.ts +++ b/packages/cwp-template-aws/template/ddb/apps/api/graphql/src/extensions.ts @@ -1,4 +1,5 @@ // This file is automatically updated via scaffolding utilities. +// Learn more about extensions: https://webiny.link/extensions export const extensions = () => { return []; }; diff --git a/packages/cwp-template-aws/template/ddb/apps/api/graphql/src/types.ts b/packages/cwp-template-aws/template/ddb/apps/api/graphql/src/types.ts deleted file mode 100644 index f709473687e..00000000000 --- a/packages/cwp-template-aws/template/ddb/apps/api/graphql/src/types.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { ClientContext } from "@webiny/handler-client/types"; -import { TenancyContext } from "@webiny/api-tenancy/types"; -import { SecurityContext } from "@webiny/api-security/types"; -import { I18NContext } from "@webiny/api-i18n/types"; -import { I18NContentContext } from "@webiny/api-i18n-content/types"; -import { PbContext } from "@webiny/api-page-builder/graphql/types"; -import { PrerenderingServiceClientContext } from "@webiny/api-prerendering-service/client/types"; -import { FileManagerContext } from "@webiny/api-file-manager/types"; -import { FormBuilderContext } from "@webiny/api-form-builder/types"; -import { CmsContext } from "@webiny/api-headless-cms/types"; -import { AcoContext } from "@webiny/api-aco/types"; -import { PbAcoContext } from "@webiny/api-page-builder-aco/types"; -import { HcmsAcoContext } from "@webiny/api-headless-cms-aco/types"; -import { HcmsTasksContext } from "@webiny/api-headless-cms-tasks/types"; - -// When working with the `context` object (for example while defining a new GraphQL resolver function), -// you can import this interface and assign it to it. This will give you full autocomplete functionality -// and type safety. The easiest way to import it would be via the following import statement: -// import { Context } from "~/types"; -// Feel free to extend it with additional context interfaces, if needed. Also, please do not change the -// name of the interface, as existing scaffolding utilities may rely on it during the scaffolding process. -export interface Context - extends ClientContext, - TenancyContext, - SecurityContext, - I18NContext, - I18NContentContext, - PbContext, - PrerenderingServiceClientContext, - FileManagerContext, - FormBuilderContext, - AcoContext, - PbAcoContext, - HcmsAcoContext, - HcmsTasksContext, - CmsContext {} diff --git a/yarn.lock b/yarn.lock index 19c5d14d2cb..1573391c037 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13521,7 +13521,7 @@ __metadata: languageName: unknown linkType: soft -"@webiny/api-serverless-cms@workspace:packages/api-serverless-cms": +"@webiny/api-serverless-cms@npm:0.0.0, @webiny/api-serverless-cms@workspace:packages/api-serverless-cms": version: 0.0.0-use.local resolution: "@webiny/api-serverless-cms@workspace:packages/api-serverless-cms" dependencies: @@ -17222,7 +17222,6 @@ __metadata: "@webiny/api-headless-cms-ddb": "npm:0.0.0" "@webiny/api-headless-cms-tasks": "npm:0.0.0" "@webiny/api-i18n": "npm:0.0.0" - "@webiny/api-i18n-content": "npm:0.0.0" "@webiny/api-i18n-ddb": "npm:0.0.0" "@webiny/api-log": "npm:0.0.0" "@webiny/api-page-builder": "npm:0.0.0" @@ -17230,12 +17229,12 @@ __metadata: "@webiny/api-page-builder-import-export": "npm:0.0.0" "@webiny/api-page-builder-import-export-so-ddb": "npm:0.0.0" "@webiny/api-page-builder-so-ddb": "npm:0.0.0" - "@webiny/api-prerendering-service": "npm:0.0.0" "@webiny/api-prerendering-service-aws": "npm:0.0.0" "@webiny/api-record-locking": "npm:0.0.0" "@webiny/api-security": "npm:0.0.0" "@webiny/api-security-cognito": "npm:0.0.0" "@webiny/api-security-so-ddb": "npm:0.0.0" + "@webiny/api-serverless-cms": "npm:0.0.0" "@webiny/api-tenancy": "npm:0.0.0" "@webiny/api-tenancy-so-ddb": "npm:0.0.0" "@webiny/api-tenant-manager": "npm:0.0.0"