cordova-electron 4.0.1-nightly.20240417000725451.sha.abe901b9 → 4.0.1-nightly.20240419000723211.sha.da605008
Sign up to get free protection for your applications and to get access to all the features.
- package/bin/templates/platform_www/cdv-electron-main.js +2 -2
- package/bin/templates/platform_www/cordova.js +1 -1
- package/lib/Api.js +5 -5
- package/lib/ManifestJsonParser.js +3 -3
- package/lib/PackageJsonParser.js +13 -4
- package/lib/SettingJsonParser.js +2 -2
- package/lib/build.js +2 -2
- package/lib/clean.js +3 -3
- package/lib/create.js +4 -4
- package/lib/handler.js +10 -10
- package/lib/parser.js +3 -3
- package/lib/prepare.js +7 -7
- package/lib/run.js +1 -1
- package/licence_checker.yml +61 -0
- package/package.json +3 -4
@@ -17,8 +17,8 @@
|
|
17
17
|
under the License.
|
18
18
|
*/
|
19
19
|
|
20
|
-
const fs = require('fs');
|
21
|
-
const path = require('path');
|
20
|
+
const fs = require('node:fs');
|
21
|
+
const path = require('node:path');
|
22
22
|
const { cordova } = require('./package.json');
|
23
23
|
// Module to control application life, browser window and tray.
|
24
24
|
const {
|
@@ -19,7 +19,7 @@
|
|
19
19
|
under the License.
|
20
20
|
*/
|
21
21
|
;(function() {
|
22
|
-
var PLATFORM_VERSION_BUILD_LABEL = '4.0.1-nightly.
|
22
|
+
var PLATFORM_VERSION_BUILD_LABEL = '4.0.1-nightly.20240419000723211.sha.da605008';
|
23
23
|
// file: src/scripts/require.js
|
24
24
|
var require;
|
25
25
|
var define;
|
package/lib/Api.js
CHANGED
@@ -21,8 +21,8 @@
|
|
21
21
|
this file is found by cordova-lib when you attempt to
|
22
22
|
'cordova platform add PATH' where path is this repo.
|
23
23
|
*/
|
24
|
-
const path = require('path');
|
25
|
-
const fs = require('fs
|
24
|
+
const path = require('node:path');
|
25
|
+
const fs = require('node:fs');
|
26
26
|
const {
|
27
27
|
ActionStack,
|
28
28
|
ConfigChanges: { PlatformMunger },
|
@@ -190,7 +190,7 @@ class Api {
|
|
190
190
|
this._removeModulesInfo(pluginInfo, targetDir);
|
191
191
|
// Remove stale plugin directory
|
192
192
|
// @todo this should be done by plugin files uninstaller
|
193
|
-
fs.
|
193
|
+
fs.rmSync(path.resolve(this.root, 'Plugins', pluginInfo.id), { recursive: true, force: true });
|
194
194
|
});
|
195
195
|
}
|
196
196
|
|
@@ -303,8 +303,8 @@ class Api {
|
|
303
303
|
// BOTTOM OF METADATA
|
304
304
|
});`;
|
305
305
|
|
306
|
-
fs.
|
307
|
-
fs.writeFileSync(path.join(targetDir, 'cordova_plugins.js'), final_contents, '
|
306
|
+
fs.mkdirSync(targetDir, { recursive: true });
|
307
|
+
fs.writeFileSync(path.join(targetDir, 'cordova_plugins.js'), final_contents, 'utf8');
|
308
308
|
}
|
309
309
|
|
310
310
|
/**
|
@@ -17,8 +17,8 @@
|
|
17
17
|
under the License.
|
18
18
|
*/
|
19
19
|
|
20
|
-
const fs = require('fs
|
21
|
-
const path = require('path');
|
20
|
+
const fs = require('node:fs');
|
21
|
+
const path = require('node:path');
|
22
22
|
|
23
23
|
class ManifestJsonParser {
|
24
24
|
constructor (wwwDir) {
|
@@ -91,7 +91,7 @@ class ManifestJsonParser {
|
|
91
91
|
|
92
92
|
if (fs.existsSync(startUrlPath)) {
|
93
93
|
// fetch start url file content and parse for theme-color.
|
94
|
-
const contents = fs.readFileSync(startUrlPath, '
|
94
|
+
const contents = fs.readFileSync(startUrlPath, 'utf8');
|
95
95
|
const result = /<meta(?=[^>]*name="theme-color")\s[^>]*content="([^>]*)"/i.exec(contents);
|
96
96
|
|
97
97
|
// If theme-color exists, the value is in index 1.
|
package/lib/PackageJsonParser.js
CHANGED
@@ -17,15 +17,24 @@
|
|
17
17
|
under the License.
|
18
18
|
*/
|
19
19
|
|
20
|
-
const fs = require('fs
|
21
|
-
const path = require('path');
|
20
|
+
const fs = require('node:fs');
|
21
|
+
const path = require('node:path');
|
22
22
|
const { getPackageJson } = require('./util');
|
23
23
|
|
24
24
|
class PackageJsonParser {
|
25
25
|
constructor (wwwDir, projectRootDir) {
|
26
|
-
//
|
26
|
+
// make sure www dir exists
|
27
|
+
if (!fs.existsSync(wwwDir)) {
|
28
|
+
fs.mkdirSync(wwwDir, { recursive: true });
|
29
|
+
}
|
30
|
+
|
27
31
|
this.path = path.join(wwwDir, 'package.json');
|
28
|
-
|
32
|
+
|
33
|
+
if (!fs.existsSync(this.path)) {
|
34
|
+
fs.writeFileSync(this.path, '{}', 'utf8');
|
35
|
+
}
|
36
|
+
|
37
|
+
// Electron App Package
|
29
38
|
this.package = JSON.parse(fs.readFileSync(this.path, 'utf8') || '{}');
|
30
39
|
|
31
40
|
// Force settings that are not allowed to change.
|
package/lib/SettingJsonParser.js
CHANGED
package/lib/build.js
CHANGED
@@ -17,8 +17,8 @@
|
|
17
17
|
under the License.
|
18
18
|
*/
|
19
19
|
|
20
|
-
const fs = require('fs
|
21
|
-
const path = require('path');
|
20
|
+
const fs = require('node:fs');
|
21
|
+
const path = require('node:path');
|
22
22
|
const events = require('cordova-common').events;
|
23
23
|
const { deepMerge, getInstalledElectronVersion } = require('./util');
|
24
24
|
|
package/lib/clean.js
CHANGED
@@ -17,8 +17,8 @@
|
|
17
17
|
under the License.
|
18
18
|
*/
|
19
19
|
|
20
|
-
const fs = require('fs
|
21
|
-
const path = require('path');
|
20
|
+
const fs = require('node:fs');
|
21
|
+
const path = require('node:path');
|
22
22
|
const check_reqs = require('./check_reqs');
|
23
23
|
const platformBuildDir = path.join('platforms', 'electron', 'www');
|
24
24
|
|
@@ -32,7 +32,7 @@ module.exports.run = () => {
|
|
32
32
|
|
33
33
|
try {
|
34
34
|
if (fs.existsSync(platformBuildDir)) {
|
35
|
-
fs.
|
35
|
+
fs.rmSync(platformBuildDir, { recursive: true, force: true });
|
36
36
|
}
|
37
37
|
} catch (err) {
|
38
38
|
console.log(`could not remove ${platformBuildDir} : ${err.message}`);
|
package/lib/create.js
CHANGED
@@ -17,8 +17,8 @@
|
|
17
17
|
under the License.
|
18
18
|
*/
|
19
19
|
|
20
|
-
const fs = require('fs
|
21
|
-
const path = require('path');
|
20
|
+
const fs = require('node:fs');
|
21
|
+
const path = require('node:path');
|
22
22
|
const rootDir = path.resolve(__dirname, '..');
|
23
23
|
const events = require('cordova-common').events;
|
24
24
|
const check_reqs = require(path.join(rootDir, 'lib/check_reqs'));
|
@@ -46,10 +46,10 @@ module.exports.createProject = (platform_dir, package_name, project_name, option
|
|
46
46
|
}
|
47
47
|
|
48
48
|
// Make sure that the platform directory is created if missing.
|
49
|
-
fs.
|
49
|
+
fs.mkdirSync(platform_dir, { recursive: true });
|
50
50
|
|
51
51
|
// copy templates directory to the platform directory recursively
|
52
|
-
fs.
|
52
|
+
fs.cpSync(path.join(rootDir, 'bin/templates'), path.join(platform_dir), { recursive: true, force: true });
|
53
53
|
|
54
54
|
return Promise.resolve();
|
55
55
|
};
|
package/lib/handler.js
CHANGED
@@ -17,8 +17,8 @@
|
|
17
17
|
under the License.
|
18
18
|
*/
|
19
19
|
|
20
|
-
const path = require('path');
|
21
|
-
const fs = require('fs
|
20
|
+
const path = require('node:path');
|
21
|
+
const fs = require('node:fs');
|
22
22
|
const execa = require('execa');
|
23
23
|
const { events } = require('cordova-common');
|
24
24
|
const { _orderObject } = require('./PackageJsonParser');
|
@@ -53,7 +53,7 @@ module.exports = {
|
|
53
53
|
const moduleName = `${plugin_id}.${jsModule.name || path.basename(jsModule.src, path.extname(jsModule.src))}`;
|
54
54
|
|
55
55
|
// Read in the file, prepend the cordova.define, and write it back out.
|
56
|
-
let scriptContent = fs.readFileSync(moduleSource, '
|
56
|
+
let scriptContent = fs.readFileSync(moduleSource, 'utf8').replace(/^\ufeff/, ''); // Window BOM
|
57
57
|
|
58
58
|
if (moduleSource.match(/.*\.json$/)) {
|
59
59
|
scriptContent = `module.exports = + ${scriptContent}`;
|
@@ -65,11 +65,11 @@ module.exports = {
|
|
65
65
|
|
66
66
|
const moduleDestination = path.resolve(www_dir, 'plugins', plugin_id, jsModule.src);
|
67
67
|
|
68
|
-
fs.
|
69
|
-
fs.writeFileSync(moduleDestination, scriptContent, '
|
68
|
+
fs.mkdirSync(path.dirname(moduleDestination), { recursive: true });
|
69
|
+
fs.writeFileSync(moduleDestination, scriptContent, 'utf8');
|
70
70
|
},
|
71
71
|
uninstall: (jsModule, www_dir, plugin_id) => {
|
72
|
-
fs.
|
72
|
+
fs.rmSync(path.join(www_dir, 'plugins', plugin_id), { recursive: true, force: true });
|
73
73
|
const pluginRelativePath = path.join('plugins', plugin_id, jsModule.src);
|
74
74
|
// common.removeFileAndParents(www_dir, pluginRelativePath);
|
75
75
|
events.emit('verbose', `js-module uninstall called : ${pluginRelativePath}`);
|
@@ -226,12 +226,12 @@ module.exports = {
|
|
226
226
|
const dest = path.join(wwwDest, asset.target);
|
227
227
|
const destDir = path.parse(dest).dir;
|
228
228
|
|
229
|
-
fs.
|
230
|
-
fs.
|
229
|
+
fs.mkdirSync(destDir, { recursive: true });
|
230
|
+
fs.cpSync(src, dest, { recursive: true });
|
231
231
|
},
|
232
232
|
uninstall: (asset, wwwDest, plugin_id) => {
|
233
|
-
fs.
|
234
|
-
fs.
|
233
|
+
fs.rmSync(path.join(wwwDest, asset.target), { recursive: true, force: true });
|
234
|
+
fs.rmSync(path.join(wwwDest, 'plugins', plugin_id), { recursive: true, force: true });
|
235
235
|
}
|
236
236
|
}
|
237
237
|
};
|
package/lib/parser.js
CHANGED
@@ -17,8 +17,8 @@
|
|
17
17
|
under the License.
|
18
18
|
*/
|
19
19
|
|
20
|
-
const fs = require('fs
|
21
|
-
const path = require('path');
|
20
|
+
const fs = require('node:fs');
|
21
|
+
const path = require('node:path');
|
22
22
|
const CordovaError = require('cordova-common').CordovaError;
|
23
23
|
const events = require('cordova-common').events;
|
24
24
|
const FileUpdater = require('cordova-common').FileUpdater;
|
@@ -79,7 +79,7 @@ class Parser {
|
|
79
79
|
return this.update_from_config()
|
80
80
|
.then(
|
81
81
|
// Copy munged config.xml to platform www dir
|
82
|
-
() => fs.
|
82
|
+
() => fs.cpSync(path.join(this.www_dir(), '..', 'config.xml'), path.join(this.www_dir(), 'config.xml'), { recursive: true })
|
83
83
|
);
|
84
84
|
}
|
85
85
|
}
|
package/lib/prepare.js
CHANGED
@@ -17,8 +17,8 @@
|
|
17
17
|
under the License.
|
18
18
|
*/
|
19
19
|
|
20
|
-
const fs = require('fs
|
21
|
-
const path = require('path');
|
20
|
+
const fs = require('node:fs');
|
21
|
+
const path = require('node:path');
|
22
22
|
const { ConfigParser, xmlHelpers, events, CordovaError } = require('cordova-common');
|
23
23
|
const ManifestJsonParser = require('./ManifestJsonParser');
|
24
24
|
const PackageJsonParser = require('./PackageJsonParser');
|
@@ -35,13 +35,13 @@ module.exports.prepare = function (cordovaProject, options) {
|
|
35
35
|
// restored or copy project config into platform if none exists.
|
36
36
|
if (fs.existsSync(defaultConfigPath)) {
|
37
37
|
this.events.emit('verbose', `Generating config.xml from defaults for platform "${this.platform}"`);
|
38
|
-
fs.
|
38
|
+
fs.cpSync(defaultConfigPath, ownConfigPath, { recursive: true });
|
39
39
|
} else if (fs.existsSync(ownConfigPath)) {
|
40
40
|
this.events.emit('verbose', `Generating defaults.xml from own config.xml for platform "${this.platform}"`);
|
41
|
-
fs.
|
41
|
+
fs.cpSync(ownConfigPath, defaultConfigPath, { recursive: true });
|
42
42
|
} else {
|
43
43
|
this.events.emit('verbose', `case 3 "${this.platform}"`);
|
44
|
-
fs.
|
44
|
+
fs.cpSync(sourceCfg.path, ownConfigPath, { recursive: true });
|
45
45
|
}
|
46
46
|
|
47
47
|
// merge our configs
|
@@ -63,7 +63,7 @@ module.exports.prepare = function (cordovaProject, options) {
|
|
63
63
|
// todo: validate it? ensure all properties we expect exist?
|
64
64
|
const manifestPath = path.join(this.locations.www, 'manifest.json');
|
65
65
|
this.events.emit('verbose', `Copying ${srcManifestPath} => ${manifestPath}`);
|
66
|
-
fs.
|
66
|
+
fs.cpSync(srcManifestPath, manifestPath, { recursive: true });
|
67
67
|
} else {
|
68
68
|
this.events.emit('verbose', `Creating new manifest file in => ${this.path}`);
|
69
69
|
|
@@ -345,7 +345,7 @@ function copyResources (rootDir, resourceMap) {
|
|
345
345
|
|
346
346
|
if (elementKeys.length) {
|
347
347
|
const value = elementKeys.map((e) => element[e])[0];
|
348
|
-
fs.
|
348
|
+
fs.cpSync(path.join(rootDir, elementKeys[0]), value, { recursive: true });
|
349
349
|
}
|
350
350
|
});
|
351
351
|
}
|
package/lib/run.js
CHANGED
@@ -0,0 +1,61 @@
|
|
1
|
+
# Licensed to the Apache Software Foundation (ASF) under one
|
2
|
+
# or more contributor license agreements. See the NOTICE file
|
3
|
+
# distributed with this work for additional information
|
4
|
+
# regarding copyright ownership. The ASF licenses this file
|
5
|
+
# to you under the Apache License, Version 2.0 (the
|
6
|
+
# "License"); you may not use this file except in compliance
|
7
|
+
# with the License. You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
18
|
+
# Compiled list of allowed 3RD PARTY LICENSES from:
|
19
|
+
#
|
20
|
+
# ASF CATEGORY A: WHAT CAN WE INCLUDE IN AN ASF PROJECT
|
21
|
+
# https://www.apache.org/legal/resolved.html#category-a
|
22
|
+
#
|
23
|
+
# Licenses converted into the SPDX standardized short identifier format.
|
24
|
+
# https://spdx.org/licenses/
|
25
|
+
allowed-licenses:
|
26
|
+
- 0BSD
|
27
|
+
- AFL-3.0
|
28
|
+
- Apache-1.1
|
29
|
+
- Apache-2.0
|
30
|
+
- APAFML
|
31
|
+
- BlueOak-1.0.0
|
32
|
+
- BSD-2-Clause
|
33
|
+
- BSD-3-Clause
|
34
|
+
- BSD-3-Clause-LBNL
|
35
|
+
- BSL-1.0
|
36
|
+
- CC-PDDC
|
37
|
+
- CC0-1.0
|
38
|
+
- EPICS
|
39
|
+
- HPND
|
40
|
+
- ICU
|
41
|
+
- ISC
|
42
|
+
- MIT
|
43
|
+
- MIT-0
|
44
|
+
- MS-PL
|
45
|
+
- MulanPSL-2.0
|
46
|
+
- NCSA
|
47
|
+
- OGL-UK-3.0
|
48
|
+
- PHP-3.01
|
49
|
+
- PostgreSQL
|
50
|
+
- PSF-2.0
|
51
|
+
- Python-2.0
|
52
|
+
- SMLNJ
|
53
|
+
- Unicode-DFS-2016
|
54
|
+
- Unlicense
|
55
|
+
- UPL-1.0
|
56
|
+
- W3C
|
57
|
+
- WTFPL
|
58
|
+
- X11
|
59
|
+
- Xnet
|
60
|
+
- Zlib
|
61
|
+
- ZPL-2.0
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "cordova-electron",
|
3
|
-
"version": "4.0.1-nightly.
|
3
|
+
"version": "4.0.1-nightly.20240419000723211.sha.da605008",
|
4
4
|
"description": "electron apps as a target for cordova developers",
|
5
5
|
"main": "lib/Api.js",
|
6
6
|
"repository": "github:apache/cordova-electron",
|
@@ -20,12 +20,11 @@
|
|
20
20
|
"test:unit": "jasmine --config=tests/spec/unit.json"
|
21
21
|
},
|
22
22
|
"dependencies": {
|
23
|
-
"cordova-common": "5.0.1-nightly.
|
23
|
+
"cordova-common": "5.0.1-nightly.20240419000723210.sha.602272fe",
|
24
24
|
"electron": "^29.0.0",
|
25
25
|
"electron-builder": "^24.12.0",
|
26
26
|
"electron-devtools-installer": "^3.2.0",
|
27
|
-
"execa": "^5.1.1"
|
28
|
-
"fs-extra": "^11.2.0"
|
27
|
+
"execa": "^5.1.1"
|
29
28
|
},
|
30
29
|
"devDependencies": {
|
31
30
|
"@cordova/eslint-config": "^5.0.0",
|