Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-11412

Update template implementation in cordova create --template

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: cordova-lib
    • Labels:
      None

      Description

      https://github.com/cordova/cordova-discuss/pull/49

      Sometimes we do want a `package.json` copied over. `package.json` could have build scripts that are essential for the template to work. To handle this use case, template authors are suggested to put template files in a subdirectory and point to that subdirectory in index.js. All files in the subdirectory are copied over.

      Update the current template implementation to ignore the list of files above that shouldn't be copied over when using `--template`. If a subdirectory is used, copy the entire contents of the subdirectory.

      If a `package.json` exists in the subdirectory, we should update its fields like we do to `config.xml`. https://github.com/apache/cordova-lib/blob/master/cordova-lib/src/cordova/create.js#L378-L382. Only field to update in `package.json` should be `package.name`. `package.name` should be updated to use `config.name` lowercased (npm package names have to be lowercase). `config.name` is the optional third argument `cordova create` takes.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                carynbear Caryn Tran
                Reporter:
                carynbear Caryn Tran
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: