chore: clean up legacy references and unused code

Update renovate.json for current dependencies. Remove Commitizen badge
from README. Replace @ionic-native imports with @awesome-cordova-plugins
in plugin JSDoc examples. Fill in Kommunicate documentation links.
Add modern package exports to published plugin packages. Remove unused
shipit script and release-please scripts.
This commit is contained in:
Daniel Sogl
2026-03-21 15:11:40 -07:00
parent 01f6257ebf
commit aaae9fc277
27 changed files with 106 additions and 210 deletions
-4
View File
@@ -1,4 +0,0 @@
scripts/
docs/
dist/
node_modules/
-13
View File
@@ -1,13 +0,0 @@
{
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "jsdoc"],
"extends": ["plugin:@typescript-eslint/recommended", "prettier", "plugin:jsdoc/recommended"],
"rules": {
"@typescript-eslint/no-unused-vars": ["off"],
"@typescript-eslint/no-explicit-any": ["warn"],
"@typescript-eslint/no-empty-function": ["off"],
"@typescript-eslint/ban-types": ["warn"],
"@typescript-eslint/no-empty-interface": ["warn"],
"@typescript-eslint/no-namespace": ["off"]
}
}
-1
View File
@@ -1 +0,0 @@
_
-1
View File
@@ -1 +0,0 @@
npx --no-install lint-staged
-1
View File
@@ -1 +0,0 @@
npm test
+1 -1
View File
@@ -4,7 +4,7 @@ node_modules
.vscode
dist
CHANGELOG.md
.husky
lefthook.yml
.prettierignore
LICENSE
docs/
+1 -1
View File
@@ -1,4 +1,4 @@
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) ![](https://img.shields.io/npm/v/@awesome-cordova-plugins/core.svg)
![](https://img.shields.io/npm/v/@awesome-cordova-plugins/core.svg)
# Awesome Cordova Plugins
-38
View File
@@ -1,38 +0,0 @@
'use strict';
const gulp = require('gulp'),
minimist = require('minimist'),
rename = require('gulp-rename'),
replace = require('gulp-replace'),
_ = require('lodash');
const flagConfig = {
string: ['port', 'version', 'ngVersion', 'animations'],
boolean: ['dry-run'],
alias: { p: 'port', v: 'version', a: 'ngVersion' },
default: { port: 8000 },
},
flags = minimist(process.argv.slice(2), flagConfig);
/* Docs tasks */
require('./scripts/docs/gulp-tasks')(gulp, flags);
gulp.task('plugin:create', () => {
if (flags.n && flags.n !== '') {
const src = flags.m ? './scripts/templates/wrap-min.tmpl' : './scripts/templates/wrap.tmpl',
pluginName = flags.n,
spaced = pluginName.replace(/(?!^)([A-Z])/g, ' $1'),
kebabCase = _.kebabCase(pluginName);
return gulp
.src(src)
.pipe(replace('{{ PluginName }}', pluginName))
.pipe(replace('{{ Plugin_Name }}', spaced))
.pipe(replace('{{ pluginName }}', _.lowerFirst(pluginName)))
.pipe(replace('{{ plugin-name }}', kebabCase))
.pipe(rename('index.ts'))
.pipe(gulp.dest('./src/@awesome-cordova-plugins/plugins/' + kebabCase));
} else {
console.log('Usage is: gulp plugin:create -n PluginName');
}
});
-8
View File
@@ -1,8 +0,0 @@
module.exports = {
printWidth: 120,
tabWidth: 2,
useTabs: false,
semi: true,
singleQuote: true,
trailingComma: 'es5',
};
+9 -43
View File
@@ -48,31 +48,22 @@
"groupName": "linting and formatting",
"automerge": true,
"platformAutomerge": true,
"matchPackageNames": [
"/^eslint/",
"/^prettier/",
"/^husky/",
"/^lint-staged/"
]
"matchPackageNames": ["/^eslint/", "/^@eslint//", "/^prettier/", "lefthook", "typescript-eslint"]
},
{
"groupName": "Angular",
"allowedVersions": "<=12",
"allowedVersions": "<=20",
"automerge": false,
"matchPackageNames": [
"/^@angular//",
"/^@angular-devkit//",
"/@schematics/angular/"
]
"matchPackageNames": ["/^@angular//", "/^@angular-devkit//", "/@schematics/angular/"]
},
{
"matchPackageNames": ["zone.js"],
"allowedVersions": "<=11",
"allowedVersions": "<=15",
"automerge": false
},
{
"matchPackageNames": ["typescript", "ts-node"],
"allowedVersions": "<=4",
"matchPackageNames": ["typescript"],
"allowedVersions": "<=5",
"groupName": "TypeScript core",
"automerge": false
},
@@ -80,44 +71,19 @@
"groupName": "Build and bundling tools",
"automerge": true,
"platformAutomerge": true,
"matchPackageNames": [
"rollup",
"webpack",
"terser-webpack-plugin",
"unminified-webpack-plugin",
"rimraf"
]
"matchPackageNames": ["rollup", "tsx"]
},
{
"groupName": "Testing framework",
"automerge": true,
"platformAutomerge": true,
"matchPackageNames": ["jest", "ts-jest", "@types/jest"]
"matchPackageNames": ["jest", "@swc/jest", "@swc/core", "@types/jest", "jest-environment-jsdom"]
},
{
"groupName": "Documentation tools",
"automerge": true,
"platformAutomerge": true,
"matchPackageNames": [
"dgeni",
"dgeni-packages",
"gulp",
"gulp-rename",
"gulp-replace"
]
},
{
"groupName": "Utility libraries",
"automerge": true,
"platformAutomerge": true,
"matchPackageNames": [
"lodash",
"@types/lodash",
"fs-extra",
"@types/fs-extra",
"minimist",
"winston"
]
"matchPackageNames": ["typedoc", "typedoc-plugin-markdown"]
},
{
"matchManagers": ["npm"],
-13
View File
@@ -1,13 +0,0 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"moduleResolution": "node",
"noImplicitAny": false,
"lib": ["es6"],
"paths": {
"@awesome-cordova-plugins/core": ["../src/@awesome-cordova-plugins/core"]
}
},
"exclude": ["node_modules"]
}
@@ -140,7 +140,7 @@ export class AppPreferences extends AwesomeCordovaNativePlugin {
@Cordova({
platforms: ['iOS', 'Windows', 'Windows Phone 8'],
})
cloudSync(): Object {
cloudSync(): object {
return;
}
@@ -153,7 +153,7 @@ export class AppPreferences extends AwesomeCordovaNativePlugin {
@Cordova({
platforms: ['iOS', 'Windows', 'Windows Phone 8'],
})
defaults(): Object {
defaults(): object {
return;
}
}
@@ -725,7 +725,7 @@ export class HTTP extends AwesomeCordovaNativePlugin {
}
@Cordova({ sync: false })
approovGetDeviceID(): Promise<String> {
approovGetDeviceID(): Promise<string> {
return;
}
@@ -735,22 +735,22 @@ export class HTTP extends AwesomeCordovaNativePlugin {
}
@Cordova({ sync: false })
approovFetchToken(url: string): Promise<String> {
approovFetchToken(url: string): Promise<string> {
return;
}
@Cordova({ sync: false })
approovGetMessageSignature(message: string): Promise<String> {
approovGetMessageSignature(message: string): Promise<string> {
return;
}
@Cordova({ sync: false })
approovFetchSecureString(key: string, newDef: string): Promise<String> {
approovFetchSecureString(key: string, newDef: string): Promise<string> {
return;
}
@Cordova({ sync: false })
approovFetchCustomJWT(payload: string): Promise<String> {
approovFetchCustomJWT(payload: string): Promise<string> {
return;
}
}
@@ -208,5 +208,5 @@ export class Appsflyer extends AwesomeCordovaNativePlugin {
* @param {Object} options Additional Parameters to track
*/
@Cordova({ sync: true })
logCrossPromotionAndOpenStore(appId: string, campaign: string, options: Object): void {}
logCrossPromotionAndOpenStore(appId: string, campaign: string, options: object): void {}
}
@@ -208,7 +208,11 @@ export interface IContactField {
* @hidden
*/
export class ContactField implements IContactField {
constructor(public type?: string, public value?: string, public pref?: boolean) {}
constructor(
public type?: string,
public value?: string,
public pref?: boolean
) {}
}
export interface IContactAddress {
@@ -307,7 +311,7 @@ export class ContactFindOptions implements IContactFindOptions {
* @usage
*
* ```typescript
* import { Contacts, Contact, ContactField, ContactName } from '@ionic-native/contacts/ngx';
* import { Contacts, Contact, ContactField, ContactName } from '@awesome-cordova-plugins/contacts/ngx';
*
* constructor(private contacts: Contacts) { }
*
@@ -396,7 +396,7 @@ export class Facebook extends AwesomeCordovaNativePlugin {
* @param {Object} userData An object containing data about the user
*/
@Cordova()
setUserData(userData: Object): Promise<void> {
setUserData(userData: object): Promise<void> {
return;
}
@@ -420,7 +420,7 @@ export class Facebook extends AwesomeCordovaNativePlugin {
successIndex: 3,
errorIndex: 4,
})
logEvent(name: string, params?: Object, valueToSum?: number): Promise<any> {
logEvent(name: string, params?: object, valueToSum?: number): Promise<any> {
return;
}
@@ -466,7 +466,7 @@ export class Facebook extends AwesomeCordovaNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
logPurchase(value: number, currency: string, params?: Object): Promise<any> {
logPurchase(value: number, currency: string, params?: object): Promise<any> {
return;
}
@@ -401,7 +401,7 @@ export class FbSdk extends AwesomeCordovaNativePlugin {
* @param {Object} userData An object containing data about the user
*/
@Cordova()
setUserData(userData: Object): Promise<void> {
setUserData(userData: object): Promise<void> {
return;
}
@@ -425,7 +425,7 @@ export class FbSdk extends AwesomeCordovaNativePlugin {
successIndex: 3,
errorIndex: 4,
})
logEvent(name: string, params?: Object, valueToSum?: number): Promise<any> {
logEvent(name: string, params?: object, valueToSum?: number): Promise<any> {
return;
}
@@ -471,7 +471,7 @@ export class FbSdk extends AwesomeCordovaNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
logPurchase(value: number, currency: string, params?: Object): Promise<any> {
logPurchase(value: number, currency: string, params?: object): Promise<any> {
return;
}
@@ -51,7 +51,7 @@ export class FirebaseModelInput {
* @description This plugin downloads the TensorFlow model from firebase and classify the images.
*
* ```typescript
* import { FirebaseModel } from '@ionic-native/ionic-native-firebase-model';
* import { FirebaseModel } from '@awesome-cordova-plugins/firebase-model';
*
*
* constructor(private firebaseModel: FirebaseModel) { }
@@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';
import { AwesomeCordovaNativePlugin, Cordova, Plugin } from '@awesome-cordova-plugins/core';
const hypertrackIonicPluginVersion = "0.2.0"
const hypertrackIonicPluginVersion = '0.2.0';
// Minimal cordova-plugin-hypertrack-v3 version: 0.5.0
@Plugin({
pluginName: 'cordova-plugin-hypertrack-v3',
@@ -42,7 +42,7 @@ interface SuccessHandler {
(): any;
}
interface LocationReceiver {
(location: CordovaLatestLocationResult): any;
(location: CordovaLatestLocationResult): any;
}
// SDK instance that exposed from Cordova utilizes usage of callbacks, so we
@@ -51,7 +51,7 @@ interface HyperTrackCordova {
getDeviceId(success: DeviceIdReceiver, error: FailureHandler): void;
isRunning(success: TrackingStateReceiver, error: FailureHandler): void;
setDeviceName(name: string, success: SuccessHandler, error: FailureHandler): void;
setDeviceMetadata(metadata: Object, success: SuccessHandler, error: FailureHandler): void;
setDeviceMetadata(metadata: object, success: SuccessHandler, error: FailureHandler): void;
setTrackingNotificationProperties(
title: string,
message: string,
@@ -59,7 +59,7 @@ interface HyperTrackCordova {
error: FailureHandler
): void;
addGeoTag(
geotagData: Object,
geotagData: object,
expectedLocation: Coordinates | undefined,
success: SuccessHandler,
error: FailureHandler
@@ -77,7 +77,10 @@ export class CoordinatesValidationError extends Error {}
/** Wrapper class for passing spatial geoposition as a geotag's expected location */
export class Coordinates {
constructor(public latitude: number, public longitude: number) {
constructor(
public latitude: number,
public longitude: number
) {
if (latitude < -90.0 || latitude > 90.0 || longitude < -180.0 || longitude > 180.0) {
throw new CoordinatesValidationError('latitude and longitude should be of correct values');
}
@@ -85,7 +88,7 @@ export class Coordinates {
public toString = (): string => {
return JSON.stringify(this);
}
};
}
/** A blocker is an obstacle that needs to be resolved to achieve reliable tracking. */
@@ -100,28 +103,32 @@ export interface Blocker {
resolve: () => void;
}
export type CordovaLatestLocationResult = {
type: "location",
location: Coordinates,
} | {
type: "outage",
outage: {
code: number,
name: keyof typeof Outage
}
}
export type CordovaLatestLocationResult =
| {
type: 'location';
location: Coordinates;
}
| {
type: 'outage';
outage: {
code: number;
name: keyof typeof Outage;
};
};
export type LocationResult = {
type: LocationResultType.LOCATION,
value: Coordinates
} |
{
type: LocationResultType.OUTAGE,
value: Outage
}
export type LocationResult =
| {
type: LocationResultType.LOCATION;
value: Coordinates;
}
| {
type: LocationResultType.OUTAGE;
value: Outage;
};
export enum LocationResultType {
LOCATION, OUTAGE
LOCATION,
OUTAGE,
}
export enum Outage {
@@ -131,7 +138,7 @@ export enum Outage {
NOT_TRACKING,
START_HAS_NOT_FINISHED,
NO_GPS_SIGNAL,
RESTART_REQUIRED
RESTART_REQUIRED,
}
/**
@@ -175,7 +182,7 @@ export class HyperTrack {
* @see {@link https://dashboard.hypertrack.com/setup}.
*/
static initialize(publishableKey: string): Promise<HyperTrack> {
console.log(`Hypertrack Ionic plugin version ${hypertrackIonicPluginVersion}`)
console.log(`Hypertrack Ionic plugin version ${hypertrackIonicPluginVersion}`);
return new Promise((resolve, reject) => {
new HyperTrackPlugin()
.initialize(publishableKey)
@@ -235,7 +242,7 @@ export class HyperTrack {
*
* @param metadata key-value pais of properties.
*/
setDeviceMetadata(metadata: Object): Promise<void> {
setDeviceMetadata(metadata: object): Promise<void> {
return new Promise((resolve, reject) => {
this.cordovaInstanceHandle.setDeviceMetadata(
metadata,
@@ -268,7 +275,7 @@ export class HyperTrack {
* @param geotagData
* @param expectedLocation
*/
addGeotag(geotagData: Object, expectedLocation?: Coordinates): Promise<void> {
addGeotag(geotagData: object, expectedLocation?: Coordinates): Promise<void> {
return new Promise((resolve, reject) => {
this.cordovaInstanceHandle.addGeoTag(
geotagData,
@@ -332,46 +339,46 @@ export class HyperTrack {
});
}
/**
* Resolves latest device location that was sent by the SDK.
/**
* Resolves latest device location that was sent by the SDK.
* Only available for Android platform.
* */
getLatestLocation(): Promise<LocationResult> {
return new Promise((resolve, reject) => {
this.cordovaInstanceHandle.getLatestLocation(
locationResult => resolve(this.handleLocationResult(locationResult)),
err => reject(err)
(locationResult) => resolve(this.handleLocationResult(locationResult)),
(err) => reject(err)
);
});
}
/**
* Resolves latest device location from system location provider.
/**
* Resolves latest device location from system location provider.
* Only available for Android platform.
* */
getCurrentLocation(): Promise<LocationResult> {
return new Promise((resolve, reject) => {
this.cordovaInstanceHandle.getCurrentLocation(
locationResult => resolve(this.handleLocationResult(locationResult)),
err => reject(err)
(locationResult) => resolve(this.handleLocationResult(locationResult)),
(err) => reject(err)
);
});
}
private handleLocationResult(locationResult: CordovaLatestLocationResult): LocationResult {
switch (locationResult.type) {
case "location": {
case 'location': {
return {
type: LocationResultType.LOCATION,
value: locationResult.location
}
value: locationResult.location,
};
}
case "outage": {
const outage = Outage[locationResult.outage.name]
case 'outage': {
const outage = Outage[locationResult.outage.name];
return {
type: LocationResultType.OUTAGE,
value: outage
}
value: outage,
};
}
}
}
@@ -7,8 +7,8 @@ import { Observable } from 'rxjs';
* @description
* The plugin for the Kommunicate SDK.
* With the help of this plugin, you can easily add human + bot chat support functionality to you app.
* Refer to: TODO: insert site link
* For documentation: TODO: insert link
* Refer to: https://www.kommunicate.io/
* For documentation: https://docs.kommunicate.io/
* @usage
* ```typescript
* import { Kommunicate } from '@awesome-cordova-plugins/Kommunicate';
@@ -174,7 +174,7 @@ export class NewRelic extends AwesomeCordovaNativePlugin {
@Cordova({
sync: true,
})
recordMetric(name: string, category: any, value: Number, countUnit: string, valueUnit: string): void {
recordMetric(name: string, category: any, value: number, countUnit: string, valueUnit: string): void {
return; // We add return; here to avoid any IDE / Compiler errors
}
@@ -197,7 +197,7 @@ export class NewRelic extends AwesomeCordovaNativePlugin {
@Cordova({
sync: true,
})
setMaxEventPoolSize(maxPoolSize: Number): void {
setMaxEventPoolSize(maxPoolSize: number): void {
return; // We add return; here to avoid any IDE / Compiler errors
}
@@ -211,7 +211,7 @@ export class NewRelic extends AwesomeCordovaNativePlugin {
@Cordova({
sync: true,
})
setMaxEventBufferTime(maxBufferTimeInSeconds: Number): void {
setMaxEventBufferTime(maxBufferTimeInSeconds: number): void {
return; // We add return; here to avoid any IDE / Compiler errors
}
@@ -223,7 +223,7 @@ export class NewRelic extends AwesomeCordovaNativePlugin {
@Cordova({
sync: true,
})
analyticsEventEnabled(enabled: Boolean): void {
analyticsEventEnabled(enabled: boolean): void {
return; // We add return; here to avoid any IDE / Compiler errors
}
@@ -234,7 +234,7 @@ export class NewRelic extends AwesomeCordovaNativePlugin {
@Cordova({
sync: true,
})
networkRequestEnabled(enabled: Boolean): void {
networkRequestEnabled(enabled: boolean): void {
return; // We add return; here to avoid any IDE / Compiler errors
}
@@ -245,7 +245,7 @@ export class NewRelic extends AwesomeCordovaNativePlugin {
@Cordova({
sync: true,
})
networkErrorRequestEnabled(enabled: Boolean): void {
networkErrorRequestEnabled(enabled: boolean): void {
return; // We add return; here to avoid any IDE / Compiler errors
}
@@ -256,7 +256,7 @@ export class NewRelic extends AwesomeCordovaNativePlugin {
@Cordova({
sync: true,
})
httpRequestBodyCaptureEnabled(enabled: Boolean): void {
httpRequestBodyCaptureEnabled(enabled: boolean): void {
return; // We add return; here to avoid any IDE / Compiler errors
}
@@ -277,11 +277,11 @@ export class NewRelic extends AwesomeCordovaNativePlugin {
noticeHttpTransaction(
url: string,
method: string,
status: Number,
startTime: Number,
endTime: Number,
bytesSent: Number,
bytesReceived: Number,
status: number,
startTime: number,
endTime: number,
bytesSent: number,
bytesReceived: number,
body: string
): void {
return; // We add return; here to avoid any IDE / Compiler errors
@@ -300,7 +300,7 @@ export class NewRelic extends AwesomeCordovaNativePlugin {
@Cordova({
sync: true,
})
noticeNetworkFailure(url: string, method: string, startTime: Number, endTime: Number, failure: string): void {
noticeNetworkFailure(url: string, method: string, startTime: number, endTime: number, failure: string): void {
return; // We add return; here to avoid any IDE / Compiler errors
}
@@ -851,7 +851,7 @@ export class OneSignal extends AwesomeCordovaNativePlugin {
@Cordova({
sync: true,
})
addTrigger(key: string, value: string | number | Object): void {}
addTrigger(key: string, value: string | number | object): void {}
/**
* Add a map of triggers. May show an In-App Message if its trigger conditions were met.
@@ -861,7 +861,7 @@ export class OneSignal extends AwesomeCordovaNativePlugin {
@Cordova({
sync: true,
})
addTriggers(triggers: Object): void {}
addTriggers(triggers: object): void {}
/**
* Removes a single trigger for the given key. May show an In-App Message if its trigger conditions were met.
@@ -890,7 +890,7 @@ export class OneSignal extends AwesomeCordovaNativePlugin {
* @returns {Promise<string | number | Object>} Return value set with `addTrigger`, or `null`/`nil` (iOS) if never set or removed.
*/
@Cordova()
getTriggerValueForKey(key: string): Promise<string | number | Object> {
getTriggerValueForKey(key: string): Promise<string | number | object> {
return;
}
@@ -24,7 +24,7 @@ export interface CordovaFiniteObservableOptions extends CordovaOptions {
*/
export function CordovaFiniteObservable(opts: CordovaFiniteObservableOptions = {}) {
opts.observable = true;
return (target: Object, methodName: string, descriptor: TypedPropertyDescriptor<any>) => {
return (target: object, methodName: string, descriptor: TypedPropertyDescriptor<any>) => {
return {
value(...args: any[]) {
const wrappedObservable: Observable<any> = wrap(this, methodName, opts).apply(this, args);
@@ -8,7 +8,7 @@ declare const navigator: any;
* @description Captures a screen shot
* @usage
* ```typescript
* import { Screenshot } from '@ionic-native/screenshot/ngx';
* import { Screenshot } from '@awesome-cordova-plugins/screenshot/ngx';
*
* constructor(private screenshot: Screenshot) { }
*
@@ -44,7 +44,7 @@ export interface Shortcut {
* Please do refer to the original plugin's repo for detailed usage. The usage example here might not be sufficient.
*
* ```typescript
* import { ShortcutsAndroid } from '@ionic-native/shortcuts-android/ngx';
* import { ShortcutsAndroid } from '@awesome-cordova-plugins/shortcuts-android/ngx';
*
*
* constructor(private shortcutsAndroid: ShortcutsAndroid) { }
@@ -118,9 +118,7 @@ export enum LoginType {
* SAML 2.0 Login Type
*/
saml2 = 'SAML2',
/**
* TODO:
*/
/** Custom authentication */
custom = 'CUSTOM',
}
@@ -45,7 +45,7 @@ export class WECapInbox extends AwesomeCordovaNativePlugin {
* @returns {Promise<number>} - The count of notifications.
*/
@Cordova()
getNotificationCount(successCallback: (count: String) => void, errorCallback: (error: string) => void): Promise<any> {
getNotificationCount(successCallback: (count: string) => void, errorCallback: (error: string) => void): Promise<any> {
return;
}