You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This guide provides instructions for contributing to this Capacitor plugin.
4
+
5
+
## Native code
6
+
7
+
This repository contains minimal code for native Android and iOS. The implementation for native mobile exists in separate repositories:
8
+
9
+
-[Contributing for Android](https://github.com/ionic-team/ion-android-fileviewer?tab=readme-ov-file#contributing)
10
+
-[Contributing for iOS](https://github.com/ionic-team/ion-ios-fileviewer?tab=readme-ov-file#contributing)
11
+
12
+
## Developing
13
+
14
+
### Local Setup
15
+
16
+
1. Fork and clone the repo, uncheking the clone `main` branch only option.
17
+
2. If you plan to create a new feature or fix a bug, checkout `development` branch (in general Pull Requests should be open for that branch).
18
+
3. Install the dependencies.
19
+
20
+
```shell
21
+
npm install
22
+
```
23
+
24
+
4. Install SwiftLint if you're on macOS.
25
+
26
+
```shell
27
+
brew install swiftlint
28
+
```
29
+
30
+
### Scripts
31
+
32
+
#### `npm run build`
33
+
34
+
Build the plugin web assets and generate plugin API documentation using [`@capacitor/docgen`](https://github.com/ionic-team/capacitor-docgen).
35
+
36
+
It will compile the TypeScript code from `src/` into ESM JavaScript in `dist/esm/`. These files are used in apps with bundlers when your plugin is imported.
37
+
38
+
Then, Rollup will bundle the code into a single file at `dist/plugin.js`. This file is used in apps without bundlers by including it as a script in `index.html`.
39
+
40
+
#### `npm run verify`
41
+
42
+
Build and validate the web and native projects.
43
+
44
+
This is useful to run in CI to verify that the plugin builds for all platforms.
45
+
46
+
#### `npm run lint` / `npm run fmt`
47
+
48
+
Check formatting and code quality, autoformat/autofix if possible.
49
+
50
+
This template is integrated with ESLint, Prettier, and SwiftLint. Using these tools is completely optional, but the [Capacitor Community](https://github.com/capacitor-community/) strives to have consistent code style and structure for easier cooperation.
51
+
52
+
## Commits/PR's
53
+
54
+
Commits and PR's should use the [conventional-commits](https://www.conventionalcommits.org/) format so the release process can version and create changelog correctly.
55
+
56
+
## Publishing
57
+
58
+
Publishing is automated based on the branch committed to. When a commit or merge is made to a branch a release that corresponds with the branch will be created:
59
+
60
+
| Branch Name | Build Type | NPM Tag | Example NPM Version |
| development | dev | dev |@capacitor/file-viewer@1.0.0-dev.1 |
63
+
| next | next (these are betas/alphas) | next |@capacitor/file-viewer@1.0.0-next.1 |
64
+
| main | latest | latest |@capacitor/file-viewer@1.0.0 |
65
+
66
+
- Dev work should be done by creating and merging PR's into the `development` branch until a feature set is complete enough to form a release.
67
+
- When a feature set is complete enough to form a release, merge the `development` branch into the `next` branch where it becomes a beta/alpha tagged under `next` for testing teams to use before full release. In case a PR is opened from `development` to `next`, avoid squashing the commits, to keep the history.
68
+
- Upon completed testing the `next` branch is merged into `main` for a full release to be made. In case a PR is opened from `next` to `main`, avoid squashing the commits, to keep the history.
69
+
- The `main` branch should then be merged into `dev` and `next` to keep them up to date with the latest code base.
70
+
71
+
> **Note**: The [`files`](https://docs.npmjs.com/cli/v7/configuring-npm/package-json#files) array in `package.json` specifies which files get published. If you rename files/directories or add files elsewhere, you may need to update it.
0 commit comments