Skip to content

Commit

Permalink
Merge pull request #57 from openforge/production
Browse files Browse the repository at this point in the history
  • Loading branch information
ingrocha authored Mar 2, 2023
2 parents 6886239 + 1f1ee4c commit c012782
Show file tree
Hide file tree
Showing 9 changed files with 496 additions and 498 deletions.
8 changes: 8 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# compiled output
/dist
dist/
/tmp
/out-tsc

# dependencies
/node_modules
31 changes: 31 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"extends": "stylelint-config-standard-scss",
"rules": {
"scss/at-import-partial-extension": null,
"scss/comment-no-empty": null,
"scss/double-slash-comment-empty-line-before": null,
"scss/at-extend-no-missing-placeholder": null,
"no-invalid-position-at-import-rule": null,
"rule-empty-line-before": null,
"selector-no-vendor-prefix": null,
"alpha-value-notation": null,
"color-function-notation": null,
"scss/no-global-function-names": null,
"value-keyword-case": null,
"shorthand-property-no-redundant-values": null,
"scss/operator-no-unspaced": null,
"declaration-block-no-redundant-longhand-properties": null,
"keyframes-name-pattern": null,
"number-max-precision": null,
"scss/dollar-variable-empty-line-before": null,
"property-no-vendor-prefix": null,
"string-quotes": "single",
"max-empty-lines": 1,
"no-duplicate-selectors": true,
"scss/dollar-variable-pattern": "^[a-z\\d](?:[a-z\\d]|-(?=[a-z\\d]))*$",
"scss/selector-no-redundant-nesting-selector": true,
"declaration-empty-line-before": null,
"selector-pseudo-element-no-unknown": null,
"unit-disallowed-list": ["px"]
}
}
55 changes: 46 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# Mobile Game Template - Ionic & Phaser Monorepo

This is a template project for all you aspiring video game developers out there! Want to use your web application skills for creating an awesome video game?
This is a template project for all you aspiring video game developers out there! Want to use your web application skills for creating an awesome video game?

This repository will give you a great starting point!
This repository will give you a great starting point!

# Instructions

