Skip to content

Commit b4b6396

Browse files
committed
refactor
1 parent 12863c7 commit b4b6396

File tree

7 files changed

+286
-306
lines changed

7 files changed

+286
-306
lines changed

.github/workflows/publish.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Publishing
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- develop
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version: 20
17+
registry-url: 'https://registry.npmjs.org'
18+
- run: npm i
19+
- name: Release
20+
if: github.ref_name == 'master'
21+
run: npm publish --access public
22+
env:
23+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
24+
- name: Next
25+
if: github.ref_name == 'develop'
26+
run: npm publish --access public --tag next
27+
env:
28+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

README.md

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# Chooser
22

3+
## Demo
4+
[cordova-plugin-chooser-lab](https://github.com/MaximBelov/cordova-plugin-chooser-lab)
5+
36
## Overview
47

58
File chooser plugin for Cordova.
69

710
Install with Cordova CLI:
811

9-
$ cordova plugin add cordova-plugin-chooser
12+
$ cordova plugin add @herdwatch/cordova-plugin-chooser
1013

1114
Supported Platforms:
1215

@@ -19,37 +22,22 @@ Supported Platforms:
1922
/**
2023
* Displays native prompt for user to select a file.
2124
*
22-
* @param accept Optional MIME type filter (e.g. 'image/gif,video/*').
23-
*
24-
* @returns Promise containing selected file's raw binary data,
25-
* base64-encoded data: URI, MIME type, display name, and original URI.
26-
*
27-
* If user cancels, promise will be resolved as undefined.
28-
* If error occurs, promise will be rejected.
29-
*/
30-
chooser.getFile(accept?: string) : Promise<undefined|{
31-
data: Uint8Array;
32-
dataURI: string;
33-
mediaType: string;
34-
name: string;
35-
uri: string;
36-
}>
37-
38-
/**
39-
* Displays native prompt for user to select a file.
40-
*
41-
* @param accept Optional MIME type filter (e.g. 'image/gif,video/*').
25+
* @param {Object} options
26+
* @param {string} options.mimeTypes Optional MIME type filter (e.g. 'image/gif,video/*')
27+
* @param {number} options.maxFileSize
4228
*
43-
* @returns Promise containing selected file's MIME type, display name,
44-
* and original URI.
29+
* @returns Promise containing selected file's
30+
* path, display name, MIME type, , and original URI.
4531
*
4632
* If user cancels, promise will be resolved as undefined.
4733
* If error occurs, promise will be rejected.
4834
*/
49-
chooser.getFileMetadata(accept?: string) : Promise<undefined|{
50-
mediaType: string;
35+
chooser.getFile(options?: {}) : Promise<undefined|{
36+
path: string;
5137
name: string;
52-
uri: string;
38+
mimeType: string;
39+
extension: string;
40+
size: number;
5341
}>
5442

5543
## Example Usage

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"name": "cordova-plugin-chooser",
3-
"version": "1.3.2",
2+
"name": "@herdwatch/cordova-plugin-chooser",
3+
"version": "1.4.0",
44
"description": "Cordova file chooser plugin",
55
"main": "index.js",
66
"repository": {
77
"type": "git",
8-
"url": "git+https://github.com/cyph/cordova-plugin-chooser.git"
8+
"url": "git+https://github.com/herdwatch-apps/cordova-plugin-chooser.git"
99
},
1010
"keywords": [
1111
"file",
@@ -18,10 +18,10 @@
1818
"author": "Cyph, Inc. <[email protected]> (https://github.com/cyph)",
1919
"license": "Apache-2.0",
2020
"bugs": {
21-
"url": "https://github.com/cyph/cordova-plugin-chooser/issues"
21+
"url": "https://github.com/herdwatch-apps/cordova-plugin-chooser/issues"
2222
},
2323
"cordova": {
24-
"id": "cordova-plugin-chooser",
24+
"id": "@herdwatch/cordova-plugin-chooser",
2525
"platforms": [
2626
"android",
2727
"ios"

plugin.xml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<plugin
3-
xmlns="http://www.phonegap.com/ns/plugins/1.0"
4-
xmlns:android="http://schemas.android.com/apk/res/android"
5-
id="cordova-plugin-chooser"
6-
version="1.3.1"
7-
>
2+
<plugin
3+
xmlns="http://www.phonegap.com/ns/plugins/1.0"
4+
xmlns:android="http://schemas.android.com/apk/res/android"
5+
id="@herdwatch/cordova-plugin-chooser"
6+
version="1.4.0"
7+
>
88
<name>Chooser</name>
99
<author>Cyph, Inc.</author>
1010

@@ -24,7 +24,6 @@
2424

2525
<platform name="ios">
2626
<source-file src="src/ios/Chooser.swift" />
27-
<dependency id="cordova-plugin-add-swift-support" version="*" />
2827

2928
<config-file target="config.xml" parent="/*">
3029
<feature name="Chooser">

0 commit comments

Comments
 (0)