cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From filmaj <>
Subject [GitHub] cordova-test-platform pull request #1: Doc requirements for platform api exp...
Date Wed, 26 Jul 2017 19:20:48 GMT
Github user filmaj commented on a diff in the pull request:
    --- Diff: ---
    @@ -0,0 +1,173 @@
    +# license: Licensed to the Apache Software Foundation (ASF) under one
    +#         or more contributor license agreements.  See the NOTICE file
    +#         distributed with this work for additional information
    +#         regarding copyright ownership.  The ASF licenses this file
    +#         to you under the Apache License, Version 2.0 (the
    +#         "License"); you may not use this file except in compliance
    +#         with the License.  You may obtain a copy of the License at
    +#         Unless required by applicable law or agreed to in writing,
    +#         software distributed under the License is distributed on an
    +#         KIND, either express or implied.  See the License for the
    +#         specific language governing permissions and limitations
    +#         under the License.
    +# New Platform Checklist
    +## Stand-alone scripts
    +bin/create scripts
    +- bin/create _(typically a node script)_
    +- bin/create.bat for windows
    +    - windows .bat file typically just calls bin/create with node
    +- invoking this script would create a platform-specific, cordova-compatible project shell
    +## Package Expectations
    +- Platforms must have a package.json in their root.
    +- Package.json must export a 'main'. `"main": "src/cordova/Api.js"`
    +    - A 'main' must exist, and it must be an instance of the `PlatformApi` with methods
as you define later.
    +    - This allows other modules to simply require() the path to this platform and get
access to the Api.
    +## Api (Platform) Expectations
    +- The PlatformApi class
    +    - The `PlatformApi` class is an abstraction around a particular platform that exposes
all the actions, properties, and methods for this platform so they are accessible programmatically.
    +    - It can install & uninstall plugins with all source files, web assets and js
    +    - It exposes a single `prepare` method to provide a way for cordova-lib to apply
a project's setting/www content to the platform. It interpolates metadata, such as application
name or description from a `Cordova` project's config.xml into the format expected by the
platform. See [config.xml documentation](
    +    - The `PlatformApi` class should be implemented by each platform that wants to use
the new API flow.
    --- End diff --
    I'm not sure we need this point. Do new users looking to implement a platform care that
the platform API is "new" or that there used to be a different, legacy approach to implementation?
In the "Package Expectations" section we already state that the platform package _must_ expose
a `main` module that returns an instance of `PlatformApi` - that tells me that the requirement
for using/implementing the `PlatformApi` class is a _must_, not a _should_.

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message