Skip to content

Commit

Permalink
Fix weird issue in images build with typings (plone#6471)
Browse files Browse the repository at this point in the history
  • Loading branch information
sneridagh authored Nov 5, 2024
1 parent 38aab6d commit 81f9a2a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const config = {
],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-ts-comment': 0,
},
},
{
Expand Down
1 change: 1 addition & 0 deletions packages/registry/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ module.exports = {
},
rules: {
'no-prototype-builtins': 0,
'@typescript-eslint/ban-ts-comment': 0,
},
},
],
Expand Down
1 change: 1 addition & 0 deletions packages/registry/news/6471.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix weird typings issue happening in docker build but not locally. @sneridagh
3 changes: 1 addition & 2 deletions packages/registry/src/addon-registry/create-addons-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,7 @@ export function createAddonsLoader(
}

const code = getAddonsLoaderCode(addons, addonsInfo, loadProjectConfig);
// @ts-expect-error No clue why it's complaining
fs.writeFileSync(addonsLoaderPath, Buffer.from(code));
fs.writeFileSync(addonsLoaderPath, code);
return addonsLoaderPath;
}

Expand Down
14 changes: 6 additions & 8 deletions packages/registry/src/addon-registry/create-theme-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ function nameFromPackage(name: string) {
* Creates a static file with code necessary to load the addons configuration
*
*/
function getThemeLoaderCode(name: string, customThemeAddons = []) {
function getThemeLoaderCode(
name: string,
customThemeAddons: Array<string> = [],
) {
let buf = `/*
This file is autogenerated. Don't change it directly.
Add a ./theme/_${name}.scss in your add-on to load your theme customizations in the current theme.
Expand All @@ -49,14 +52,9 @@ export function createThemeAddonsLoader({
const addonsThemeLoaderMainPath = tmp.tmpNameSync({ postfix: '.scss' });
fs.writeFileSync(
addonsThemeLoaderVariablesPath,
//@ts-expect-error No clue why this is erroring
new Buffer.from(getThemeLoaderCode('variables', variables)),
);
fs.writeFileSync(
addonsThemeLoaderMainPath,
//@ts-expect-error No clue why this is erroring
new Buffer.from(getThemeLoaderCode('main', main)),
getThemeLoaderCode('variables', variables),
);
fs.writeFileSync(addonsThemeLoaderMainPath, getThemeLoaderCode('main', main));

return [addonsThemeLoaderVariablesPath, addonsThemeLoaderMainPath];
}
Expand Down

0 comments on commit 81f9a2a

Please sign in to comment.