@embeddable.com/sdk-core 4.3.0-next.0 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/generate.d.ts +2 -0
- package/lib/index.esm.js +6 -2
- package/lib/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/generate.test.ts +87 -1
- package/src/generate.ts +14 -10
package/lib/generate.d.ts
CHANGED
|
@@ -30,3 +30,5 @@ export default _default;
|
|
|
30
30
|
* - Always creates a fresh sys (never reuses ctx.dev?.sys) to avoid watcher interference
|
|
31
31
|
*/
|
|
32
32
|
export declare function generateDTS(ctx: ResolvedEmbeddableConfig): Promise<void>;
|
|
33
|
+
export declare function injectCSS(ctx: ResolvedEmbeddableConfig, pluginName: PluginName): Promise<void>;
|
|
34
|
+
export declare function injectBundleRender(ctx: ResolvedEmbeddableConfig, pluginName: PluginName): Promise<void>;
|
package/lib/index.esm.js
CHANGED
|
@@ -678,7 +678,9 @@ async function generateDTS(ctx) {
|
|
|
678
678
|
async function injectCSS(ctx, pluginName) {
|
|
679
679
|
const CUSTOMER_BUILD = path$1.resolve(ctx.client.buildDir, ctx[pluginName].outputOptions.buildName);
|
|
680
680
|
const allFiles = await fs.readdir(CUSTOMER_BUILD);
|
|
681
|
-
const importFilePath = path$1
|
|
681
|
+
const importFilePath = path$1
|
|
682
|
+
.relative(ctx.client.componentDir, path$1.resolve(ctx.client.buildDir, ctx[pluginName].outputOptions.buildName))
|
|
683
|
+
.replaceAll("\\", "/");
|
|
682
684
|
const imports = allFiles
|
|
683
685
|
.filter((fileName) => fileName.endsWith(".css"))
|
|
684
686
|
.map((fileName) => `@import '${importFilePath}/${fileName}';`);
|
|
@@ -696,7 +698,9 @@ async function injectCSS(ctx, pluginName) {
|
|
|
696
698
|
}
|
|
697
699
|
async function injectBundleRender(ctx, pluginName) {
|
|
698
700
|
var _a;
|
|
699
|
-
const importFilePath = path$1
|
|
701
|
+
const importFilePath = path$1
|
|
702
|
+
.relative(ctx.client.componentDir, path$1.resolve(ctx.client.buildDir, ctx[pluginName].outputOptions.buildName))
|
|
703
|
+
.replaceAll("\\", "/");
|
|
700
704
|
const importStr = `import render from '${importFilePath}/${ctx[pluginName].outputOptions.fileName}';`;
|
|
701
705
|
let content = await fs.readFile(path$1.resolve(ctx.core.templatesDir, "component.tsx.template"), "utf8");
|
|
702
706
|
if (!!((_a = ctx.dev) === null || _a === void 0 ? void 0 : _a.watch)) {
|