Skip to content

Commit

Permalink
fix(electron): update electron-installer-dmg to latest
Browse files Browse the repository at this point in the history
closes #141
  • Loading branch information
NathanWalker committed Aug 4, 2019
1 parent 4ba9cd7 commit 78e6804
Show file tree
Hide file tree
Showing 25 changed files with 207 additions and 65 deletions.
6 changes: 2 additions & 4 deletions CHANGELOG.md
@@ -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>

Expand Down
2 changes: 1 addition & 1 deletion docs/api-angular/schematics/helpers.md
Expand Up @@ -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
2 changes: 1 addition & 1 deletion docs/api-nativescript/schematics/helpers.md
Expand Up @@ -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
4 changes: 2 additions & 2 deletions docs/api/home.md
Expand Up @@ -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 | |
2 changes: 1 addition & 1 deletion docs/xplat/getting-started/getting-started.md
Expand Up @@ -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`**
Expand Down
2 changes: 0 additions & 2 deletions package.json
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
8 changes: 5 additions & 3 deletions packages/angular/src/schematics/application/index.ts
Expand Up @@ -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),
Expand Down Expand Up @@ -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 })
Expand Down
14 changes: 12 additions & 2 deletions packages/angular/src/schematics/feature/index.ts
Expand Up @@ -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());
Expand All @@ -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));
}
Expand Down
2 changes: 1 addition & 1 deletion packages/angular/src/utils/versions.ts
Expand Up @@ -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';
Expand Up @@ -7,7 +7,6 @@
"experimentalDecorators": true,
"esModuleInterop": true,
"target": "es5",
"types": ["jasmine"],
"typeRoots": ["../../node_modules/@types"],
"lib": ["es2017", "es2016", "es2015", "dom"]
},
Expand Down
Expand Up @@ -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),
Expand Down Expand Up @@ -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)
]);
}

Expand Down
13 changes: 9 additions & 4 deletions packages/electron-angular/src/schematics/xplat/index.ts
Expand Up @@ -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',
Expand Down
Expand Up @@ -7,7 +7,6 @@
"experimentalDecorators": true,
"esModuleInterop": true,
"target": "es5",
"types": ["jasmine"],
"typeRoots": ["../../node_modules/@types"],
"lib": ["es2017", "es2016", "es2015", "dom"]
},
Expand Down
2 changes: 1 addition & 1 deletion packages/electron/src/utils/versions.ts
Expand Up @@ -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';
Expand Down
28 changes: 21 additions & 7 deletions packages/electron/src/utils/xplat.ts
Expand Up @@ -3,7 +3,8 @@ import {
XplatHelpers,
getNpmScope,
getJsonFromFile,
updatePackageScripts
updatePackageScripts,
output
} from '@nstudio/xplat';
import {
waitOnVersion,
Expand Down Expand Up @@ -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/${
Expand All @@ -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) {
Expand All @@ -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) {
Expand All @@ -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;
};
}
}
2 changes: 1 addition & 1 deletion packages/ionic-angular/src/utils/versions.ts
Expand Up @@ -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';
3 changes: 2 additions & 1 deletion packages/web-angular/package.json
Expand Up @@ -30,7 +30,8 @@
"migrations": "./migrations.json"
},
"dependencies": {
"@nstudio/angular": "*"
"@nstudio/angular": "*",
"@nstudio/web": "*"
},
"peerDependencies": {
"@nstudio/xplat": "*"
Expand Down
13 changes: 13 additions & 0 deletions packages/xplat/src/schematics/application/index.spec.ts
Expand Up @@ -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();
// });
// });
});
38 changes: 38 additions & 0 deletions packages/xplat/src/schematics/application/index.ts
Expand Up @@ -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]"
// }
// ]
10 changes: 5 additions & 5 deletions packages/xplat/src/schematics/application/schema.json
Expand Up @@ -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]"
}
]
}
Expand Down

0 comments on commit 78e6804

Please sign in to comment.