1. Clone the repository using 'Use template' (and don't forget to give us a Star / Follow on Github, please!)
2. Search + Replace all instances of 'example-app-angular-e2e' with your app name (important to do this first)
3. Search + Replace all instances of 'example-app-angular' with your app name
4. Change the folder names for example-app-angular and example-app-angular-e2e to what you named for steps #1 and #2
5. Search + Replace all instances of 'openforge-ionic-monorepo-example' with your project name
6. Search + Replace 'company-name' with your company name. This is the NX project scope that allows you to import libraries using @company-name
2. Select which framework from 'apps/' folder you are going to use and remove the others if necessary.
3. Search + Replace all instances of 'example-app-"frameworkName"-e2e' with your app name (important to do this first)
4. Search + Replace all instances of 'example-app-"frameworkName"' with your app name
5. Change the folder names for example-app-frameworkName and example-app-frameworkName-e2e to what you named for steps #1 and #2
6. Search + Replace all instances of 'openforge-ionic-monorepo-example' with your project name
7. Search + Replace 'company-name' with your company name. This is the NX project scope that allows you to import libraries using @company-name

That's it for the renaming! Now to test...

Expand All @@ -23,8 +24,9 @@ You should now load your example app!

# Checking Licenses

To run the license checker, use
To run the license checker, use
`npx license-checker --summary` or vanilla `npx license-checker`

# Important - Utilizing this Repo

Most of the commands to generate projects/capabilities/apps are default to NX, Ionic, or Angular (in that order), so we will NOT include their specific instructions since as the packages update so will the documentation.
Expand All @@ -43,6 +45,42 @@ The normal NX command to generate an app is `nx g @nrwl/react:app my-app` ; howe

When using Nx, you can create multiple applications and libraries in the same workspace.

## Generate a VUE application

Since Nx doesn't *officially* support Vue, we configured this project to make it work for you 😎

Nx supports Vite [Visit Nx Official docs for Vite](https://nx.dev/packages/vite) to learn more, and Vite supports Vue, so we used this configs to run Vue into our monorepos!

1. Run `npm create vite@latest my-vue-app -- --template vue`.
2. Run `cd my-vue-app && npm install`.
3. Go to `apps/my-vue-app` and create a new `project.json`.
4. Copy the `properties` from the `project.json` file from `apps/example-vue-app` and paste it inside the new `project.json` file generated for the new Vue application in the step 3.
5. Inside the new `project.json` file generated, replace all `example-app-vue` instances with the name of your Vue app created in step 1.
6. Now you just need to `extends` the `tsconfig.base.json` root file in your `tsconfig.json` Vue application file by adding `"extends": "../../tsconfig.base.json"` at the top of the array.

And that's it! You will be able to run and serve your Vue application by running `nx serve your-app-name` (where your-app-name is the name of the application you created).

## Adding Capacitor to your application

We are using Capacitor to run the project in mobile. We configured Capacitor to be able to run in monorepos, so if you want to add capacitor into your application follow this steps:

1. Make sure you have run `nx build your-app-name` (Where `your-app-name` will be the name of your application).
2. Make sure your application has the `package.json` created, if not create one at the root of you application folder `apps/your-application-folder` and add the folowing properties: `"name": your-app-name`, `"version": "0.0.0"`, `"licence: "MIT""`, `"private: true"`, `"dependencies: {}"`, `"devDependencies": {}` (where `your-app-name` will be replaced with your currently application name).
3. Go to `apps/your-app-name` and run `npm install @capacitor/cli --save-dev`, then run `npm install @capacitor/core`.
4. Nowe it's time to initialize Capacitor. Go to `apps/your-app-name` and run `npx cap init`.
5. In the project root folder, search for the `ionic.config.json` file and add `your-app-name` as a new project in the `projects` array. You can copy&paste the example one and just replace all instances.

## Adding a Capacitor Platform to your application

1. At the root of your project, run `ionic capacitor add platform --project=your-app-name` (Where `platform` could be `ios` | `android`) (Where `your-project-name` will be the project name you set into the `ionic.config.json` file).

## Running your application with Capacitor

1. Run `nx build your-app-name` (Where `your-app-name` will be the name of your application).
2. Run `cd apps/your-app-name && npx cap copy`.
3. Run `cd apps/your-app-name && npx cap sync`.
4. Run `cd apps/your-app-name && npx cap open platform`. (Where `platform` could be `ios` | `android`)

# NX Original Instructions

## Further help
Expand Down Expand Up @@ -84,4 +122,3 @@ Run `nx affected:e2e` to execute the end-to-end tests affected by a change.
## Understand your workspace

Run `nx dep-graph` to see a diagram of the dependencies of your projects.

26 changes: 13 additions & 13 deletions apps/example-app-angular/src/app/home/home.page.scss
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
#container {
text-align: center;
position: absolute;
left: 0;
right: 0;
top: 50%;
transform: translateY(-50%);
text-align: center;
position: absolute;
left: 0;
right: 0;
top: 50%;
transform: translateY(-50%);
}

#container strong {
font-size: 20px;
line-height: 26px;
font-size: 1.25rem;
line-height: 1.625rem;
}

#container p {
font-size: 16px;
line-height: 22px;
color: #8c8c8c;
margin: 0;
font-size: 1rem;
line-height: 1.375rem;
color: #8c8c8c;
margin: 0;
}

#container a {
text-decoration: none;
text-decoration: none;
}
16 changes: 8 additions & 8 deletions apps/example-app-angular/src/app/shop/shop.component.scss
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
.inventory-list {
display:flex;
display: flex;
}

ion-card-content {
height:250px;
height: 15.625rem;
}

ion-card {
width: 50%;
img {
width: 50%;
img {
width: 50%;
margin: auto;
display: block;
}
}
margin: auto;
display: block;
}
}
2 changes: 1 addition & 1 deletion apps/example-app-angular/src/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
@import '~@ionic/angular/css/float-elements.css';
@import '~@ionic/angular/css/text-alignment.css';
@import '~@ionic/angular/css/text-transformation.css';
@import '~@ionic/angular/css/flex-utils.css';
@import '~@ionic/angular/css/flex-utils.css';
Loading

0 comments on commit c012782

Please sign in to comment.