diff --git a/packages/teleport-plugin-css-modules/src/index.ts b/packages/teleport-plugin-css-modules/src/index.ts index 40d4367db..ddbca0798 100644 --- a/packages/teleport-plugin-css-modules/src/index.ts +++ b/packages/teleport-plugin-css-modules/src/index.ts @@ -259,7 +259,7 @@ export const createCSSModulesPlugin: ComponentPluginFactory = const referedStyle = globalStyleSheet[content.referenceId] if (!referedStyle) { throw new PluginCssModules( - `Style used from global stylesheet is missing - ${content.referenceId}` + `Style used from global stylesheet is missing plugin css module - ${content.referenceId}` ) } classNamesToAppend.add( diff --git a/packages/teleport-plugin-react-jss/src/index.ts b/packages/teleport-plugin-react-jss/src/index.ts index 7f87c2d16..ab02127d4 100644 --- a/packages/teleport-plugin-react-jss/src/index.ts +++ b/packages/teleport-plugin-react-jss/src/index.ts @@ -222,7 +222,7 @@ export const createReactJSSPlugin: ComponentPluginFactory = (config) const referedStyle = projectStyleSet.styleSetDefinitions[content.referenceId] if (!referedStyle) { throw new PluginReactJSS( - `Style used from global stylesheet is missing - ${content.referenceId}` + `Style used from global stylesheet is missing plugin react jss - ${content.referenceId}` ) } diff --git a/packages/teleport-project-plugin-i18n-files/src/index.ts b/packages/teleport-project-plugin-i18n-files/src/index.ts index f94458355..ed5797cb0 100644 --- a/packages/teleport-project-plugin-i18n-files/src/index.ts +++ b/packages/teleport-project-plugin-i18n-files/src/index.ts @@ -7,6 +7,7 @@ import { ProjectPluginStructure, ProjectType, UIDLElementNode, + UIDLStyleSetDefinition, } from '@teleporthq/teleport-types' import { createJSXSyntax, @@ -28,7 +29,10 @@ export class ProjectPlugini18nFiles implements ProjectPlugin { this.resolver = new Resolver(ReactMapping) } - async generateJSX(node: UIDLElementNode): Promise<{ html: string; css?: string }> { + async generateJSX( + node: UIDLElementNode, + projectStyleSet: Record + ): Promise<{ html: string; css?: string }> { const proxyUIDL: ComponentUIDL = { name: 'locale-node', node, @@ -73,7 +77,9 @@ export class ProjectPlugini18nFiles implements ProjectPlugin { }, ], dependencies: {}, - options: {}, + options: { + projectStyleSet: { styleSetDefinitions: projectStyleSet, fileName: '', path: '' }, + }, } const result = await createCSSPlugin({ @@ -113,7 +119,7 @@ export class ProjectPlugini18nFiles implements ProjectPlugin { if (item?.type === 'element') { promises.push( new Promise((resolve) => { - this.generateJSX(item).then(({ html, css }) => { + this.generateJSX(item, uidl.root.styleSetDefinitions).then(({ html, css }) => { resolve({ [id]: css ? `${html} \n ` : html }) }) })