Skip to content
Permalink
Browse files

fix(electron): update electron-installer-dmg to latest

closes #141
  • Loading branch information...
NathanWalker committed Aug 4, 2019
1 parent 4ba9cd7 commit 78e6804fdb5dda887cac974b9619637726f90b24
@@ -1,12 +1,10 @@
<a name="8.0.3"></a>
## [8.0.3](https://github.com/nstudio/xplat/compare/8.0.0...8.0.3) (2019-08-01)

## [8.0.3](https://github.com/nstudio/xplat/compare/8.0.0...8.0.3) (2019-08-01)

### Bug Fixes

* **scripts:** postinstall adjustment and cleanup ([423aa49](https://github.com/nstudio/xplat/commit/423aa49))


- **scripts:** postinstall adjustment and cleanup ([423aa49](https://github.com/nstudio/xplat/commit/423aa49))

<a name="8.0.2"></a>

@@ -23,4 +23,4 @@ Comma-delimited list of helpers to generate.

Type: `string`

Some helpers support targeting to generate the helper for a specific target. ie: ng g @nstudio/angular:helpers applitools --target=web-myapp
Some helpers support targeting to generate the helper for a specific target. ie: nx g @nstudio/angular:helpers applitools --target=web-myapp
@@ -23,4 +23,4 @@ Comma-delimited list of helpers to generate.

Type: `string`

Some helpers support targeting to generate the helper for a specific target. ie: ng g @nstudio/nativescript:helpers imports
Some helpers support targeting to generate the helper for a specific target. ie: nx g @nstudio/nativescript:helpers imports
@@ -9,6 +9,6 @@ Here's a list of all available packages provided via xplat.
| <a href="/xplat/api/ionic-angular">@nstudio/ionic-angular</a> | <a href="/xplat/api/angular">@nstudio/angular</a>, <a href="/xplat/api/ionic">@nstudio/ionic</a>, <a href="/xplat/api/web-angular">@nstudio/web-angular</a> | <a href="/xplat/api/xplat">@nstudio/xplat</a> |
| <a href="/xplat/api/nativescript">@nstudio/nativescript</a> | | <a href="/xplat/api/xplat">@nstudio/xplat</a> |
| <a href="/xplat/api/nativescript-angular">@nstudio/nativescript-angular</a> | <a href="/xplat/api/angular">@nstudio/angular</a>, <a href="/xplat/api/nativescript">@nstudio/nativescript</a> | <a href="/xplat/api/xplat">@nstudio/xplat</a> |
| <a href="/xplat/api/web">@nstudio/web</a> | | <a href="/xplat/api/xplat">@nstudio/xplat</a> |
| <a href="/xplat/api/web-angular">@nstudio/web-angular</a> | <a href="/xplat/api/angular">@nstudio/angular</a> | <a href="/xplat/api/xplat">@nstudio/xplat</a> |
| <a href="/xplat/api/web">@nstudio/web</a> | @nrwl/web | <a href="/xplat/api/xplat">@nstudio/xplat</a> |
| <a href="/xplat/api/web-angular">@nstudio/web-angular</a> | <a href="/xplat/api/angular">@nstudio/angular</a>, <a href="/xplat/api/web">@nstudio/web</a> | <a href="/xplat/api/xplat">@nstudio/xplat</a> |
| <a href="/xplat/api/xplat">@nstudio/xplat</a> | @nrwl/workspace | |
@@ -33,7 +33,7 @@ yarn global add @nrwl/cli
**Using `npm`**

```bash
npm install -dev @nstudio/xplat
npm install -save-dev @nstudio/xplat
```

**Using `yarn`**
@@ -68,7 +68,6 @@
"commitizen": "^2.10.1",
"conventional-changelog-cli": "^1.3.21",
"copy-webpack-plugin": "5.0.3",
"core-js": "^3.1.4",
"cosmiconfig": "^4.0.0",
"cypress": "~3.3.1",
"cz-conventional-changelog": "^2.1.0",
@@ -119,7 +118,6 @@
"tslint": "5.11.0",
"typescript": "~3.4.5",
"viz.js": "^1.8.1",
"weak": "^1.0.1",
"webpack": "4.30.0",
"webpack-dev-server": "3.1.14",
"webpack-node-externals": "^1.7.2",
@@ -42,8 +42,10 @@ export default function(options: Schema) {
)
);
}
// xplat is configured for sass only (at moment)
options.style = 'scss';
if (options.useXplat) {
// xplat is configured for sass only (at moment)
options.style = 'scss';
}

return chain([
prerun(options),
@@ -98,7 +100,7 @@ export default function(options: Schema) {
scripts[
`clean`
] = `npx rimraf hooks node_modules package-lock.json && npm i`;
scripts[`start.${platformApp}`] = `ng serve ${options.name}`;
scripts[`start.${platformApp}`] = `nx serve ${options.name}`;
return updatePackageScripts(tree, scripts);
},
formatFiles({ skipFormat: options.skipFormat })
@@ -14,15 +14,19 @@ import {
prerun,
unsupportedPlatformError,
XplatFeatureHelpers,
getFrontendFramework
getFrontendFramework,
supportedNxExtraPlatforms,
PlatformNxExtraTypes,
PlatformTypes,
unsupportedPlatformErrorWithNxNote
} from '@nstudio/xplat';

export default function(options: XplatFeatureHelpers.Schema) {
const featureSettings = XplatFeatureHelpers.prepare(options);

const externalChains = [];
for (const platform of featureSettings.platforms) {
if (supportedPlatforms.includes(platform)) {
if (supportedPlatforms.includes(<PlatformTypes>platform)) {
externalChains.push((tree: Tree, context: SchematicContext) => {
// console.log(`@nstudio/${platform}-angular`);
// console.log('angular feature chain getFrontendFramework:', getFrontendFramework());
@@ -35,6 +39,12 @@ export default function(options: XplatFeatureHelpers.Schema) {
}
)(tree, context);
});
} else if (
supportedNxExtraPlatforms.includes(<PlatformNxExtraTypes>platform)
) {
throw new SchematicsException(
unsupportedPlatformErrorWithNxNote(platform, 'feature')
);
} else {
throw new SchematicsException(unsupportedPlatformError(platform));
}
@@ -5,7 +5,7 @@ export const angularDevkitVersion = '^0.800.0';
export const ngxTranslateVersion = '~11.0.0';
export const ngxTranslateHttpLoaderVersion = '~4.0.0';
export const reflectMetadataVersion = '^0.1.12';
export const coreJsVersion = '^2.5.4';
export const coreJsVersion = '^3.1.4';
export const rxjsVersion = '~6.4.0';
export const zonejsVersion = '~0.9.0';
export const codelyzerVersion = '~5.1.0';
@@ -7,7 +7,6 @@
"experimentalDecorators": true,
"esModuleInterop": true,
"target": "es5",
"types": ["jasmine"],
"typeRoots": ["../../node_modules/@types"],
"lib": ["es2017", "es2016", "es2015", "dom"]
},
@@ -86,6 +86,10 @@ export default function(options: XplatElectrontHelpers.SchemaApp) {
...options,
skipDependentPlatformFiles: true
}),
// use xplat or not
options.useXplat
? externalSchematic('@nstudio/electron-angular', 'xplat', options)
: noop(),
(tree: Tree, context: SchematicContext) =>
addAppFiles(options, options.name)(tree, context),
XplatElectronAngularHelpers.updateRootDeps(options),
@@ -146,7 +150,8 @@ export default function(options: XplatElectrontHelpers.SchemaApp) {
},
options.useXplat ? (tree: Tree) => adjustAppFiles(options, tree) : noop(),

formatFiles({ skipFormat: options.skipFormat })
formatFiles({ skipFormat: options.skipFormat }),
XplatElectrontHelpers.noteAppCommands(options)
]);
}

@@ -12,10 +12,15 @@ import { XplatElectronAngularHelpers } from '../../utils';
export default function(options: XplatHelpers.Schema) {
return chain([
prerun(options, true),
(tree: Tree, context: SchematicContext) =>
externalSchematic('@nstudio/web-angular', 'xplat', options, {
interactive: false
}),
(tree: Tree, context: SchematicContext) => {
if (tree.exists('/xplat/web-angular/scss/_variables.scss')) {
return noop();
} else {
return externalSchematic('@nstudio/web-angular', 'xplat', options, {
interactive: false
})(tree, context);
}
},
(tree: Tree, context: SchematicContext) =>
externalSchematic(
'@nstudio/electron',
@@ -7,7 +7,6 @@
"experimentalDecorators": true,
"esModuleInterop": true,
"target": "es5",
"types": ["jasmine"],
"typeRoots": ["../../node_modules/@types"],
"lib": ["es2017", "es2016", "es2015", "dom"]
},
@@ -2,7 +2,7 @@ export const xplatVersion = '*';
export const electronVersion = '^4.0.5';
export const electronBuilderVersion = '^20.38.4';
export const electronRebuildVersion = '~1.8.4';
export const electronInstallerDmgVersion = '~2.0.0';
export const electronInstallerDmgVersion = '~3.0.0';
export const electronPackagerVersion = '~13.1.0';
export const electronReloadVersion = '~1.4.0';
export const electronStoreVersion = '~2.0.0';
@@ -3,7 +3,8 @@ import {
XplatHelpers,
getNpmScope,
getJsonFromFile,
updatePackageScripts
updatePackageScripts,
output
} from '@nstudio/xplat';
import {
waitOnVersion,
@@ -127,7 +128,7 @@ export namespace XplatElectrontHelpers {
] = `npm run postinstall.electron && tsc -p apps/${
options.name
}/tsconfig.json`;
scripts[`serve.${platformApp}.target`] = `ng serve ${options.name}`;
scripts[`serve.${platformApp}.target`] = `nx serve ${options.name}`;
scripts[
`serve.${platformApp}`
] = `wait-on http-get://localhost:4200/ && electron apps/${
@@ -150,7 +151,7 @@ export namespace XplatElectrontHelpers {
// create to be consistent
scripts[
`start.${targetAppScript}`
] = `${postinstallWeb} && ng serve ${fullTargetAppName}`;
] = `${postinstallWeb} && nx serve ${fullTargetAppName}`;
}
let startDefault = scripts[`start`];
if (startDefault) {
@@ -161,7 +162,7 @@ export namespace XplatElectrontHelpers {
}
scripts[`start`] = `${postinstallWeb} && ${startDefault}`;
} else {
scripts[`start`] = `${postinstallWeb} && ng serve ${fullTargetAppName}`;
scripts[`start`] = `${postinstallWeb} && nx serve ${fullTargetAppName}`;
}
let buildDefault = scripts[`build`];
if (buildDefault) {
@@ -172,24 +173,37 @@ export namespace XplatElectrontHelpers {
}
scripts[`build`] = `${postinstallWeb} && ${buildDefault}`;
} else {
scripts[`build`] = `${postinstallWeb} && ng build ${fullTargetAppName}`;
scripts[`build`] = `${postinstallWeb} && nx build ${fullTargetAppName}`;
}
let testDefault = scripts[`test`];
if (testDefault) {
// prefix it
scripts[`test`] = `${postinstallWeb} && ${testDefault}`;
} else {
scripts[`test`] = `${postinstallWeb} && ng test`;
scripts[`test`] = `${postinstallWeb} && nx test`;
}
let e2eDefault = scripts[`e2e`];
if (e2eDefault) {
// prefix it
scripts[`e2e`] = `${postinstallWeb} && ${e2eDefault}`;
} else {
scripts[`e2e`] = `${postinstallWeb} && ng e2e`;
scripts[`e2e`] = `${postinstallWeb} && nx e2e`;
}

return updatePackageScripts(tree, scripts);
};
}

export function noteAppCommands(options: SchemaApp) {
return (tree: Tree) => {
const platformApp = options.name.replace('-', '.');
output.log({
title: 'Note:',
bodyLines: [
`Develop your Electron app with: yarn start.${platformApp} (or: npm run start.${platformApp})`
]
});
return tree;
};
}
}
@@ -11,7 +11,7 @@ export const angularDevkitVersion = '^0.800.0';
export const ngxTranslateVersion = '~11.0.0';
export const ngxTranslateHttpLoaderVersion = '~4.0.0';
export const reflectMetadataVersion = '^0.1.12';
export const coreJsVersion = '^2.5.4';
export const coreJsVersion = '^3.1.4';
export const rxjsVersion = '~6.4.0';
export const zonejsVersion = '~0.9.0';
export const codelyzerVersion = '~5.1.0';
@@ -30,7 +30,8 @@
"migrations": "./migrations.json"
},
"dependencies": {
"@nstudio/angular": "*"
"@nstudio/angular": "*",
"@nstudio/web": "*"
},
"peerDependencies": {
"@nstudio/xplat": "*"
@@ -76,4 +76,17 @@ describe('xplat schematic', () => {
tree.exists('/apps/nativescript-sample/App_Resources/iOS/Info.plist')
).toBeTruthy();
});

// describe('Nx app generators supporte via proxy xplat app generator', () => {
// it('should create Nx express', async () => {
// const options: XplatHelpers.Schema = { ...defaultOptions };
// options.platforms = 'express';

// const tree = await runSchematic('app', options, appTree);
// const files = tree.files;
// console.log('files:', files);

// // expect(tree.exists('/apps/nativescript-sample/nsconfig.json')).toBeTruthy();
// });
// });
});
@@ -12,3 +12,41 @@ export default function(options: Schema) {

return chain([prerun(options, true), ...externalChains]);
}

// TODO: Allow prompts for all Nx generators
// Right now the x-prompt for what frontend framework should it use comes up for all options
// use 2 schematics which conditionally execute depending upon the first app type choice
// "items": [
// {
// "value": "electron",
// "label": "electron [Electron app]"
// },
// {
// "value": "express",
// "label": "express [Express app]"
// },
// {
// "value": "ionic",
// "label": "ionic [Ionic app]"
// },
// {
// "value": "nativescript",
// "label": "nativescript [NativeScript app]"
// },
// {
// "value": "nest",
// "label": "nest [Nest app]"
// },
// {
// "value": "node",
// "label": "node [Node app]"
// },
// {
// "value": "react",
// "label": "react [React app]"
// },
// {
// "value": "web",
// "label": "web [Web app]"
// }
// ]
@@ -23,24 +23,24 @@
"type": "string",
"description": "Platforms.",
"x-prompt": {
"message": "Which platform would you like to generate an app for?",
"message": "What type of app would like to create?",
"type": "list",
"items": [
{
"value": "electron",
"label": "electron [Electron app]"
"label": "electron [Electron app]"
},
{
"value": "ionic",
"label": "ionic [Ionic app]"
"label": "ionic [Ionic app]"
},
{
"value": "nativescript",
"label": "nativescript [NativeScript app]"
"label": "nativescript [NativeScript app]"
},
{
"value": "web",
"label": "web [Web app]"
"label": "web [Web app]"
}
]
}

0 comments on commit 78e6804

Please sign in to comment.
You can’t perform that action at this time.