@webiny/website-builder-nextjs 6.0.0-alpha.2 → 6.0.0-alpha.4
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/index.d.ts +0 -1
- package/index.js +0 -1
- package/index.js.map +1 -1
- package/package.json +13 -11
- package/webpack.d.ts +7 -0
- package/webpack.js +56 -0
- package/webpack.js.map +1 -0
- package/CssInliner.d.ts +0 -6
- package/CssInliner.js +0 -70
- package/CssInliner.js.map +0 -1
- package/useCss.d.ts +0 -1
- package/useCss.js +0 -13
- package/useCss.js.map +0 -1
package/index.d.ts
CHANGED
package/index.js
CHANGED
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["setHeadersProvider","headers"],"sources":["index.ts"],"sourcesContent":["export * from \"@webiny/website-builder-react\";\
|
|
1
|
+
{"version":3,"names":["setHeadersProvider","headers"],"sources":["index.ts"],"sourcesContent":["export * from \"@webiny/website-builder-react\";\n\nimport { setHeadersProvider } from \"@webiny/website-builder-react\";\n\nsetHeadersProvider(async () => {\n // Settings @ts-expect-error breaks the build if the dependency is installed in the repo.\n // @ts-ignore This is a peer dependency.\n const { headers } = await import(\"next/headers\");\n return await headers();\n});\n"],"mappings":"AAAA,cAAc,+BAA+B;AAE7C,SAASA,kBAAkB,QAAQ,+BAA+B;AAElEA,kBAAkB,CAAC,YAAY;EAC3B;EACA;EACA,MAAM;IAAEC;EAAQ,CAAC,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC;EAChD,OAAO,MAAMA,OAAO,CAAC,CAAC;AAC1B,CAAC,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/website-builder-nextjs",
|
|
3
|
-
"version": "6.0.0-alpha.
|
|
3
|
+
"version": "6.0.0-alpha.4",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/webiny/webiny-js.git"
|
|
8
8
|
},
|
|
9
9
|
"exports": {
|
|
10
|
-
".": "./index.js"
|
|
10
|
+
".": "./index.js",
|
|
11
|
+
"./webpack": "./webpack.js"
|
|
11
12
|
},
|
|
12
13
|
"description": "A Next.js integration SDK for Webiny Website Builder.",
|
|
13
14
|
"contributors": [
|
|
@@ -17,15 +18,16 @@
|
|
|
17
18
|
],
|
|
18
19
|
"license": "MIT",
|
|
19
20
|
"dependencies": {
|
|
20
|
-
"@webiny/website-builder-react": "6.0.0-alpha.
|
|
21
|
-
"postcss": "8.5.6"
|
|
22
|
-
|
|
23
|
-
"peerDependencies": {
|
|
24
|
-
"next": "^15"
|
|
21
|
+
"@webiny/website-builder-react": "6.0.0-alpha.4",
|
|
22
|
+
"postcss": "8.5.6",
|
|
23
|
+
"postcss-import": "16.1.1"
|
|
25
24
|
},
|
|
26
25
|
"devDependencies": {
|
|
27
|
-
"@
|
|
28
|
-
"
|
|
26
|
+
"@types/postcss-import": "14.0.3",
|
|
27
|
+
"@webiny/project-utils": "6.0.0-alpha.4",
|
|
28
|
+
"next": "15.4.6",
|
|
29
|
+
"typescript": "5.3.3",
|
|
30
|
+
"webpack": "5.101.1"
|
|
29
31
|
},
|
|
30
32
|
"publishConfig": {
|
|
31
33
|
"access": "public",
|
|
@@ -39,10 +41,10 @@
|
|
|
39
41
|
"ignore": {
|
|
40
42
|
"dependencies": [
|
|
41
43
|
"postcss",
|
|
42
|
-
"
|
|
44
|
+
"postcss-import",
|
|
43
45
|
"@webiny/website-builder-react"
|
|
44
46
|
]
|
|
45
47
|
}
|
|
46
48
|
},
|
|
47
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "eb196ccd2f32296e10f7add6dd7220d4e3abece4"
|
|
48
50
|
}
|
package/webpack.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { WebpackPluginInstance } from "webpack";
|
|
2
|
+
import type { NextConfig } from "next";
|
|
3
|
+
type WebpackConfigContext = Parameters<NonNullable<NextConfig["webpack"]>>[1];
|
|
4
|
+
export declare const injectThemeCss: (entry: string, variableName?: string) => Promise<{
|
|
5
|
+
getPlugins: (context: WebpackConfigContext) => WebpackPluginInstance[];
|
|
6
|
+
}>;
|
|
7
|
+
export {};
|
package/webpack.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import postcss from "postcss";
|
|
3
|
+
import postcssImport from "postcss-import";
|
|
4
|
+
|
|
5
|
+
// We're inferring the type from Next's config type.
|
|
6
|
+
|
|
7
|
+
const buildThemeCss = async entry => {
|
|
8
|
+
// Read CSS entry file.
|
|
9
|
+
const raw = fs.readFileSync(entry, "utf8");
|
|
10
|
+
|
|
11
|
+
// Inline local imports.
|
|
12
|
+
const result = await postcss([postcssImport()]).process(raw, {
|
|
13
|
+
from: entry
|
|
14
|
+
});
|
|
15
|
+
return result.css;
|
|
16
|
+
};
|
|
17
|
+
export const injectThemeCss = async (entry, variableName) => {
|
|
18
|
+
const defineKey = variableName ?? "__THEME_CSS__";
|
|
19
|
+
const initialCss = await buildThemeCss(entry);
|
|
20
|
+
|
|
21
|
+
// Inject as a global constant available in your app.
|
|
22
|
+
let definePlugin;
|
|
23
|
+
const getPlugins = context => {
|
|
24
|
+
const {
|
|
25
|
+
dev,
|
|
26
|
+
webpack
|
|
27
|
+
} = context;
|
|
28
|
+
if (!definePlugin) {
|
|
29
|
+
definePlugin = new webpack.DefinePlugin({
|
|
30
|
+
[defineKey]: JSON.stringify(initialCss)
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
const plugins = [definePlugin];
|
|
34
|
+
if (dev) {
|
|
35
|
+
// Watch for changes and update plugin definitions
|
|
36
|
+
plugins.push({
|
|
37
|
+
apply(compiler) {
|
|
38
|
+
compiler.hooks.afterCompile.tapPromise("WatchThemeCss", async compilation => {
|
|
39
|
+
compilation.fileDependencies.add(entry);
|
|
40
|
+
});
|
|
41
|
+
compiler.hooks.beforeCompile.tapPromise("UpdateThemeCss", async () => {
|
|
42
|
+
const cssValue = await buildThemeCss(entry);
|
|
43
|
+
// Update the definitions on our specific plugin
|
|
44
|
+
definePlugin.definitions[defineKey] = JSON.stringify(cssValue);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return plugins;
|
|
50
|
+
};
|
|
51
|
+
return {
|
|
52
|
+
getPlugins
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=webpack.js.map
|
package/webpack.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["fs","postcss","postcssImport","buildThemeCss","entry","raw","readFileSync","result","process","from","css","injectThemeCss","variableName","defineKey","initialCss","definePlugin","getPlugins","context","dev","webpack","DefinePlugin","JSON","stringify","plugins","push","apply","compiler","hooks","afterCompile","tapPromise","compilation","fileDependencies","add","beforeCompile","cssValue","definitions"],"sources":["webpack.ts"],"sourcesContent":["import fs from \"fs\";\nimport type { WebpackPluginInstance } from \"webpack\";\nimport postcss from \"postcss\";\nimport postcssImport from \"postcss-import\";\nimport type { NextConfig } from \"next\";\n\n// We're inferring the type from Next's config type.\ntype WebpackConfigContext = Parameters<NonNullable<NextConfig[\"webpack\"]>>[1];\n\nconst buildThemeCss = async (entry: string) => {\n // Read CSS entry file.\n const raw = fs.readFileSync(entry, \"utf8\");\n\n // Inline local imports.\n const result = await postcss([postcssImport()]).process(raw, { from: entry });\n\n return result.css;\n};\n\nexport const injectThemeCss = async (entry: string, variableName?: string) => {\n const defineKey = variableName ?? \"__THEME_CSS__\";\n\n const initialCss = await buildThemeCss(entry);\n\n // Inject as a global constant available in your app.\n let definePlugin: WebpackPluginInstance;\n\n const getPlugins = (context: WebpackConfigContext) => {\n const { dev, webpack } = context;\n\n if (!definePlugin) {\n definePlugin = new webpack.DefinePlugin({ [defineKey]: JSON.stringify(initialCss) });\n }\n\n const plugins: WebpackPluginInstance[] = [definePlugin];\n\n if (dev) {\n // Watch for changes and update plugin definitions\n plugins.push({\n apply(compiler) {\n compiler.hooks.afterCompile.tapPromise(\"WatchThemeCss\", async compilation => {\n compilation.fileDependencies.add(entry);\n });\n\n compiler.hooks.beforeCompile.tapPromise(\"UpdateThemeCss\", async () => {\n const cssValue = await buildThemeCss(entry);\n // Update the definitions on our specific plugin\n definePlugin.definitions[defineKey] = JSON.stringify(cssValue);\n });\n }\n });\n }\n\n return plugins;\n };\n\n return { getPlugins };\n};\n"],"mappings":"AAAA,OAAOA,EAAE,MAAM,IAAI;AAEnB,OAAOC,OAAO,MAAM,SAAS;AAC7B,OAAOC,aAAa,MAAM,gBAAgB;;AAG1C;;AAGA,MAAMC,aAAa,GAAG,MAAOC,KAAa,IAAK;EAC3C;EACA,MAAMC,GAAG,GAAGL,EAAE,CAACM,YAAY,CAACF,KAAK,EAAE,MAAM,CAAC;;EAE1C;EACA,MAAMG,MAAM,GAAG,MAAMN,OAAO,CAAC,CAACC,aAAa,CAAC,CAAC,CAAC,CAAC,CAACM,OAAO,CAACH,GAAG,EAAE;IAAEI,IAAI,EAAEL;EAAM,CAAC,CAAC;EAE7E,OAAOG,MAAM,CAACG,GAAG;AACrB,CAAC;AAED,OAAO,MAAMC,cAAc,GAAG,MAAAA,CAAOP,KAAa,EAAEQ,YAAqB,KAAK;EAC1E,MAAMC,SAAS,GAAGD,YAAY,IAAI,eAAe;EAEjD,MAAME,UAAU,GAAG,MAAMX,aAAa,CAACC,KAAK,CAAC;;EAE7C;EACA,IAAIW,YAAmC;EAEvC,MAAMC,UAAU,GAAIC,OAA6B,IAAK;IAClD,MAAM;MAAEC,GAAG;MAAEC;IAAQ,CAAC,GAAGF,OAAO;IAEhC,IAAI,CAACF,YAAY,EAAE;MACfA,YAAY,GAAG,IAAII,OAAO,CAACC,YAAY,CAAC;QAAE,CAACP,SAAS,GAAGQ,IAAI,CAACC,SAAS,CAACR,UAAU;MAAE,CAAC,CAAC;IACxF;IAEA,MAAMS,OAAgC,GAAG,CAACR,YAAY,CAAC;IAEvD,IAAIG,GAAG,EAAE;MACL;MACAK,OAAO,CAACC,IAAI,CAAC;QACTC,KAAKA,CAACC,QAAQ,EAAE;UACZA,QAAQ,CAACC,KAAK,CAACC,YAAY,CAACC,UAAU,CAAC,eAAe,EAAE,MAAMC,WAAW,IAAI;YACzEA,WAAW,CAACC,gBAAgB,CAACC,GAAG,CAAC5B,KAAK,CAAC;UAC3C,CAAC,CAAC;UAEFsB,QAAQ,CAACC,KAAK,CAACM,aAAa,CAACJ,UAAU,CAAC,gBAAgB,EAAE,YAAY;YAClE,MAAMK,QAAQ,GAAG,MAAM/B,aAAa,CAACC,KAAK,CAAC;YAC3C;YACAW,YAAY,CAACoB,WAAW,CAACtB,SAAS,CAAC,GAAGQ,IAAI,CAACC,SAAS,CAACY,QAAQ,CAAC;UAClE,CAAC,CAAC;QACN;MACJ,CAAC,CAAC;IACN;IAEA,OAAOX,OAAO;EAClB,CAAC;EAED,OAAO;IAAEP;EAAW,CAAC;AACzB,CAAC","ignoreList":[]}
|
package/CssInliner.d.ts
DELETED
package/CssInliner.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import postcss from "postcss";
|
|
2
|
-
import path from "path";
|
|
3
|
-
import { readFile } from "fs";
|
|
4
|
-
import { promisify } from "util";
|
|
5
|
-
const readFileAsync = promisify(readFile);
|
|
6
|
-
export class CSSInliner {
|
|
7
|
-
seen = new Set();
|
|
8
|
-
async load(entryPath) {
|
|
9
|
-
const result = await this.inlineFile(entryPath);
|
|
10
|
-
return result.css;
|
|
11
|
-
}
|
|
12
|
-
async inlineFile(filePath) {
|
|
13
|
-
const absolutePath = path.resolve(filePath);
|
|
14
|
-
if (this.seen.has(absolutePath)) {
|
|
15
|
-
return postcss().process("", {
|
|
16
|
-
from: undefined
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
this.seen.add(absolutePath);
|
|
20
|
-
const css = await readFileAsync(absolutePath, "utf8");
|
|
21
|
-
return postcss([this.createImportInlinerPlugin(path.dirname(absolutePath))]).process(css, {
|
|
22
|
-
from: absolutePath
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
createImportInlinerPlugin(currentDir) {
|
|
26
|
-
return {
|
|
27
|
-
postcssPlugin: "css-inliner",
|
|
28
|
-
AtRule: async atRule => {
|
|
29
|
-
if (atRule.name !== "import") {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
const importPath = atRule.params.replace(/^url\(|\)$|['"]/g, "").trim();
|
|
33
|
-
let importedCSS;
|
|
34
|
-
let from;
|
|
35
|
-
try {
|
|
36
|
-
if (importPath.startsWith("http://") || importPath.startsWith("https://")) {
|
|
37
|
-
// Leave remote @import untouched
|
|
38
|
-
return;
|
|
39
|
-
} else {
|
|
40
|
-
const resolvedPath = path.resolve(currentDir, importPath);
|
|
41
|
-
if (this.seen.has(resolvedPath)) {
|
|
42
|
-
atRule.remove();
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
this.seen.add(resolvedPath);
|
|
46
|
-
importedCSS = await readFileAsync(resolvedPath, "utf8");
|
|
47
|
-
from = resolvedPath;
|
|
48
|
-
}
|
|
49
|
-
} catch (err) {
|
|
50
|
-
console.warn(`⚠️ Failed to inline import: ${importPath}`, err);
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
const result = await postcss([this.createImportInlinerPlugin(from ? path.dirname(from) : currentDir)]).process(importedCSS, {
|
|
54
|
-
from
|
|
55
|
-
});
|
|
56
|
-
const root = postcss.parse(result.css);
|
|
57
|
-
if (atRule.parent?.type === "atrule" && atRule.parent.name === "media") {
|
|
58
|
-
atRule.replaceWith(root);
|
|
59
|
-
} else {
|
|
60
|
-
atRule.replaceWith(root.nodes);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// @ts-expect-error `postcss` requires this to treat the function as a valid plugin.
|
|
68
|
-
CSSInliner.prototype.createImportInlinerPlugin.postcss = true;
|
|
69
|
-
|
|
70
|
-
//# sourceMappingURL=CssInliner.js.map
|
package/CssInliner.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["postcss","path","readFile","promisify","readFileAsync","CSSInliner","seen","Set","load","entryPath","result","inlineFile","css","filePath","absolutePath","resolve","has","process","from","undefined","add","createImportInlinerPlugin","dirname","currentDir","postcssPlugin","AtRule","atRule","name","importPath","params","replace","trim","importedCSS","startsWith","resolvedPath","remove","err","console","warn","root","parse","parent","type","replaceWith","nodes","prototype"],"sources":["CssInliner.ts"],"sourcesContent":["import postcss, { type AtRule } from \"postcss\";\nimport path from \"path\";\nimport { readFile } from \"fs\";\nimport { promisify } from \"util\";\n\nconst readFileAsync = promisify(readFile);\n\nexport class CSSInliner {\n private seen = new Set<string>();\n\n async load(entryPath: string): Promise<string> {\n const result = await this.inlineFile(entryPath);\n return result.css;\n }\n\n private async inlineFile(filePath: string): Promise<postcss.Result> {\n const absolutePath = path.resolve(filePath);\n\n if (this.seen.has(absolutePath)) {\n return postcss().process(\"\", { from: undefined });\n }\n\n this.seen.add(absolutePath);\n const css = await readFileAsync(absolutePath, \"utf8\");\n\n return postcss([this.createImportInlinerPlugin(path.dirname(absolutePath))]).process(css, {\n from: absolutePath\n });\n }\n\n private createImportInlinerPlugin(currentDir: string) {\n return {\n postcssPlugin: \"css-inliner\",\n AtRule: async (atRule: AtRule) => {\n if (atRule.name !== \"import\") {\n return;\n }\n\n const importPath = atRule.params.replace(/^url\\(|\\)$|['\"]/g, \"\").trim();\n\n let importedCSS: string;\n let from: string | undefined;\n\n try {\n if (importPath.startsWith(\"http://\") || importPath.startsWith(\"https://\")) {\n // Leave remote @import untouched\n return;\n } else {\n const resolvedPath = path.resolve(currentDir, importPath);\n\n if (this.seen.has(resolvedPath)) {\n atRule.remove();\n return;\n }\n\n this.seen.add(resolvedPath);\n importedCSS = await readFileAsync(resolvedPath, \"utf8\");\n from = resolvedPath;\n }\n } catch (err) {\n console.warn(`⚠️ Failed to inline import: ${importPath}`, err);\n return;\n }\n\n const result = await postcss([\n this.createImportInlinerPlugin(from ? path.dirname(from) : currentDir)\n ]).process(importedCSS, { from });\n\n const root = postcss.parse(result.css);\n\n if (atRule.parent?.type === \"atrule\" && atRule.parent.name === \"media\") {\n atRule.replaceWith(root);\n } else {\n atRule.replaceWith(root.nodes);\n }\n }\n };\n }\n}\n\n// @ts-expect-error `postcss` requires this to treat the function as a valid plugin.\nCSSInliner.prototype.createImportInlinerPlugin.postcss = true;\n"],"mappings":"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","ignoreList":[]}
|
package/useCss.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useCss(cssFile?: string): Promise<string>;
|
package/useCss.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use server";
|
|
2
|
-
|
|
3
|
-
import path from "path";
|
|
4
|
-
export async function useCss(cssFile) {
|
|
5
|
-
const {
|
|
6
|
-
CSSInliner
|
|
7
|
-
} = await import("./CssInliner");
|
|
8
|
-
const entryCss = cssFile ?? path.resolve(process.cwd(), "src/theme/theme.css");
|
|
9
|
-
const inliner = new CSSInliner();
|
|
10
|
-
return await inliner.load(entryCss);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
//# sourceMappingURL=useCss.js.map
|
package/useCss.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["path","useCss","cssFile","CSSInliner","entryCss","resolve","process","cwd","inliner","load"],"sources":["useCss.ts"],"sourcesContent":["\"use server\";\nimport path from \"path\";\n\nexport async function useCss(cssFile?: string) {\n const { CSSInliner } = await import(\"~/CssInliner\");\n const entryCss = cssFile ?? path.resolve(process.cwd(), \"src/theme/theme.css\");\n\n const inliner = new CSSInliner();\n return await inliner.load(entryCss);\n}\n"],"mappings":"AAAA,YAAY;;AACZ,OAAOA,IAAI,MAAM,MAAM;AAEvB,OAAO,eAAeC,MAAMA,CAACC,OAAgB,EAAE;EAC3C,MAAM;IAAEC;EAAW,CAAC,GAAG,MAAM,MAAM,eAAe,CAAC;EACnD,MAAMC,QAAQ,GAAGF,OAAO,IAAIF,IAAI,CAACK,OAAO,CAACC,OAAO,CAACC,GAAG,CAAC,CAAC,EAAE,qBAAqB,CAAC;EAE9E,MAAMC,OAAO,GAAG,IAAIL,UAAU,CAAC,CAAC;EAChC,OAAO,MAAMK,OAAO,CAACC,IAAI,CAACL,QAAQ,CAAC;AACvC","ignoreList":[]}
|