-
-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1103 from nxext/crystal-ionic-capacitor
- Loading branch information
Showing
136 changed files
with
6,318 additions
and
8,830 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,6 @@ | |
/build | ||
|
||
/.nx/cache | ||
/.nx/workspace-data | ||
/.nx/workspace-data | ||
|
||
pnpm-lock.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
## @nxext/capacitor:cap | ||
|
||
Run a Capacitor command | ||
|
||
Options can be configured in the 'project.json' when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. | ||
|
||
### Options | ||
|
||
#### cmd | ||
|
||
Type: `string` | ||
|
||
The Capacitor command. | ||
|
||
#### preserveProjectNodeModules | ||
|
||
Type: `boolean` | ||
|
||
Preserve the node_modules folder inside the project dir. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
## @nxext/capacitor:configuration | ||
|
||
Configure Capacitor for an Nx project | ||
|
||
### Usage | ||
|
||
```bash | ||
nx generate configuration ... | ||
``` | ||
|
||
By default, Nx will search for `configuration` in the default collection provisioned in nx.json. | ||
|
||
You can specify the collection explicitly as follows: | ||
|
||
```bash | ||
nx g @nxext/capacitor:configuration ... | ||
``` | ||
|
||
Show what will be generated without writing to disk: | ||
|
||
```bash | ||
nx g configuration ... --dry-run | ||
``` | ||
|
||
### Options | ||
|
||
#### project (_**required**_) | ||
|
||
Alias(es): p | ||
|
||
Type: `string` | ||
|
||
The name of the frontend project for Capacitor. | ||
|
||
#### appId | ||
|
||
Default: `io.ionic.starter` | ||
|
||
Type: `string` | ||
|
||
The app ID for the project. | ||
|
||
#### appName | ||
|
||
Type: `string` | ||
|
||
The application name for the project. | ||
|
||
#### skipFormat | ||
|
||
Default: `false` | ||
|
||
Type: `boolean` | ||
|
||
Skip formatting files. | ||
|
||
#### webDir | ||
|
||
Type: `string` | ||
|
||
The directory of your projects built web assets. |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
## @nxext/ionic-angular:configuration | ||
|
||
Configure Ionic for an Angular application. | ||
|
||
### Usage | ||
|
||
```bash | ||
nx generate configuration ... | ||
``` | ||
|
||
By default, Nx will search for `configuration` in the default collection provisioned in nx.json. | ||
|
||
You can specify the collection explicitly as follows: | ||
|
||
```bash | ||
nx g @nxext/ionic-angular:configuration ... | ||
``` | ||
|
||
Show what will be generated without writing to disk: | ||
|
||
```bash | ||
nx g configuration ... --dry-run | ||
``` | ||
|
||
### Options | ||
|
||
#### project (_**required**_) | ||
|
||
Type: `string` | ||
|
||
The name of the project. | ||
|
||
#### capacitor | ||
|
||
Default: `true` | ||
|
||
Type: `boolean` | ||
|
||
Generate a Capacitor project. | ||
|
||
#### skipFormat | ||
|
||
Default: `false` | ||
|
||
Type: `boolean` | ||
|
||
Skip formatting files. |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
## @nxext/ionic-react:configuration | ||
|
||
Configure Ionic for a React application. | ||
|
||
### Usage | ||
|
||
```bash | ||
nx generate configuration ... | ||
``` | ||
|
||
By default, Nx will search for `configuration` in the default collection provisioned in nx.json. | ||
|
||
You can specify the collection explicitly as follows: | ||
|
||
```bash | ||
nx g @nxext/ionic-react:configuration ... | ||
``` | ||
|
||
Show what will be generated without writing to disk: | ||
|
||
```bash | ||
nx g configuration ... --dry-run | ||
``` | ||
|
||
### Options | ||
|
||
#### project (_**required**_) | ||
|
||
Type: `string` | ||
|
||
The name of the project. | ||
|
||
#### capacitor | ||
|
||
Default: `true` | ||
|
||
Type: `boolean` | ||
|
||
Generate a Capacitor project. | ||
|
||
#### skipFormat | ||
|
||
Default: `false` | ||
|
||
Type: `boolean` | ||
|
||
Skip formatting files. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
# Changelog | ||
|
||
# 13.0.0 | ||
|
||
## Features | ||
|
||
- support Nx 13 | ||
|
||
# 12.1.0 | ||
|
||
## Features | ||
|
||
- restore Angular CLI support | ||
|
||
# 12.0.0 | ||
|
||
## Features | ||
|
||
- support Nx 12 | ||
- plugin rewritten with `@nx/devkit` for better maintainability and future proofing for future Nx versions | ||
- update Capacitor to 3.2.5 | ||
- add Capacitor `run` target (requires Capacitor 3) | ||
|
||
## BREAKING CHANGES | ||
|
||
- Angular CLI is no longer officially supported | ||
- `add-plugin` schematic has been removed | ||
- the `init` generator has been removed and the functionaltiy has been moved to the `application` schematic | ||
|
||
# 11.1.1 | ||
|
||
## Bug Fixes | ||
|
||
- support Nx 11.3.0 | ||
|
||
# 11.1.0 | ||
|
||
## Features | ||
|
||
- support quotes in `cap` builder `cmd` option (useful for passing additional options for Capacitor commands) | ||
|
||
# 11.0.2 | ||
|
||
## Bug Fixes | ||
|
||
- support `angular.json` as well as `workspace.json` during migrations | ||
|
||
# 11.0.1 | ||
|
||
## Bug Fixes | ||
|
||
- fix 11.0.0 workspace migration | ||
|
||
# 11.0.0 | ||
|
||
## Features | ||
|
||
- Nx 11 support (Nx 11 now required) | ||
- update Capacitor to 2.4.5 | ||
- added `cap` builder for a more generic interface with the Capacitor CLI | ||
|
||
## BREAKING CHANGES | ||
|
||
- the `command` builder has been removed | ||
|
||
# 2.0.2 | ||
|
||
# Fixes | ||
|
||
- fix Windows support | ||
|
||
# Features | ||
|
||
- update Capacitor to 2.4.2 | ||
- add Capacitor configs to frontend application | ||
- add or update `package.json` in project folder when generating a Capacitor project | ||
- add builder configurations for Nx Console | ||
- add `add-plugin` schematic for adding Capacitor plugins | ||
|
||
# BREAKING CHANGES | ||
|
||
- Capacitor plugins must now be added to both the root and project-level `package.json` | ||
|
||
# 1.1.0 | ||
|
||
## Features | ||
|
||
- upgrade Capacitor to 2.4.0 | ||
- copy package.json from workspace root for cap commands |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Migration | ||
|
||
# 1.x.x - 2.0.0 | ||
|
||
## Move Capacitor Configs | ||
|
||
With `@nxext/capacitor` 2.0+, Capacitor configurations will be added to the associated frontend project instead of creating a dedicated Capacitor project. Migrating to this new paradigm is trivial and takes just a few steps. | ||
|
||
First, add a new set of Capacitor configs to your frontend project. | ||
|
||
``` | ||
nx g @nxext/capacitor:capacitor-project --project my-app | ||
``` | ||
|
||
Move `capacitor.config.json` from the Capacitor project to the root of the associated frontend project. You will have to overwrite the `capacitor.config.json` that was just generated. | ||
|
||
Move all platform folders (`android`, `ios`, `electron`) from the Capacitor project to the root of the frontend project. | ||
|
||
You should now test the Capacitor commands for the frontend project and ensure the project works as expected. | ||
|
||
``` | ||
nx run my-app:sync --platform ios | ||
nx run my-app:open --platform ios | ||
``` | ||
|
||
If everything works as expected then you can safely remove the Capacitor project. | ||
|
||
``` | ||
nx g @nx/workspace:remove my-app | ||
``` | ||
|
||
The `@capacitor/cli` dependency in the root `package.json` is also no longer needed and can be removed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# capacitor | ||
|
||
This library was generated with [Nx](https://nx.dev). | ||
|
||
## Building | ||
|
||
Run `nx build capacitor` to build the library. | ||
|
||
## Running unit tests | ||
|
||
Run `nx test capacitor` to execute the unit tests via [Jest](https://jestjs.io). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
const { FlatCompat } = require('@eslint/eslintrc'); | ||
const baseConfig = require('../../eslint.config.js'); | ||
const js = require('@eslint/js'); | ||
const compat = new FlatCompat({ | ||
baseDirectory: __dirname, | ||
recommendedConfig: js.configs.recommended, | ||
}); | ||
module.exports = [ | ||
...baseConfig, | ||
{ | ||
files: [ | ||
'packages/capacitor/**/*.ts', | ||
'packages/capacitor/**/*.tsx', | ||
'packages/capacitor/**/*.js', | ||
'packages/capacitor/**/*.jsx', | ||
], | ||
rules: {}, | ||
}, | ||
{ | ||
files: ['packages/capacitor/**/*.ts', 'packages/capacitor/**/*.tsx'], | ||
rules: {}, | ||
}, | ||
{ | ||
files: ['packages/capacitor/**/*.js', 'packages/capacitor/**/*.jsx'], | ||
rules: {}, | ||
}, | ||
...compat.config({ parser: 'jsonc-eslint-parser' }).map((config) => ({ | ||
...config, | ||
files: [ | ||
'packages/capacitor/package.json', | ||
'packages/capacitor/generators.json', | ||
'packages/capacitor/executors.json', | ||
'packages/capacitor/generators.json', | ||
'packages/capacitor/executors.json', | ||
'packages/capacitor/migrations.json', | ||
], | ||
rules: { '@nx/nx-plugin-checks': 'error' }, | ||
})), | ||
]; |
Oops, something went wrong.