@cap-kit/test-plugin 0.0.2 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -183,3 +183,7 @@ Result returned by the getPluginVersion method.
183
183
  ## Contributing
184
184
 
185
185
  Contributions are welcome! Please read the [contributing guide](CONTRIBUTING.md) before submitting a pull request.
186
+
187
+ ## Verified
188
+
189
+ Automated CI/CD pipeline operational via macOS runners.
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAAA,wCAAwC","sourcesContent":["/// <reference types=\"@capacitor/cli\" />\n\n/**\n * Extend the PluginsConfig interface to include configuration options for the Test plugin.\n */\ndeclare module '@capacitor/cli' {\n export interface PluginsConfig {\n /**\n * Configuration options for the Test plugin.\n */\n Test?: {\n /**\n * A custom message to append to the echo response.\n * This demonstrates how to pass data from `capacitor.config.ts` to the plugin.\n *\n * @default \" (from config)\"\n * @example \" - Hello from Config!\"\n * @since 0.0.1\n */\n customMessage?: string;\n };\n }\n}\n\n/**\n * Options for the echo method.\n */\nexport interface EchoOptions {\n /**\n * The value to be echoed.\n */\n value: string;\n}\n\n/**\n * Result returned by the echo method.\n */\nexport interface EchoResult {\n /**\n * The echoed value.\n */\n value: string;\n}\n\n/**\n * Result returned by the getPluginVersion method.\n */\nexport interface PluginVersionResult {\n /**\n * The native version string of the plugin.\n */\n version: string;\n}\n\n/**\n * Capacitor Test plugin interface.\n */\nexport interface TestPlugin {\n /**\n * Echoes the provided value.\n *\n * If the plugin is configured with a `customMessage`, it will be appended\n * to the response.\n *\n * @param options - The options containing the value to echo.\n * @returns A promise resolving to the echo result.\n *\n * @example\n * ```typescript\n * import { Test } from '@cap-kit/test-plugin';\n *\n * const result = await Test.echo({ value: 'Hello, World!' });\n * console.log(result.value); // Output: 'Hello, World!'\n * ```\n *\n * @since 0.0.1\n */\n echo(options: EchoOptions): Promise<EchoResult>;\n\n /**\n * Get the native Capacitor plugin version.\n *\n * @returns A promise resolving to an object containing the version string.\n * @throws Error if getting the version fails.\n *\n * @example\n * ```typescript\n * import { Test } from '@cap-kit/test-plugin';\n *\n * const { version } = await Test.getPluginVersion();\n * console.log('Plugin version:', version); // Output: Plugin version: 0.0.1\n * ```\n *\n * @since 0.0.1\n */\n getPluginVersion(): Promise<PluginVersionResult>;\n}\n"]}
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAAA,wCAAwC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD;;;;;GAKG;AACH,MAAM,IAAI,GAAG,cAAc,CAAa,MAAM,EAAE;IAC9C;;;;;;OAMG;IACH,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;CACxD,CAAC,CAAC;AAEH,iEAAiE;AACjE,qEAAqE;AACrE,8BAA8B;AAC9B,cAAc,eAAe,CAAC;AAE9B,6CAA6C;AAC7C,wEAAwE;AACxE,OAAO,EAAE,IAAI,EAAE,CAAC","sourcesContent":["/**\n * @file index.ts\n * This file exports the TestPlugin and registers it with Capacitor.\n * It acts as the main entry point for accessing the plugin's functionality\n * across different platforms, including web.\n */\n\nimport { registerPlugin } from '@capacitor/core';\n\nimport type { TestPlugin } from './definitions';\n\n/**\n * Test Capacitor plugin instance.\n * This instance is registered with Capacitor using the `registerPlugin` function,\n * making it accessible through the Capacitor runtime. It dynamically loads the\n * web implementation when needed.\n */\nconst Test = registerPlugin<TestPlugin>('Test', {\n /**\n * Dynamically imports the web implementation of the plugin.\n * The `web` option provides a fallback for web environments,\n * ensuring platform-specific implementations can be used seamlessly.\n *\n * @returns A promise resolving to the web implementation of the plugin.\n */\n web: () => import('./web').then((m) => new m.TestWeb()),\n});\n\n// Export the definitions from 'definitions.ts' for external use.\n// These exports allow users to directly use the types and interfaces\n// defined for the TestPlugin.\nexport * from './definitions';\n\n// Export the registered TestPlugin instance.\n// This makes the plugin instance available for import in other modules.\nexport { Test };\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD;;;;;GAKG;AACH,MAAM,IAAI,GAAG,cAAc,CAAa,MAAM,EAAE;IAC9C;;;;;;OAMG;IACH,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;CACxD,CAAC,CAAC;AAEH,iEAAiE;AACjE,qEAAqE;AACrE,8BAA8B;AAC9B,cAAc,eAAe,CAAC;AAE9B,6CAA6C;AAC7C,wEAAwE;AACxE,OAAO,EAAE,IAAI,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C;;;;GAIG;AACH,MAAM,OAAO,OAAQ,SAAQ,SAAS;IACpC;;;;;;;;;;;;;;;OAeG;IACH,KAAK,CAAC,IAAI,CAAC,OAA0B;QACnC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC7B,kFAAkF;QAClF,iFAAiF;QACjF,uDAAuD;QACvD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,gBAAgB;QACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC;CACF","sourcesContent":["/**\n * @file web.ts\n * This file contains the web implementation of the TestPlugin.\n * It defines a class that extends the WebPlugin class and implements the\n * TestPlugin interface, providing the required functionality for web platforms.\n */\nimport { WebPlugin } from '@capacitor/core';\n\nimport type { TestPlugin } from './definitions';\n\n/**\n * Class representing the web implementation of the TestPlugin.\n * This class extends the WebPlugin class and implements the TestPlugin interface.\n * It provides a base implementation for web-based functionality of the plugin.\n */\nexport class TestWeb extends WebPlugin implements TestPlugin {\n /**\n * Echoes a value back for the web platform.\n * This method is a basic implementation example, primarily for testing\n * or validating communication with the plugin.\n *\n * @param options - An object containing a `value` property to be echoed back.\n * @returns A promise resolving to an object containing the echoed `value`.\n *\n * @example\n * ```typescript\n * import { Test } from '@cap-kit/test-plugin';\n *\n * const result = await Test.echo({ value: 'Hello, World!' });\n * console.log(result.value); // Output: 'Hello, World!'\n * ```\n */\n async echo(options: { value: string }): Promise<{ value: string }> {\n console.log('ECHO', options);\n // Note: On the web, reading 'capacitor.config.ts' requires specific build setups.\n // We pass the value through as-is for parity, or you can implement logic to read\n // from a global config object if your app exposes one.\n return options;\n }\n\n /**\n * Get the native Capacitor plugin version.\n *\n * @returns Promise that resolves with the plugin version\n * @throws Error if getting the version fails\n *\n * @example\n * ```typescript\n * import { Test } from '@cap-kit/test-plugin';\n *\n * const version = await Test.getPluginVersion();\n * console.log(version.version); // Output: 'web'\n * ```\n */\n async getPluginVersion(): Promise<{ version: string }> {\n return { version: 'web' };\n }\n}\n"]}
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C;;;;GAIG;AACH,MAAM,OAAO,OAAQ,SAAQ,SAAS;IACpC;;;;;;;;;;;;;;;OAeG;IACH,KAAK,CAAC,IAAI,CAAC,OAA0B;QACnC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC7B,kFAAkF;QAClF,iFAAiF;QACjF,uDAAuD;QACvD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,gBAAgB;QACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cap-kit/test-plugin",
3
- "version": "0.0.2",
3
+ "version": "0.1.1",
4
4
  "description": "Test plugin for Cap-Kit.",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -29,7 +29,8 @@
29
29
  "homepage": "https://github.com/cap-kit/capacitor-plugins/tree/main/packages/test-plugin#readme",
30
30
  "keywords": [
31
31
  "capacitor",
32
- "plugin",
32
+ "capacitor-plugin",
33
+ "ionic",
33
34
  "native"
34
35
  ],
35
36
  "publishConfig": {
@@ -47,7 +48,7 @@
47
48
  "eslint-plugin-import": "^2.32.0",
48
49
  "globals": "^17.0.0",
49
50
  "prettier": "^3.7.4",
50
- "prettier-plugin-java": "^2.7.7",
51
+ "prettier-plugin-java": "^2.8.1",
51
52
  "rimraf": "^6.1.2",
52
53
  "rollup": "^4.55.1",
53
54
  "swiftlint": "^2.0.0",