Skip to content

Commit

Permalink
chore(build): 8.0.7 and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanWalker committed Sep 30, 2019
1 parent e930f9f commit 528b4df
Show file tree
Hide file tree
Showing 16 changed files with 89 additions and 146 deletions.
9 changes: 3 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
<a name="8.0.7"></a>
## [8.0.7](https://github.com/nstudio/xplat/compare/8.0.5...8.0.7) (2019-09-30)

## [8.0.7](https://github.com/nstudio/xplat/compare/8.0.5...8.0.7) (2019-09-30)

### Bug Fixes

* **generators:** remove create-xplat-workspace and updated deps ([0117f53](https://github.com/nstudio/xplat/commit/0117f53))

- **generators:** remove create-xplat-workspace and updated deps ([0117f53](https://github.com/nstudio/xplat/commit/0117f53))

### Features

* **schematics:** app generator now includes Nx + xplat options ([0650c4f](https://github.com/nstudio/xplat/commit/0650c4f))


- **schematics:** app generator now includes Nx + xplat options ([0650c4f](https://github.com/nstudio/xplat/commit/0650c4f))

<a name="8.0.6"></a>

Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@

Please see our [guidelines for contributing](https://github.com/nstudio/xplat/blob/master/CONTRIBUTING.md).

[<img alt="NathanWalker" src="https://avatars2.githubusercontent.com/u/457187?v=4&s=117" width="117">](https://github.com/NathanWalker) |[<img alt="dungahk" src="https://avatars3.githubusercontent.com/u/10074819?v=4&s=117" width="117">](https://github.com/dungahk) |[<img alt="m-abs" src="https://avatars3.githubusercontent.com/u/1348705?v=4&s=117" width="117">](https://github.com/m-abs) |[<img alt="sr3dna" src="https://avatars2.githubusercontent.com/u/15936818?v=4&s=117" width="117">](https://github.com/sr3dna) |[<img alt="mbaljeetsingh" src="https://avatars0.githubusercontent.com/u/872762?v=4&s=117" width="117">](https://github.com/mbaljeetsingh) |[<img alt="dopsonbr" src="https://avatars1.githubusercontent.com/u/5340660?v=4&s=117" width="117">](https://github.com/dopsonbr) |
:---: |:---: |:---: |:---: |:---: |:---: |
[NathanWalker](https://github.com/NathanWalker) |[dungahk](https://github.com/dungahk) |[m-abs](https://github.com/m-abs) |[sr3dna](https://github.com/sr3dna) |[mbaljeetsingh](https://github.com/mbaljeetsingh) |[dopsonbr](https://github.com/dopsonbr) |
| [<img alt="NathanWalker" src="https://avatars2.githubusercontent.com/u/457187?v=4&s=117" width="117">](https://github.com/NathanWalker) | [<img alt="dungahk" src="https://avatars3.githubusercontent.com/u/10074819?v=4&s=117" width="117">](https://github.com/dungahk) | [<img alt="m-abs" src="https://avatars3.githubusercontent.com/u/1348705?v=4&s=117" width="117">](https://github.com/m-abs) | [<img alt="sr3dna" src="https://avatars2.githubusercontent.com/u/15936818?v=4&s=117" width="117">](https://github.com/sr3dna) | [<img alt="mbaljeetsingh" src="https://avatars0.githubusercontent.com/u/872762?v=4&s=117" width="117">](https://github.com/mbaljeetsingh) | [<img alt="dopsonbr" src="https://avatars1.githubusercontent.com/u/5340660?v=4&s=117" width="117">](https://github.com/dopsonbr) |
| :-------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------: |
| [NathanWalker](https://github.com/NathanWalker) | [dungahk](https://github.com/dungahk) | [m-abs](https://github.com/m-abs) | [sr3dna](https://github.com/sr3dna) | [mbaljeetsingh](https://github.com/mbaljeetsingh) | [dopsonbr](https://github.com/dopsonbr) |

[<img alt="kamilmysliwiec" src="https://avatars0.githubusercontent.com/u/23244943?v=4&s=117" width="117">](https://github.com/kamilmysliwiec) |[<img alt="madmath03" src="https://avatars3.githubusercontent.com/u/6967675?v=4&s=117" width="117">](https://github.com/madmath03) |[<img alt="miguelramos" src="https://avatars3.githubusercontent.com/u/495720?v=4&s=117" width="117">](https://github.com/miguelramos) |
:---: |:---: |:---: |
[kamilmysliwiec](https://github.com/kamilmysliwiec) |[madmath03](https://github.com/madmath03) |[miguelramos](https://github.com/miguelramos) |
| [<img alt="kamilmysliwiec" src="https://avatars0.githubusercontent.com/u/23244943?v=4&s=117" width="117">](https://github.com/kamilmysliwiec) | [<img alt="madmath03" src="https://avatars3.githubusercontent.com/u/6967675?v=4&s=117" width="117">](https://github.com/madmath03) | [<img alt="miguelramos" src="https://avatars3.githubusercontent.com/u/495720?v=4&s=117" width="117">](https://github.com/miguelramos) |
| :-------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------: |
| [kamilmysliwiec](https://github.com/kamilmysliwiec) | [madmath03](https://github.com/madmath03) | [miguelramos](https://github.com/miguelramos) |
4 changes: 1 addition & 3 deletions packages/angular/src/schematics/application/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,7 @@ function adjustAppFiles(options: Schema, tree: Tree) {
if (options.routing) {
// update home route to reflect with root cmp would have been
tree.overwrite(
`/apps/${directory}${
options.name
}/src/app/features/home/components/home.component.html`,
`/apps/${directory}${options.name}/src/app/features/home/components/home.component.html`,
appCmpHtml(options.name)
);
}
Expand Down
4 changes: 1 addition & 3 deletions packages/angular/src/schematics/component/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ export default function(options: XplatComponentHelpers.Schema) {
? adjustBarrelIndex(
'component',
options,
`libs/features/${componentSettings.featureName}/base/${
options.subFolder
}/index.ts`,
`libs/features/${componentSettings.featureName}/base/${options.subFolder}/index.ts`,
false,
true
)(tree, context)
Expand Down
8 changes: 2 additions & 6 deletions packages/angular/src/schematics/elements/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,7 @@ function updateWorkspaceSupport(
function createCustomElementList(componentSymbols) {
const customElements = ['let component;'];
for (const comp of componentSymbols) {
customElements.push(`component = createCustomElement(${
comp.symbol
}, { injector: this.injector });
customElements.push(`component = createCustomElement(${comp.symbol}, { injector: this.injector });
customElements.define('${comp.selector}', component);`);
}
return customElements.join('\n');
Expand All @@ -264,9 +262,7 @@ function updateBuilder(tree: Tree, options: ElementsOptions) {
`xplat/web/elements/builder/elements.ts`,
builderElementsContent(options.builderModule)
);
const moduleFilePath = `xplat/web/elements/${
options.builderModule
}.module.ts`;
const moduleFilePath = `xplat/web/elements/${options.builderModule}.module.ts`;
if (tree.exists(moduleFilePath)) {
const moduleFile = tree.get(moduleFilePath).content.toString();
const selectorParts = moduleFile.split('.define(');
Expand Down
16 changes: 4 additions & 12 deletions packages/angular/src/utils/xplat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,8 @@ export namespace ComponentHelpers {
if (platPrefix === platform || platSuffix === platform) {
const appDir = platform === 'web' ? '/app' : '';
const prefixPath = `apps/${projectName}/src${appDir}`;
const featurePath = `${prefixPath}/features/${
componentSettings.featureName
}`;
const featureModulePath = `${featurePath}/${
componentSettings.featureName
}.module.ts`;
const featurePath = `${prefixPath}/features/${componentSettings.featureName}`;
const featureModulePath = `${featurePath}/${componentSettings.featureName}.module.ts`;
const barrelIndex = `${featurePath}/components/index.ts`;
// console.log('will adjustProject:', projectName);
chains.push((tree: Tree, context: SchematicContext) => {
Expand Down Expand Up @@ -132,9 +128,7 @@ export namespace ComponentHelpers {
return adjustBarrelIndex(
'component',
options,
`xplat/${xplatFolderName}/features/${
componentSettings.featureName
}/components/${options.subFolder}/index.ts`,
`xplat/${xplatFolderName}/features/${componentSettings.featureName}/components/${options.subFolder}/index.ts`,
true
)(tree, context);
});
Expand Down Expand Up @@ -165,9 +159,7 @@ export namespace ComponentHelpers {
return adjustBarrelIndex(
'component',
options,
`xplat/${xplatFolderName}/features/${
componentSettings.featureName
}/components/index.ts`,
`xplat/${xplatFolderName}/features/${componentSettings.featureName}/components/index.ts`,
true,
false,
true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,7 @@ describe('app', () => {
// console.log(checkFile);
expect(
checkFile.indexOf(
`npm run prepare.electron.${
options.name
} && npm-run-all -p serve.electron.${
options.name
}.target serve.electron.${options.name}`
`npm run prepare.electron.${options.name} && npm-run-all -p serve.electron.${options.name}.target serve.electron.${options.name}`
)
).toBeGreaterThanOrEqual(0);
});
Expand Down
6 changes: 1 addition & 5 deletions packages/electron/src/schematics/application/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,7 @@ describe('app', () => {
// console.log(checkFile);
expect(
checkFile.indexOf(
`npm run prepare.electron.${
options.name
} && npm-run-all -p serve.electron.${
options.name
}.target serve.electron.${options.name}`
`npm run prepare.electron.${options.name} && npm-run-all -p serve.electron.${options.name}.target serve.electron.${options.name}`
)
).toBeGreaterThanOrEqual(0);
});
Expand Down
24 changes: 6 additions & 18 deletions packages/electron/src/utils/xplat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,38 +102,26 @@ export namespace XplatElectrontHelpers {
scripts['postinstall.web'] = 'node tools/web/postinstall';
scripts[
`build.${platformApp}`
] = `npm run prepare.${platformApp} && ng build ${
options.name
} --prod --base-href ./`;
] = `npm run prepare.${platformApp} && ng build ${options.name} --prod --base-href ./`;
scripts[
`build.${platformApp}.local`
] = `npm run build.${platformApp} && electron dist/apps/${options.name}`;
scripts[
`build.${platformApp}.linux`
] = `npm run build.${platformApp} && cd dist/apps/${
options.name
} && npx electron-builder build --linux`;
] = `npm run build.${platformApp} && cd dist/apps/${options.name} && npx electron-builder build --linux`;
scripts[
`build.${platformApp}.windows`
] = `npm run build.${platformApp} && cd dist/apps/${
options.name
} && npx electron-builder build --windows`;
] = `npm run build.${platformApp} && cd dist/apps/${options.name} && npx electron-builder build --windows`;
scripts[
`build.${platformApp}.mac`
] = `npm run build.${platformApp} && cd dist/apps/${
options.name
} && npx electron-builder build --mac`;
] = `npm run build.${platformApp} && cd dist/apps/${options.name} && npx electron-builder build --mac`;
scripts[
`prepare.${platformApp}`
] = `npm run postinstall.electron && tsc -p apps/${
options.name
}/tsconfig.json`;
] = `npm run postinstall.electron && tsc -p apps/${options.name}/tsconfig.json`;
scripts[`serve.${platformApp}.target`] = `nx serve ${options.name}`;
scripts[
`serve.${platformApp}`
] = `wait-on http-get://localhost:4200/ && electron apps/${
options.name
}/src --serve`;
] = `wait-on http-get://localhost:4200/ && electron apps/${options.name}/src --serve`;
scripts[
`start.${platformApp}`
] = `npm run prepare.${platformApp} && npm-run-all -p serve.${platformApp}.target serve.${platformApp}`;
Expand Down
36 changes: 15 additions & 21 deletions packages/ionic-angular/src/schematics/application/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,26 +82,22 @@ export default function(options: ApplicationOptions) {
] = `npm run clean && npm run clean.${platformApp} && npm run build.${platformApp}`;
scripts[
`prepare.${platformApp}.ios`
] = `npm run prepare.${platformApp} && cd apps/${directory}${
options.name
} && npm run cap.add.ios`;
] = `npm run prepare.${platformApp} && cd apps/${directory}${options.name} && npm run cap.add.ios`;
scripts[
`prepare.${platformApp}.android`
] = `npm run prepare.${platformApp} && cd apps/${directory}${
options.name
} && npm run cap.add.android`;
scripts[`open.${platformApp}.ios`] = `cd apps/${directory}${
options.name
} && npm run cap.ios`;
scripts[`open.${platformApp}.android`] = `cd apps/${directory}${
options.name
} && npm run cap.android`;
scripts[`sync.${platformApp}`] = `cd apps/${directory}${
options.name
} && npm run cap.copy`;
scripts[`clean.${platformApp}`] = `cd apps/${directory}${
options.name
} && npx rimraf -- hooks node_modules platforms www plugins ios android package-lock.json && npm i && rimraf -- package-lock.json`;
] = `npm run prepare.${platformApp} && cd apps/${directory}${options.name} && npm run cap.add.android`;
scripts[
`open.${platformApp}.ios`
] = `cd apps/${directory}${options.name} && npm run cap.ios`;
scripts[
`open.${platformApp}.android`
] = `cd apps/${directory}${options.name} && npm run cap.android`;
scripts[
`sync.${platformApp}`
] = `cd apps/${directory}${options.name} && npm run cap.copy`;
scripts[
`clean.${platformApp}`
] = `cd apps/${directory}${options.name} && npx rimraf -- hooks node_modules platforms www plugins ios android package-lock.json && npm i && rimraf -- package-lock.json`;
return updatePackageScripts(tree, scripts);
},
(tree: Tree, context: SchematicContext) => {
Expand Down Expand Up @@ -273,9 +269,7 @@ export default function(options: ApplicationOptions) {
},
configurations: {
production: {
cordovaBuildTarget: `${
options.name
}:ionic-cordova-build:production`,
cordovaBuildTarget: `${options.name}:ionic-cordova-build:production`,
devServerTarget: `${options.name}:serve:production`
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/ionic-angular/src/utils/versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ export const reflectMetadataVersion = '^0.1.12';
export const coreJsVersion = '^3.1.4';
export const rxjsVersion = '~6.4.0';
export const zonejsVersion = '~0.9.0';
export const codelyzerVersion = '~5.1.0';
export const codelyzerVersion = '~5.1.0';
44 changes: 20 additions & 24 deletions packages/ionic/src/schematics/application/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,37 +56,33 @@ export default function(options: Schema) {
scripts[
`clean`
] = `npx rimraf -- hooks node_modules package-lock.json && npm i`;
scripts[`start.${platformApp}`] = `cd apps/${directory}${
options.name
} && npm start`;
scripts[`build.${platformApp}`] = `cd apps/${directory}${
options.name
} && npm run build:ionic`;
scripts[
`start.${platformApp}`
] = `cd apps/${directory}${options.name} && npm start`;
scripts[
`build.${platformApp}`
] = `cd apps/${directory}${options.name} && npm run build:ionic`;
scripts[
`prepare.${platformApp}`
] = `npm run clean && npm run clean.${platformApp} && npm run build.${platformApp}`;
scripts[
`prepare.${platformApp}.ios`
] = `npm run prepare.${platformApp} && cd apps/${directory}${
options.name
} && npm run cap.add.ios`;
] = `npm run prepare.${platformApp} && cd apps/${directory}${options.name} && npm run cap.add.ios`;
scripts[
`prepare.${platformApp}.android`
] = `npm run prepare.${platformApp} && cd apps/${directory}${
options.name
} && npm run cap.add.android`;
scripts[`open.${platformApp}.ios`] = `cd apps/${directory}${
options.name
} && npm run cap.ios`;
scripts[`open.${platformApp}.android`] = `cd apps/${directory}${
options.name
} && npm run cap.android`;
scripts[`sync.${platformApp}`] = `cd apps/${directory}${
options.name
} && npm run cap.copy`;
scripts[`clean.${platformApp}`] = `cd apps/${directory}${
options.name
} && npx rimraf -- hooks node_modules platforms www plugins ios android package-lock.json && npm i && rimraf -- package-lock.json`;
] = `npm run prepare.${platformApp} && cd apps/${directory}${options.name} && npm run cap.add.android`;
scripts[
`open.${platformApp}.ios`
] = `cd apps/${directory}${options.name} && npm run cap.ios`;
scripts[
`open.${platformApp}.android`
] = `cd apps/${directory}${options.name} && npm run cap.android`;
scripts[
`sync.${platformApp}`
] = `cd apps/${directory}${options.name} && npm run cap.copy`;
scripts[
`clean.${platformApp}`
] = `cd apps/${directory}${options.name} && npx rimraf -- hooks node_modules platforms www plugins ios android package-lock.json && npm i && rimraf -- package-lock.json`;
return updatePackageScripts(tree, scripts);
},
(tree: Tree, context: SchematicContext) => {
Expand Down
24 changes: 12 additions & 12 deletions packages/nativescript-angular/src/schematics/application/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,18 @@ export default function(options: Schema) {
scripts[
`clean`
] = `npx rimraf -- hooks node_modules package-lock.json && npm i`;
scripts[`start.${platformApp}.ios`] = `cd apps/${directory}${
options.name
} && tns run ios --emulator`;
scripts[`start.${platformApp}.android`] = `cd apps/${directory}${
options.name
} && tns run android --emulator`;
scripts[`start.${platformApp}.preview`] = `cd apps/${directory}${
options.name
} && tns preview`;
scripts[`clean.${platformApp}`] = `cd apps/${directory}${
options.name
} && npx rimraf -- hooks node_modules platforms package-lock.json && npm i && npx rimraf -- package-lock.json`;
scripts[
`start.${platformApp}.ios`
] = `cd apps/${directory}${options.name} && tns run ios --emulator`;
scripts[
`start.${platformApp}.android`
] = `cd apps/${directory}${options.name} && tns run android --emulator`;
scripts[
`start.${platformApp}.preview`
] = `cd apps/${directory}${options.name} && tns preview`;
scripts[
`clean.${platformApp}`
] = `cd apps/${directory}${options.name} && npx rimraf -- hooks node_modules platforms package-lock.json && npm i && npx rimraf -- package-lock.json`;
return updatePackageScripts(tree, scripts);
},
(tree: Tree, context: SchematicContext) => {
Expand Down
Loading

0 comments on commit 528b4df

Please sign in to comment.