Compare commits

...
Author SHA1 Message Date
Daniel SoglandCopilot c4d7f60a3b fix: restore v9 plugin exports
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-15 10:57:52 +02:00
6764b252cd chore: release main (#5133)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-04-15 07:08:58 +02:00
Justin BullandGitHub b7d9d9022f docs(core): fix dead link to Capacitor docs (#5143) 2026-04-15 07:08:35 +02:00
c6c21acf37 chore(deps): update dependency rollup to ^4.60.1 (#5142)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-13 10:41:28 +00:00
8e54b98941 chore(deps): update dependency typedoc to ^0.28.19 (#5141)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-13 04:57:27 +00:00
412320dd44 chore(deps): update dependency @types/node to ^22.19.17 (#5137)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-06 09:57:42 +00:00
3447bd33f5 chore(deps): update dependency @swc/core to ^1.15.24 (#5136)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-06 04:39:49 +00:00
d2fb499b30 chore(deps): update linting and formatting (#5135)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-30 09:13:41 +00:00
87e1f12993 chore(deps): update dependency typedoc to ^0.28.18 (#5134)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-30 05:08:26 +00:00
ac35af8abf chore(deps-dev): bump picomatch from 2.3.1 to 2.3.2 (#5132)
Bumps [picomatch](https://github.com/micromatch/picomatch) from 2.3.1 to 2.3.2.
- [Release notes](https://github.com/micromatch/picomatch/releases)
- [Changelog](https://github.com/micromatch/picomatch/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/picomatch/compare/2.3.1...2.3.2)

---
updated-dependencies:
- dependency-name: picomatch
  dependency-version: 2.3.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-27 15:14:05 +01:00
8 changed files with 419 additions and 304 deletions
+1 -1
View File
@@ -1,3 +1,3 @@
{
".": "9.1.2"
".": "9.1.3"
}
+18
View File
@@ -256,6 +256,24 @@
## [9.1.3](https://github.com/danielsogl/awesome-cordova-plugins/compare/awesome-cordova-plugins-v9.1.2...awesome-cordova-plugins-v9.1.3) (2026-04-15)
### Miscellaneous Chores
* **deps-dev:** bump picomatch from 2.3.1 to 2.3.2 ([#5132](https://github.com/danielsogl/awesome-cordova-plugins/issues/5132)) ([ac35af8](https://github.com/danielsogl/awesome-cordova-plugins/commit/ac35af8abf33534782d44cf24785cd991202d03b))
* **deps:** update dependency @swc/core to ^1.15.24 ([#5136](https://github.com/danielsogl/awesome-cordova-plugins/issues/5136)) ([3447bd3](https://github.com/danielsogl/awesome-cordova-plugins/commit/3447bd33f5fbe6faacb495a3546db9d97723d687))
* **deps:** update dependency @types/node to ^22.19.17 ([#5137](https://github.com/danielsogl/awesome-cordova-plugins/issues/5137)) ([412320d](https://github.com/danielsogl/awesome-cordova-plugins/commit/412320dd447ded3bc36e1051b496b146f9a21937))
* **deps:** update dependency rollup to ^4.60.1 ([#5142](https://github.com/danielsogl/awesome-cordova-plugins/issues/5142)) ([c6c21ac](https://github.com/danielsogl/awesome-cordova-plugins/commit/c6c21acf37fefa169ceba0d6a73e5ac0602fa21d))
* **deps:** update dependency typedoc to ^0.28.18 ([#5134](https://github.com/danielsogl/awesome-cordova-plugins/issues/5134)) ([87e1f12](https://github.com/danielsogl/awesome-cordova-plugins/commit/87e1f1299331d3e1eef498b559c477e7d22388b3))
* **deps:** update dependency typedoc to ^0.28.19 ([#5141](https://github.com/danielsogl/awesome-cordova-plugins/issues/5141)) ([8e54b98](https://github.com/danielsogl/awesome-cordova-plugins/commit/8e54b98941b8df3a348e0a54b235829dc6cd1903))
* **deps:** update linting and formatting ([#5135](https://github.com/danielsogl/awesome-cordova-plugins/issues/5135)) ([d2fb499](https://github.com/danielsogl/awesome-cordova-plugins/commit/d2fb499b30fbc1728b72e2c592dac01abef5741a))
### Documentation
* **core:** fix dead link to Capacitor docs ([#5143](https://github.com/danielsogl/awesome-cordova-plugins/issues/5143)) ([b7d9d90](https://github.com/danielsogl/awesome-cordova-plugins/commit/b7d9d9022fe98938f94c9c338f1e0cfffd535ff4))
## [9.1.2](https://github.com/danielsogl/awesome-cordova-plugins/compare/awesome-cordova-plugins-v9.1.1...awesome-cordova-plugins-v9.1.2) (2026-03-23)
+1 -1
View File
@@ -12,7 +12,7 @@ These plugins are submitted and maintained by the community. While community mem
## Capacitor Support
In addition to Cordova, Awesome Cordova Plugins also works with [Capacitor](https://capacitorjs.com/), Ionic's official native runtime. Basic usage below. For complete details, [see the Capacitor documentation](https://capacitorjs.com/docs/cordova/using-cordova-plugins).
In addition to Cordova, Awesome Cordova Plugins also works with [Capacitor](https://capacitorjs.com/), Ionic's official native runtime. Basic usage below. For complete details, [see the Capacitor documentation](https://capacitorjs.com/docs/plugins/cordova).
## Usage
+311 -287
View File
File diff suppressed because it is too large Load Diff
+7 -7
View File
@@ -1,6 +1,6 @@
{
"name": "awesome-cordova-plugins",
"version": "9.1.2",
"version": "9.1.3",
"description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
"homepage": "https://awesome-cordova-plugins.com",
"author": "Daniel Sogl <me@danielsogl.com> (https://danielsogl.com)",
@@ -32,25 +32,25 @@
"@angular/compiler-cli": "20.3.18",
"@angular/core": "20.3.18",
"@eslint/js": "^10.0.0",
"@swc/core": "^1.15.21",
"@swc/core": "^1.15.24",
"@swc/jest": "^0.2.39",
"@types/cordova": "11.0.3",
"@types/jest": "^30.0.0",
"@types/node": "^22.19.15",
"@types/node": "^22.19.17",
"eslint": "^10.1.0",
"eslint-config-prettier": "10.1.8",
"eslint-plugin-jsdoc": "^62.8.0",
"eslint-plugin-jsdoc": "^62.8.1",
"jest": "^30.3.0",
"jest-environment-jsdom": "^30.3.0",
"lefthook": "^2.1.4",
"prettier": "^3.8.1",
"rollup": "^4.59.0",
"rollup": "^4.60.1",
"rxjs": "^7.8.2",
"tsx": "^4.21.0",
"typedoc": "^0.28.17",
"typedoc": "^0.28.19",
"typedoc-plugin-markdown": "^4.11.0",
"typescript": "~5.8.3",
"typescript-eslint": "^8.57.1"
"typescript-eslint": "^8.57.2"
},
"repository": {
"type": "git",
+33
View File
@@ -0,0 +1,33 @@
import { rewriteInjectableExports } from './esm-exports';
describe('rewriteInjectableExports', () => {
test('rewrites inline class exports into instance exports', () => {
const jsFile = `import { AwesomeCordovaNativePlugin } from '@awesome-cordova-plugins/core';
export class File extends AwesomeCordovaNativePlugin {
static pluginName = 'File';
}
//# sourceMappingURL=index.js.map`;
expect(rewriteInjectableExports(jsFile, [{ className: 'File', dirName: 'file', file: '/tmp/file/index.ts' }]))
.toBe(`import { AwesomeCordovaNativePlugin } from '@awesome-cordova-plugins/core';
class FileOriginal extends AwesomeCordovaNativePlugin {
static pluginName = 'File';
}
const File = new FileOriginal();
export { File };
//# sourceMappingURL=index.js.map`);
});
test('keeps supporting legacy named exports', () => {
const jsFile = `class SocialSharingOriginal {}
export { SocialSharingOriginal };`;
expect(
rewriteInjectableExports(jsFile, [
{ className: 'SocialSharing', dirName: 'social-sharing', file: '/tmp/social-sharing/index.ts' },
])
).toBe(`class SocialSharingOriginal {}
const SocialSharing = new SocialSharingOriginal();
export { SocialSharing };`);
});
});
+45
View File
@@ -0,0 +1,45 @@
import { InjectableClassEntry } from './transformers/extract-injectables';
const SOURCE_MAP_COMMENT = '\n//# sourceMappingURL=';
function insertBeforeSourceMapComment(contents: string, addition: string): string {
const sourceMapIndex = contents.lastIndexOf(SOURCE_MAP_COMMENT);
if (sourceMapIndex === -1) {
return `${contents}\n${addition}`;
}
return `${contents.slice(0, sourceMapIndex)}\n${addition}${contents.slice(sourceMapIndex)}`;
}
export function rewriteInjectableExports(jsFile: string, classes: InjectableClassEntry[]): string {
let rewrittenFile = jsFile;
const exportBlocks: string[] = [];
classes.forEach((entry) => {
const originalClassName = `${entry.className}Original`;
rewrittenFile = rewrittenFile.replace(
new RegExp(`([\\s\\(])${entry.className}([\\s\\.;\\(,])`, 'g'),
`$1${originalClassName}$2`
);
const legacyExportPattern = new RegExp(`\\nexport\\s*\\{\\s*${originalClassName}\\s*\\};?`);
if (legacyExportPattern.test(rewrittenFile)) {
rewrittenFile = rewrittenFile.replace(legacyExportPattern, '');
} else {
const inlineClassExportPattern = new RegExp(`export\\s+class\\s+${originalClassName}(?=\\s)`);
if (!inlineClassExportPattern.test(rewrittenFile)) {
throw new Error(`Could not rewrite ESM export for injectable class "${entry.className}"`);
}
rewrittenFile = rewrittenFile.replace(inlineClassExportPattern, `class ${originalClassName}`);
}
exportBlocks.push(`const ${entry.className} = new ${originalClassName}();\nexport { ${entry.className} };`);
});
if (exportBlocks.length === 0) {
return rewrittenFile;
}
return insertBeforeSourceMapComment(rewrittenFile, exportBlocks.join('\n'));
}
+3 -8
View File
@@ -1,6 +1,7 @@
import { readFileSync, writeFileSync } from 'node:fs';
import { join } from 'node:path';
import { rewriteInjectableExports } from '../build/esm-exports';
import { PLUGIN_PATHS, ROOT } from '../build/helpers';
import { InjectableClassEntry, EMIT_PATH } from '../build/transformers/extract-injectables';
import { generateDeclarations, transpile } from '../build/transpile';
@@ -17,17 +18,11 @@ outDirs.forEach((dir: string) => {
let jsFile: string = readFileSync(join(dir, 'index.js'), 'utf-8'),
dtsFile: string = readFileSync(join(dir, 'index.d.ts'), 'utf-8');
jsFile = rewriteInjectableExports(jsFile, classes);
classes.forEach((entry) => {
dtsFile = dtsFile.replace(`class ${entry.className} `, 'class ' + entry.className + 'Original ');
dtsFile += `\nexport declare const ${entry.className}: ${entry.className}Original;`;
jsFile = jsFile.replace(
new RegExp(`([\\s\\(])${entry.className}([\\s\\.;\\(,])`, 'g'),
'$1' + entry.className + 'Original$2'
);
jsFile = jsFile.replace(
`export { ${entry.className}Original }`,
`var ${entry.className} = new ${entry.className}Original();\nexport { ${entry.className} }`
);
});
writeFileSync(join(dir, 'index.js'), jsFile, 'utf-8');