mirror of
https://github.com/responsively-org/responsively-app
synced 2024-11-10 14:54:12 +00:00
Merge pull request #930 from monalisamsteccentric/fix/post-install
post-intall script added
This commit is contained in:
commit
48033a22bf
3 changed files with 1063 additions and 1 deletions
|
@ -27,7 +27,7 @@
|
|||
"build": "concurrently \"yarn run build:main\" \"yarn run build:renderer\"",
|
||||
"build:main": "cross-env NODE_ENV=production TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.main.prod.ts",
|
||||
"build:renderer": "cross-env NODE_ENV=production TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.renderer.prod.ts",
|
||||
"postinstall": "yarn rimraf --glob node_modules/browser-sync/dist/**/*.map && yarn replace '\"network-throttle\".*' '' node_modules/browser-sync-ui/lib/UI.js && ts-node .erb/scripts/check-native-dep.js && replace-in-file '/// <reference types=\"howler\" />' \"import { Howl } from 'howler';\" node_modules/use-sound/dist/types.d.ts && electron-builder install-app-deps && cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.renderer.dev.dll.ts",
|
||||
"postinstall": "yarn rimraf --glob node_modules/browser-sync/dist/**/*.map && ts-node .erb/scripts/check-native-dep.js && ts-node postinstall.ts && electron-builder install-app-deps && cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.renderer.dev.dll.ts",
|
||||
"lint": "cross-env NODE_ENV=development eslint . --ext .js,.jsx,.ts,.tsx",
|
||||
"package": "ts-node ./.erb/scripts/clean.js dist && yarn run build && electron-builder build --publish never",
|
||||
"prepare": "cd .. && husky install desktop-app/.husky && chmod a+x desktop-app/.husky/pre-commit",
|
||||
|
|
31
desktop-app/postinstall.ts
Normal file
31
desktop-app/postinstall.ts
Normal file
|
@ -0,0 +1,31 @@
|
|||
import { replaceInFile } from 'replace-in-file';
|
||||
|
||||
async function performReplacements() {
|
||||
const replaceOptions = {
|
||||
files: 'node_modules/browser-sync-ui/lib/UI.js',
|
||||
from: /"network-throttle".*/,
|
||||
to: '',
|
||||
};
|
||||
|
||||
const howlerOptions = {
|
||||
files: 'node_modules/use-sound/dist/types.d.ts',
|
||||
from: '/// <reference types="howler" />',
|
||||
to: 'import { Howl } from "howler";',
|
||||
};
|
||||
|
||||
try {
|
||||
await replaceInFile(replaceOptions);
|
||||
console.log('Replacement in UI.js completed successfully.');
|
||||
|
||||
await replaceInFile(howlerOptions);
|
||||
console.log('Replacement in types.d.ts completed successfully.');
|
||||
} catch (error) {
|
||||
console.error('Error occurred during replacements:', error);
|
||||
}
|
||||
}
|
||||
|
||||
async function performPostInstall() {
|
||||
await performReplacements();
|
||||
}
|
||||
|
||||
performPostInstall();
|
1031
desktop-app/release/app/yarn.lock
Normal file
1031
desktop-app/release/app/yarn.lock
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue