chore!: update template defaults (#1837)

* chore: update default package id
* chore: sync cordova-app-hello-world defaults & modified for Android differences
This commit is contained in:
エリス
2025-08-19 13:55:18 +09:00
committed by GitHub
parent 8742cfe4a6
commit e4457f7fdb
6 changed files with 57 additions and 59 deletions
+1 -1
View File
@@ -12,7 +12,7 @@
"GRADLE_PLUGIN_GOOGLE_SERVICES_VERSION": "4.4.2", "GRADLE_PLUGIN_GOOGLE_SERVICES_VERSION": "4.4.2",
"IS_GRADLE_PLUGIN_GOOGLE_SERVICES_ENABLED": false, "IS_GRADLE_PLUGIN_GOOGLE_SERVICES_ENABLED": false,
"IS_GRADLE_PLUGIN_KOTLIN_ENABLED": false, "IS_GRADLE_PLUGIN_KOTLIN_ENABLED": false,
"PACKAGE_NAMESPACE": "io.cordova.helloCordova", "PACKAGE_NAMESPACE": "org.apache.cordova.hellocordova",
"JAVA_SOURCE_COMPATIBILITY": 11, "JAVA_SOURCE_COMPATIBILITY": 11,
"JAVA_TARGET_COMPATIBILITY": 11, "JAVA_TARGET_COMPATIBILITY": 11,
"KOTLIN_JVM_TARGET": null "KOTLIN_JVM_TARGET": null
+1 -1
View File
@@ -205,7 +205,7 @@ exports.create = function (project_path, config, options, events) {
return Promise.reject(new CordovaError('Project already exists! Delete and recreate')); return Promise.reject(new CordovaError('Project already exists! Delete and recreate'));
} }
const package_name = config.android_packageName() || config.packageName() || 'io.cordova.helloCordova'; const package_name = config.android_packageName() || config.packageName() || 'org.apache.cordova.hellocordova';
const project_name = config.name() || 'Hello Cordova'; const project_name = config.name() || 'Hello Cordova';
const safe_activity_name = config.android_activityName() || options.activityName || 'MainActivity'; const safe_activity_name = config.android_activityName() || options.activityName || 'MainActivity';
+2 -2
View File
@@ -155,10 +155,10 @@ describe('create', function () {
}); });
describe('parameter values and defaults', function () { describe('parameter values and defaults', function () {
it('should have a default package name of io.cordova.helloCordova', () => { it('should have a default package name of org.apache.cordova.hellocordova', () => {
config_mock.packageName.and.returnValue(undefined); config_mock.packageName.and.returnValue(undefined);
return create.create(project_path, config_mock, {}, events_mock).then(() => { return create.create(project_path, config_mock, {}, events_mock).then(() => {
expect(create.validatePackageName).toHaveBeenCalledWith('io.cordova.helloCordova'); expect(create.validatePackageName).toHaveBeenCalledWith('org.apache.cordova.hellocordova');
}); });
}); });
+4 -3
View File
@@ -17,9 +17,10 @@
specific language governing permissions and limitations specific language governing permissions and limitations
under the License. under the License.
--> -->
<widget xmlns = "http://www.w3.org/ns/widgets" <widget xmlns="http://www.w3.org/ns/widgets"
id = "io.cordova.helloCordova" xmlns:cdv="http://cordova.apache.org/ns/1.0"
version = "2.0.0"> id="org.apache.cordova.hellocordova"
version="1.0.0">
<!-- Preferences for Android --> <!-- Preferences for Android -->
<preference name="loglevel" value="DEBUG" /> <preference name="loglevel" value="DEBUG" />
+20 -23
View File
@@ -17,40 +17,37 @@
specific language governing permissions and limitations specific language governing permissions and limitations
under the License. under the License.
--> -->
<widget xmlns = "http://www.w3.org/ns/widgets" <widget xmlns="http://www.w3.org/ns/widgets"
id = "io.cordova.helloCordova" xmlns:cdv="http://cordova.apache.org/ns/1.0"
version = "2.0.0"> id="org.apache.cordova.hellocordova"
version="1.0.0">
<name>Hello Cordova</name> <name>Hello Cordova</name>
<description> <description>
A sample Apache Cordova application that responds to the deviceready event. A sample Apache Cordova application that responds to the deviceready event.
</description> </description>
<author email="dev@cordova.apache.org" href="https://cordova.apache.org">
<author href="http://cordova.io" email="dev@cordova.apache.org">
Apache Cordova Team Apache Cordova Team
</author> </author>
<!-- <content src="http://mysite.com/myapp.html" /> for external pages --> <!-- https://s.apache.org/cdv-content-config -->
<content src="index.html" /> <content src="index.html" />
<!-- Allow List docs: https://cordova.apache.org/docs/en/latest/ --> <!-- To allow connections to other resources, you must explicitly permit them using `access` tags. -->
<access origin="*" /> <!-- https://s.apache.org/cdv-network-request-access -->
<!-- Grant certain URLs the ability to launch external applications. This <!-- Example:
behaviour is set to match that of Cordova versions before 3.6.0, and <access origin="https://cordova.apache.org" />
should be reviewed before launching an application in production. It -->
may be changed in the future. -->
<!-- To control which URLs the WebView itself can be navigated to, use the `allow-navigation` tags. -->
<!-- https://s.apache.org/cdv-allow-navigation -->
<!-- Example:
<allow-navigation href="https://cordova.apache.org/*" />
-->
<!-- To control which URLs the app is allowed to ask the system to open, use the `allow-intent` tags. -->
<!-- https://s.apache.org/cdv-allow-intent -->
<allow-intent href="http://*/*" /> <allow-intent href="http://*/*" />
<allow-intent href="https://*/*" /> <allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<allow-intent href="market:*" />
<preference name="loglevel" value="DEBUG" /> <preference name="loglevel" value="DEBUG" />
<!--
<preference name="loadUrlTimeoutValue" value="20000" />
<preference name="InAppBrowserStorageEnabled" value="true" />
<preference name="disallowOverscroll" value="true" />
-->
</widget> </widget>
@@ -17,7 +17,7 @@
specific language governing permissions and limitations specific language governing permissions and limitations
under the License. under the License.
--> -->
<widget id="io.cordova.helloCordova" version="2.0.0" xmlns="http://www.w3.org/ns/widgets"> <widget id="org.apache.cordova.hellocordova" version="2.0.0" xmlns="http://www.w3.org/ns/widgets">
<name>Hello Cordova</name> <name>Hello Cordova</name>
<description> <description>
A sample Apache Cordova application that responds to the deviceready event. A sample Apache Cordova application that responds to the deviceready event.