Skip to content

Commit

Permalink
Add preact and htm to postinstall
Browse files Browse the repository at this point in the history
  • Loading branch information
herzog31 committed Nov 20, 2024
1 parent e6f529f commit 4c8f3fa
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 7 deletions.
18 changes: 17 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
"@adobe/magento-storefront-event-collector": "^1.8.0",
"@adobe/magento-storefront-events-sdk": "^1.8.0",
"@dropins/storefront-pdp": "0.4.0",
"@dropins/tools": "^0.33.0"
"@dropins/tools": "^0.33.0",
"htm": "^3.1.1",
"preact": "^10.24.3"
}
}
11 changes: 9 additions & 2 deletions postinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,15 @@ fs.readdirSync('node_modules/@dropins', { withFileTypes: true }).forEach((file)
});
});

fs.copyFileSync(path.resolve(__dirname, './node_modules/@adobe/magento-storefront-event-collector/dist/index.js'), path.resolve(__dirname, './scripts/commerce-events-collector.js'));
fs.copyFileSync(path.resolve(__dirname, './node_modules/@adobe/magento-storefront-events-sdk/dist/index.js'), path.resolve(__dirname, './scripts/commerce-events-sdk.js'));
// Other files to copy
[
{ from: '@adobe/magento-storefront-event-collector/dist/index.js', to: 'commerce-events-collector.js' },
{ from: '@adobe/magento-storefront-events-sdk/dist/index.js', to: 'commerce-events-sdk.js' },
{ from: 'htm/dist/htm.module.js', to: 'htm.js' },
{ from: 'preact/dist/preact.module.js', to: 'preact.js' },
].forEach((file) => {
fs.copyFileSync(path.resolve(__dirname, 'node_modules', file.from), path.resolve(__dirname, 'scripts', file.to));
});

function checkPackageLockForArtifactory() {
return new Promise((resolve, reject) => {
Expand Down
2 changes: 1 addition & 1 deletion scripts/commerce-events-collector.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion scripts/htm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion scripts/preact.js

Large diffs are not rendered by default.

0 comments on commit 4c8f3fa

Please sign in to comment.