From de9070805ae98d82ef5bb184b110f5faa36e06bb Mon Sep 17 00:00:00 2001 From: tharatau Date: Sat, 25 Feb 2023 01:27:57 -0500 Subject: [PATCH] feat: add macos arm support (#783) --- CHANGELOG.md | 6 + README.md | 5 +- docs/global.html | 2262 +++++++++-------------------- docs/index.html | 103 +- docs/nwbuild.js.html | 103 +- docs/scripts/linenumber.js | 38 +- docs/scripts/prettify/lang-css.js | 38 +- docs/scripts/prettify/prettify.js | 768 +++++++++- docs/styles/jsdoc-default.css | 445 +++--- docs/styles/prettify-tomorrow.css | 87 +- e2e/demo.js | 12 +- e2e/mode.js | 7 + package-lock.json | 331 +++-- package.json | 2 +- src/bld/linuxCfg.js | 6 +- src/get/decompress.js | 5 + src/get/download.js | 13 +- src/get/getReleaseInfo.js | 24 +- src/nwbuild.js | 14 +- src/util/arch.js | 4 +- src/util/osx.arm.versions.json | 17 + src/util/xattr.js | 30 + 22 files changed, 2147 insertions(+), 2173 deletions(-) create mode 100644 src/util/osx.arm.versions.json create mode 100644 src/util/xattr.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 42931caba..e4ac82d81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +## [4.1.0-beta.0] - 2023-02-25 + +## Added + +- MacOS ARM support + ## [4.1.0] - 2023-02-23 ## Added diff --git a/README.md b/README.md index 9c53b07dc..01a7ba601 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ Build [NW.js](https://github.com/nwjs/nw.js) applications for Mac, Windows and L - [Usage](https://github.com/nwutils/nw-builder#usage) - [Limitations](https://github.com/nwutils/nw-builder#limitations) - [API Reference](https://nwutils.io/nw-builder/global#nwbuild) +- [Migration Guide](https://github.com/nwutils/nw-builder#migration) - [Contributing](https://github.com/nwutils/nw-builder#contributing) - [License](https://github.com/nwutils/nw-builder#license) @@ -112,7 +113,9 @@ For more options, check out the [API reference](https://nwutils.io/nw-builder/gl - #716 File permissions are incorrectly set for Linux or MacOS apps built on Windows platform. -## Migration to v4 +## Migration + +Migrate from v3 to v4 ### Update `nw-builder` diff --git a/docs/global.html b/docs/global.html index 6533c9f6f..2a9222155 100644 --- a/docs/global.html +++ b/docs/global.html @@ -1,1849 +1,929 @@ - - + + JSDoc: Global - - + + - - - - - - -
- -

Global

- - - - - - -
- -
- -

- - -
- -
-
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - - - - - - - - - - - -

Methods

- - - - - - - -

(async) nwbuild(…options) → {Promise.<undefined>}

- - - - - - -
- Entry point for nw-builder application -
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + +
+

Global

+ +
+
+

+
+ +
+
+
+
+ +

Methods

+ +

(async) nwbuild(…options) + → {Promise.<undefined>}

+ +
+ Entry point for nw-builder application +
+ +
Parameters:
+ +
NameTypeAttributesDescription
+ + + + + + + + + + + + + + - - - - - - - - - - - - - - -
NameTypeAttributesDescription
options - - -Options - - - - - - - - - - <repeatable>
- +
+ Options Options
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise.<undefined> - - -
-
- - - - - - - - - - - -

Type Definitions

- - - -

App

- - - - - -
Type:
-
    -
  • - -object - - -
  • -
- - - - - -
Properties:
- - - - - - - - - - - - - - - - - - - - - - - - - + + + + + +
NameTypeDescription
<repeatable>
Options
+ +
+
Source:
+
+
+ +
Returns:
+ +
+
Type
+
+ Promise.<undefined> +
+
+ +

Type Definitions

+ +

App

+ +
Type:
+
    +
  • + object +
  • +
+ +
Properties:
+ + + + + + + + + + + + + + - - - - - - - - - - - - - - + + - - + - - - - - - - - - + - + + - - + - - - - - - - - - + - + + - - + - - - - - - - - - + - + + - - + - - - - - - - - - - - - - - + + - - + - - - - - - - - - + - + + - - + - - - - - - - - - + - + + - - + - - - - - - - - - + - + + - - + - - - - - - - - - + - + + - - + - - - - - - - - - - + - + + - - + - - - - - - - - - + - + + - - + - - - - - - - - - - + - + + - - + - - - - - - - - - + - + + - - + - - - - - - - - - - + - + + - - + - - - - - - - - - + - + + - - + - - - - - - - - - - + - + + - - + - - - - - - - - - + - + + - - + - - - - - - - - - - + - + + - - + - - - - - - - - - + - + + - - + - - - - - - - - - + - + + - - + - - - - - - - - - + - + + - - + - - - - - - - - - - - - - - + + - - + - - - - - - - - - + - + + - - + - - - - - - - - - + - + + - - + - - - - - - - - - + - + + - - + - - - - - - - - - - - - - - + + - - + - - - - - - - - - + - + + - - + - - - - - - - - - + - + + - - + - - - - - - - - - + - + + - - + - - - - - - - - - + - + + - - + - - - - - - - - - - + - + + - - + - - - - - - - - - + - + + - - + - - - - - - - - - - + - + + - - + - - - - - - - - - - - - - -
NameTypeDescription
name - - -string + + string + Name of the application - Linux configuration options
Name of the application Linux configuration options
genericName - - -string - - - - Generic name of the application
+ string + Generic name of the application
noDisplay - - -boolean - - - - If true the application is not displayed
+ boolean + If true the application is not displayed
comment - - -string - - - - Tooltip for the entry, for example "View sites on the Internet".
+ string + Tooltip for the entry, for example "View sites on the + Internet".
icon - - -string + + string + Icon to display in file manager, menus, etc.
Icon to display in file manager, menus, etc.
hidden - - -boolean - - - - TBD
+ boolean + TBD
onlyShowIn - - -Array.<string> - - - - A list of strings identifying the desktop environments that should (/not) display a given desktop entry
+ Array.<string> + A list of strings identifying the desktop environments that + should (/not) display a given desktop entry
notShowIn - - -Array.<string> - - - - A list of strings identifying the desktop environments that should (/not) display a given desktop entry
+ Array.<string> + A list of strings identifying the desktop environments that + should (/not) display a given desktop entry
dBusActivatable - - -boolean - - - - A boolean value specifying if D-Bus activation is supported for this application
+ boolean + A boolean value specifying if D-Bus activation is supported + for this application
tryExec - - -string - - - Path to an executable file on disk used to determine if the program is actually installed
+ string + Path to an executable file on disk used to determine if the + program is actually installed
exec - - -string - - - - Program to execute, possibly with arguments.
+ string + Program to execute, possibly with arguments.
path - - -string - - - If entry is of type Application, the working directory to run the program in.
+ string + If entry is of type Application, the working directory to run + the program in.
terminal - - -boolean - - - - Whether the program runs in a terminal window.
+ boolean + Whether the program runs in a terminal window.
actions - - -Array.<string> - - - Identifiers for application actions.
+ Array.<string> + Identifiers for application actions.
mimeType - - -Array.<string> - - - - The MIME type(s) supported by this application.
+ Array.<string> + The MIME type(s) supported by this application.
categories - - -Array.<string> - - - Categories in which the entry should be shown in a menu
+ Array.<string> + Categories in which the entry should be shown in a menu
implements - - -Array.<string> - - - - A list of interfaces that this application implements.
+ Array.<string> + A list of interfaces that this application implements.
keywords - - -Array.<string> - - - A list of strings which may be used in addition to other metadata to describe this entry.
+ Array.<string> + A list of strings which may be used in addition to other + metadata to describe this entry.
startupNotify - - -boolean - - - - If true, it is KNOWN that the application will send a "remove" message when started with the DESKTOP_STARTUP_ID environment variable set. If false, it is KNOWN that the application does not work with startup notification at all.
+ boolean + If true, it is KNOWN that the application will send a + "remove" message when started with the DESKTOP_STARTUP_ID + environment variable set. If false, it is KNOWN that the + application does not work with startup notification at + all.
startupWMClass - - -string - - - - If specified, it is known that the application will map at least one window with the given string as its WM class or WM name hin
+ string + If specified, it is known that the application will map at + least one window with the given string as its WM class or WM + name hin
prefersNonDefaultGPU - - -boolean - - - - If true, the application prefers to be run on a more powerful discrete GPU if available.
+ boolean + If true, the application prefers to be run on a more powerful + discrete GPU if available.
singleMainWindow - - -string + + string + If true, the application has a single main window, and does not support having an additional one opened. - Windows configuration options
If true, the application has a single main window, and does + not support having an additional one opened. Windows + configuration options
comments - - -string - - - - Additional information that should be displayed for diagnostic purposes.
+ string + Additional information that should be displayed for + diagnostic purposes.
company - - -string - - - - Company that produced the file—for example, Microsoft Corporation or Standard Microsystems Corporation, Inc. This string is required.
+ string + Company that produced the file—for example, Microsoft + Corporation or Standard Microsystems Corporation, Inc. This + string is required.
fileDescription - - -string - - - - File description to be presented to users. This string may be displayed in a list box when the user is choosing files to install. For example, Keyboard Driver for AT-Style Keyboards. This string is required.
+ string + File description to be presented to users. This string may be + displayed in a list box when the user is choosing files to + install. For example, Keyboard Driver for AT-Style Keyboards. + This string is required.
fileVersion - - -string + + string + Version number of the file. For example, 3.10 or 5.00.RC2. This string is required.
Version number of the file. For example, 3.10 or 5.00.RC2. + This string is required.
internalName - - -string - - - - Internal name of the file, if one exists—for example, a module name if the file is a dynamic-link library. If the file has no internal name, this string should be the original filename, without extension. This string is required.
+ string + Internal name of the file, if one exists—for example, a + module name if the file is a dynamic-link library. If the file + has no internal name, this string should be the original + filename, without extension. This string is required.
legalCopyright - - -string - - - - Copyright notices that apply to the file. This should include the full text of all notices, legal symbols, copyright dates, and so on. This string is optional.
+ string + Copyright notices that apply to the file. This should include + the full text of all notices, legal symbols, copyright dates, + and so on. This string is optional.
legalTrademark - - -string - - - - Trademarks and registered trademarks that apply to the file. This should include the full text of all notices, legal symbols, trademark numbers, and so on. This string is optional.
+ string + Trademarks and registered trademarks that apply to the file. + This should include the full text of all notices, legal + symbols, trademark numbers, and so on. This string is + optional.
originalFilename - - -string - - - - Original name of the file, not including a path. This information enables an application to determine whether a file has been renamed by a user. The format of the name depends on the file system for which the file was created. This string is required.
+ string + Original name of the file, not including a path. This + information enables an application to determine whether a file + has been renamed by a user. The format of the name depends on + the file system for which the file was created. This string is + required.
privateBuild - - -string - - - Information about a private version of the file—for example, Built by TESTER1 on \\TESTBED. This string should be present only if VS_FF_PRIVATEBUILD is specified in the fileflags parameter of the root block.
+ string + Information about a private version of the file—for example, + Built by TESTER1 on \\TESTBED. This string should be present + only if VS_FF_PRIVATEBUILD is specified in the fileflags + parameter of the root block.
productName - - -string - - - - Name of the product with which the file is distributed. This string is required.
+ string + Name of the product with which the file is distributed. This + string is required.
productVersion - - -string - - - Version of the product with which the file is distributed—for example, 3.10 or 5.00.RC2. This string is required.
+ string + Version of the product with which the file is distributed—for + example, 3.10 or 5.00.RC2. This string is required.
specialBuild - - -string - - - - Text that specifies how this version of the file differs from the standard version—for example, Private build for TESTER1 solving mouse problems on M250 and M250E computers. This string should be present only if VS_FF_SPECIALBUILD is specified in the fileflags parameter of the root block.
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - -

Options

- - - - - - -
Type:
-
    -
  • - -object + + string + -
  • -
- - - - - -
Properties:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + +
NameTypeAttributesDefaultDescription
Text that specifies how this version of the file differs from + the standard version—for example, Private build for TESTER1 + solving mouse problems on M250 and M250E computers. This + string should be present only if VS_FF_SPECIALBUILD is + specified in the fileflags parameter of the root block.
+ +
+
Source:
+
+
+ +

Options

+ +
Type:
+
    +
  • + object +
  • +
+ +
Properties:
+ + + + + + + + + + + + + + + + + + - - - - - - - - - - + - - + - + + - - + - - - - - - - - - - + - - + - + + - - + - - - - - - - - - + - - + - + + - - + - - - + - - - - + - - + - + + - - + - - - - - - - - - - + - - + - + + - - + - - - - - - - - - - + - - + - + + - - + - - - - - - - - - - + - - + - + + - - + - - - - - - - - - + - - + - + + - - + - - - - - - - - - + - - + - + + - - + - - - - - - - - - - + - - + - + + - - + - - - - - - - - - + - - + - + + - - + - - - - - - - - - + - - + - + + - - + - - - - - - - - - - + - - + - + + - - + - - - - - - - - - - + - - + - + + - - + - - - - - - - - - - - - - - - - - -
NameTypeAttributesDefaultDescription
srcDir - - -string - - - - - <optional>
- - - +
+ string - - "./" - - <optional>
String of space separated glob patterns which correspond to NW app code
"./" String of space separated glob patterns which correspond to + NW app code
mode - - -"run" -| -"build" + + "run" + | - - - - - <optional>
- - - + "build"
- - "build" - - <optional>
Run or build application
"build" Run or build application
version - - -"latest" -| + + "latest" + | -"stable" -| + "stable" + | -string - - - - - - <optional>
- - - + string
- - "latest" - - <optional>
NW runtime version
"latest" NW runtime version
flavor - - -"normal" -| - -"sdk" - - - + "normal" + | - - - - <optional>
- - - + "sdk"
- - "normal" - - <optional>
NW runtime build flavor
"normal" NW runtime build flavor
platform - - -"linux" -| - -"osx" -| -"win" + + "linux" + | + "osx" + | - - - - - + "win" - - NW supported platforms
NW supported platforms
arch - - -"ia32" -| -"x64" + + "ia32" + | + "x64" + | - - - - - + "arm64" - - NW supported architectures
NW supported architectures
outDir - - -string - - - - - <optional>
- - - +
+ string - - "./out" - - <optional>
Directory to store build artifacts
"./out" Directory to store build artifacts
cacheDir - - -"./cache" -| + + "./cache" + | -string - - - - - - <optional>
- - - + string
- - "./cache" - - <optional>
Directory to store NW binaries
"./cache" Directory to store NW binaries
downloadUrl - - -"https://dl.nwjs.io" - - - - - - <optional>
- - - +
+ "https://dl.nwjs.io" - - "https://dl.nwjs.io" - - <optional>
URI to download NW binaries from
"https://dl.nwjs.io" URI to download NW binaries from
manifestUrl - - -"https://nwjs.io/versions" - - - - - <optional>
- - - +
+ "https://nwjs.io/versions" - - "https://nwjs.io/versions" - - <optional>
URI to download manifest from
"https://nwjs.io/versions" URI to download manifest from
app - - -App - - - - - - - + + App - - Multi platform configuration options
Multi platform configuration options
cache - - -boolean - - - - - - <optional>
- - - +
+ boolean - - true - - <optional>
If true the existing cache is used. Otherwise it removes and redownloads it.
true If true the existing cache is used. Otherwise it removes and + redownloads it.
zip - - -boolean - - - - - <optional>
- - - +
+ boolean - - false - - <optional>
If true the outDir directory is zipped
false If true the outDir directory is zipped
cli - - -boolean - - - - - <optional>
- - - +
+ boolean - - false - - <optional>
If true the CLI is used to glob srcDir and parse other options
false If true the CLI is used to glob srcDir and parse other + options
ffmpeg - - -boolean - - - - - - <optional>
- - +
+ boolean - - false - - If true the chromium ffmpeg is replaced by community version
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - -
- -
- - - - -
- - - -
- - + <optional>
+ + false + + If true the chromium ffmpeg is replaced by community + version + + + + +
+
Source:
+
+
+ + + - - - - \ No newline at end of file + + +
+ + + + + + + diff --git a/docs/index.html b/docs/index.html index 17a612784..e0f083ed0 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,65 +1,52 @@ - - + + JSDoc: Home - - + + - - - - - - -
- -

Home

- - - - - - - - -

- - - - - - - - - - - - - - - - - - - - -
- - - -
- - - - - - - \ No newline at end of file + + + + + +
+

Home

+ +

+
+ + + +
+ + + + + + + diff --git a/docs/nwbuild.js.html b/docs/nwbuild.js.html index 3362dd546..10c738686 100644 --- a/docs/nwbuild.js.html +++ b/docs/nwbuild.js.html @@ -1,32 +1,35 @@ - - + + JSDoc: Source: nwbuild.js - - + + - - - - - - -
- -

Source: nwbuild.js

- - - - - - -
+ + + + + +
+

Source: nwbuild.js

+ +
-
import { mkdir, rm } from "node:fs/promises";
+          
import { mkdir, rm } from "node:fs/promises";
 import { resolve } from "node:path";
 
 import { decompress } from "./get/decompress.js";
@@ -40,6 +43,7 @@ 

Source: nwbuild.js

import { getOptions } from "./util/options.js"; import { parse } from "./util/parse.js"; import { validate } from "./util/validate.js"; +import { xattr } from "./util/xattr.js"; import { log } from "./log.js"; @@ -90,7 +94,7 @@

Source: nwbuild.js

* @property {"latest" | "stable" | string} [version="latest"] NW runtime version * @property {"normal" | "sdk"} [flavor="normal"] NW runtime build flavor * @property {"linux" | "osx" | "win"} platform NW supported platforms - * @property {"ia32" | "x64"} arch NW supported architectures + * @property {"ia32" | "x64" | "arm64"} arch NW supported architectures * @property {string} [outDir="./out"] Directory to store build artifacts * @property {"./cache" | string} [cacheDir="./cache"] Directory to store NW binaries * @property {"https://dl.nwjs.io"} [downloadUrl="https://dl.nwjs.io"] URI to download NW binaries from @@ -138,6 +142,8 @@

Source: nwbuild.js

// Validate options.version to get the version specific release info releaseInfo = await getReleaseInfo( options.version, + options.platform, + options.arch, options.cacheDir, options.manifestUrl, ); @@ -149,7 +155,8 @@

Source: nwbuild.js

// Variable to store nwDir file path nwDir = resolve( options.cacheDir, - `nwjs${options.flavor === "sdk" ? "-sdk" : ""}-v${options.version}-${options.platform + `nwjs${options.flavor === "sdk" ? "-sdk" : ""}-v${options.version}-${ + options.platform }-${options.arch}`, ); @@ -175,7 +182,9 @@

Source: nwbuild.js

} if (options.ffmpeg === true) { - log.warn("Using MP3 and H.264 codecs requires you to pay attention to the patent royalties and the license of the source code. Consult a lawyer if you do not understand the licensing constraints and using patented media formats in your app. See https://chromium.googlesource.com/chromium/third_party/ffmpeg.git/+/master/CREDITS.chromium for more information."); + log.warn( + "Using MP3 and H.264 codecs requires you to pay attention to the patent royalties and the license of the source code. Consult a lawyer if you do not understand the licensing constraints and using patented media formats in your app. See https://chromium.googlesource.com/chromium/third_party/ffmpeg.git/+/master/CREDITS.chromium for more information.", + ); if (options.platform === "win") { ffmpegFile = "libffmpeg.dll"; } else if (options.platform === "osx") { @@ -217,6 +226,8 @@

Source: nwbuild.js

} } + await xattr(options.platform, options.arch, nwDir); + if (options.mode === "run") { await develop(options.srcDir, nwDir, options.platform, options.argv); } @@ -240,24 +251,28 @@

Source: nwbuild.js

export default nwbuild;
-
- - - - -
- - - -
- -
- Documentation generated by JSDoc 4.0.2 on Thu Feb 23 2023 22:29:58 GMT-0500 (Eastern Standard Time) -
- - - - +
+
+ + + +
+ +
+ Documentation generated by + JSDoc 4.0.2 on Sat Feb 25 + 2023 01:17:41 GMT-0500 (Eastern Standard Time) +
+ + + + diff --git a/docs/scripts/linenumber.js b/docs/scripts/linenumber.js index 4354785ce..e1b852fb2 100644 --- a/docs/scripts/linenumber.js +++ b/docs/scripts/linenumber.js @@ -1,25 +1,25 @@ /*global document */ (() => { - const source = document.getElementsByClassName('prettyprint source linenums'); - let i = 0; - let lineNumber = 0; - let lineId; - let lines; - let totalLines; - let anchorHash; + const source = document.getElementsByClassName("prettyprint source linenums"); + let i = 0; + let lineNumber = 0; + let lineId; + let lines; + let totalLines; + let anchorHash; - if (source && source[0]) { - anchorHash = document.location.hash.substring(1); - lines = source[0].getElementsByTagName('li'); - totalLines = lines.length; + if (source && source[0]) { + anchorHash = document.location.hash.substring(1); + lines = source[0].getElementsByTagName("li"); + totalLines = lines.length; - for (; i < totalLines; i++) { - lineNumber++; - lineId = `line${lineNumber}`; - lines[i].id = lineId; - if (lineId === anchorHash) { - lines[i].className += ' selected'; - } - } + for (; i < totalLines; i++) { + lineNumber++; + lineId = `line${lineNumber}`; + lines[i].id = lineId; + if (lineId === anchorHash) { + lines[i].className += " selected"; + } } + } })(); diff --git a/docs/scripts/prettify/lang-css.js b/docs/scripts/prettify/lang-css.js index 041e1f590..1918eab5c 100644 --- a/docs/scripts/prettify/lang-css.js +++ b/docs/scripts/prettify/lang-css.js @@ -1,2 +1,36 @@ -PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n "]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com", -/^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]); +PR.registerLangHandler( + PR.createSimpleLexer( + [["pln", /^[\t\n\f\r ]+/, null, " \t\r\n "]], + [ + ["str", /^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/, null], + ["str", /^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/, null], + ["lang-css-str", /^url\(([^"')]*)\)/i], + [ + "kwd", + /^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i, + null, + ], + [ + "lang-css-kw", + /^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i, + ], + ["com", /^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//], + ["com", /^(?:<\!--|--\>)/], + ["lit", /^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i], + ["lit", /^#[\da-f]{3,6}/i], + ["pln", /^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i], + ["pun", /^[^\s\w"']+/], + ], + ), + ["css"], +); +PR.registerLangHandler( + PR.createSimpleLexer( + [], + [["kwd", /^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]], + ), + ["css-kw"], +); +PR.registerLangHandler(PR.createSimpleLexer([], [["str", /^[^"')]+/]]), [ + "css-str", +]); diff --git a/docs/scripts/prettify/prettify.js b/docs/scripts/prettify/prettify.js index eef5ad7e6..4a39e5224 100644 --- a/docs/scripts/prettify/prettify.js +++ b/docs/scripts/prettify/prettify.js @@ -1,28 +1,740 @@ -var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; -(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a= -[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m), -l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, -q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/, -q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g, -"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a), -a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e} -for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], -"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"], -H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], -J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+ -I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]), -["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css", -/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}), -["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes", -hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p=0){var k=k.match(g),f,b;if(b= -!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p 122 || + (d < 65 || + j > 90 || + b.push([Math.max(65, j) | 32, Math.min(d, 90) | 32]), + d < 97 || + j > 122 || + b.push([Math.max(97, j) & -33, Math.min(d, 122) & -33])); + } + } + b.sort(function (a, f) { + return a[0] - f[0] || f[1] - a[1]; + }); + f = []; + j = [NaN, NaN]; + for (c = 0; c < b.length; ++c) + (i = b[c]), + i[0] <= j[1] + 1 ? (j[1] = Math.max(j[1], i[1])) : f.push((j = i)); + b = ["["]; + o && b.push("^"); + b.push.apply(b, a); + for (c = 0; c < f.length; ++c) + (i = f[c]), + b.push(e(i[0])), + i[1] > i[0] && (i[1] + 1 > i[0] && b.push("-"), b.push(e(i[1]))); + b.push("]"); + return b.join(""); + } + function y(a) { + for ( + var f = a.source.match( + /\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g, + ), + b = f.length, + d = [], + c = 0, + i = 0; + c < b; + ++c + ) { + var j = f[c]; + j === "(" + ? ++i + : "\\" === j.charAt(0) && + (j = +j.substring(1)) && + j <= i && + (d[j] = -1); + } + for (c = 1; c < d.length; ++c) -1 === d[c] && (d[c] = ++t); + for (i = c = 0; c < b; ++c) + (j = f[c]), + j === "(" + ? (++i, d[i] === void 0 && (f[c] = "(?:")) + : "\\" === j.charAt(0) && + (j = +j.substring(1)) && + j <= i && + (f[c] = "\\" + d[i]); + for (i = c = 0; c < b; ++c) + "^" === f[c] && "^" !== f[c + 1] && (f[c] = ""); + if (a.ignoreCase && s) + for (c = 0; c < b; ++c) + (j = f[c]), + (a = j.charAt(0)), + j.length >= 2 && a === "[" + ? (f[c] = h(j)) + : a !== "\\" && + (f[c] = j.replace(/[A-Za-z]/g, function (a) { + a = a.charCodeAt(0); + return "[" + String.fromCharCode(a & -33, a | 32) + "]"; + })); + return f.join(""); + } + for (var t = 0, s = !1, l = !1, p = 0, d = a.length; p < d; ++p) { + var g = a[p]; + if (g.ignoreCase) l = !0; + else if ( + /[a-z]/i.test( + g.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi, ""), + ) + ) { + s = !0; + l = !1; + break; + } + } + for ( + var r = { b: 8, t: 9, n: 10, v: 11, f: 12, r: 13 }, + n = [], + p = 0, + d = a.length; + p < d; + ++p + ) { + g = a[p]; + if (g.global || g.multiline) throw Error("" + g); + n.push("(?:" + y(g) + ")"); + } + return RegExp(n.join("|"), l ? "gi" : "g"); + } + function M(a) { + function m(a) { + switch (a.nodeType) { + case 1: + if (e.test(a.className)) break; + for (var g = a.firstChild; g; g = g.nextSibling) m(g); + g = a.nodeName; + if ("BR" === g || "LI" === g) + (h[s] = "\n"), (t[s << 1] = y++), (t[(s++ << 1) | 1] = a); + break; + case 3: + case 4: + (g = a.nodeValue), + g.length && + ((g = p + ? g.replace(/\r\n?/g, "\n") + : g.replace(/[\t\n\r ]+/g, " ")), + (h[s] = g), + (t[s << 1] = y), + (y += g.length), + (t[(s++ << 1) | 1] = a)); + } + } + var e = /(?:^|\s)nocode(?:\s|$)/, + h = [], + y = 0, + t = [], + s = 0, + l; + a.currentStyle + ? (l = a.currentStyle.whiteSpace) + : window.getComputedStyle && + (l = document.defaultView + .getComputedStyle(a, q) + .getPropertyValue("white-space")); + var p = l && "pre" === l.substring(0, 3); + m(a); + return { a: h.join("").replace(/\n$/, ""), c: t }; + } + function B(a, m, e, h) { + m && ((a = { a: m, d: a }), e(a), h.push.apply(h, a.e)); + } + function x(a, m) { + function e(a) { + for ( + var l = a.d, + p = [l, "pln"], + d = 0, + g = a.a.match(y) || [], + r = {}, + n = 0, + z = g.length; + n < z; + ++n + ) { + var f = g[n], + b = r[f], + o = void 0, + c; + if (typeof b === "string") c = !1; + else { + var i = h[f.charAt(0)]; + if (i) (o = f.match(i[1])), (b = i[0]); + else { + for (c = 0; c < t; ++c) + if (((i = m[c]), (o = f.match(i[1])))) { + b = i[0]; + break; + } + o || (b = "pln"); + } + if ( + (c = b.length >= 5 && "lang-" === b.substring(0, 5)) && + !(o && typeof o[1] === "string") + ) + (c = !1), (b = "src"); + c || (r[f] = b); + } + i = d; + d += f.length; + if (c) { + c = o[1]; + var j = f.indexOf(c), + k = j + c.length; + o[2] && ((k = f.length - o[2].length), (j = k - c.length)); + b = b.substring(5); + B(l + i, f.substring(0, j), e, p); + B(l + i + j, c, C(b, c), p); + B(l + i + k, f.substring(k), e, p); + } else p.push(l + i, b); + } + a.e = p; + } + var h = {}, + y; + (function () { + for ( + var e = a.concat(m), l = [], p = {}, d = 0, g = e.length; + d < g; + ++d + ) { + var r = e[d], + n = r[3]; + if (n) for (var k = n.length; --k >= 0; ) h[n.charAt(k)] = r; + r = r[1]; + n = "" + r; + p.hasOwnProperty(n) || (l.push(r), (p[n] = q)); + } + l.push(/[\S\s]/); + y = L(l); + })(); + var t = m.length; + return e; + } + function u(a) { + var m = [], + e = []; + a.tripleQuotedStrings + ? m.push([ + "str", + /^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/, + q, + "'\"", + ]) + : a.multiLineStrings + ? m.push([ + "str", + /^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, + q, + "'\"`", + ]) + : m.push([ + "str", + /^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/, + q, + "\"'", + ]); + a.verbatimStrings && e.push(["str", /^@"(?:[^"]|"")*(?:"|$)/, q]); + var h = a.hashComments; + h && + (a.cStyleComments + ? (h > 1 + ? m.push(["com", /^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/, q, "#"]) + : m.push([ + "com", + /^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/, + q, + "#", + ]), + e.push([ + "str", + /^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/, + q, + ])) + : m.push(["com", /^#[^\n\r]*/, q, "#"])); + a.cStyleComments && + (e.push(["com", /^\/\/[^\n\r]*/, q]), + e.push(["com", /^\/\*[\S\s]*?(?:\*\/|$)/, q])); + a.regexLiterals && + e.push([ + "lang-regex", + /^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/, + ]); + (h = a.types) && e.push(["typ", h]); + a = ("" + a.keywords).replace(/^ | $/g, ""); + a.length && + e.push(["kwd", RegExp("^(?:" + a.replace(/[\s,]+/g, "|") + ")\\b"), q]); + m.push(["pln", /^\s+/, q, " \r\n\t\xa0"]); + e.push( + ["lit", /^@[$_a-z][\w$@]*/i, q], + ["typ", /^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/, q], + ["pln", /^[$_a-z][\w$@]*/i, q], + [ + "lit", + /^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i, + q, + "0123456789", + ], + ["pln", /^\\[\S\s]?/, q], + ["pun", /^.[^\s\w"-$'./@\\`]*/, q], + ); + return x(m, e); + } + function D(a, m) { + function e(a) { + switch (a.nodeType) { + case 1: + if (k.test(a.className)) break; + if ("BR" === a.nodeName) + h(a), a.parentNode && a.parentNode.removeChild(a); + else for (a = a.firstChild; a; a = a.nextSibling) e(a); + break; + case 3: + case 4: + if (p) { + var b = a.nodeValue, + d = b.match(t); + if (d) { + var c = b.substring(0, d.index); + a.nodeValue = c; + (b = b.substring(d.index + d[0].length)) && + a.parentNode.insertBefore(s.createTextNode(b), a.nextSibling); + h(a); + c || a.parentNode.removeChild(a); + } + } + } + } + function h(a) { + function b(a, d) { + var e = d ? a.cloneNode(!1) : a, + f = a.parentNode; + if (f) { + var f = b(f, 1), + g = a.nextSibling; + f.appendChild(e); + for (var h = g; h; h = g) (g = h.nextSibling), f.appendChild(h); + } + return e; + } + for (; !a.nextSibling; ) if (((a = a.parentNode), !a)) return; + for ( + var a = b(a.nextSibling, 0), e; + (e = a.parentNode) && e.nodeType === 1; + + ) + a = e; + d.push(a); + } + var k = /(?:^|\s)nocode(?:\s|$)/, + t = /\r\n?|\n/, + s = a.ownerDocument, + l; + a.currentStyle + ? (l = a.currentStyle.whiteSpace) + : window.getComputedStyle && + (l = s.defaultView + .getComputedStyle(a, q) + .getPropertyValue("white-space")); + var p = l && "pre" === l.substring(0, 3); + for (l = s.createElement("LI"); a.firstChild; ) l.appendChild(a.firstChild); + for (var d = [l], g = 0; g < d.length; ++g) e(d[g]); + m === (m | 0) && d[0].setAttribute("value", m); + var r = s.createElement("OL"); + r.className = "linenums"; + for (var n = Math.max(0, (m - 1) | 0) || 0, g = 0, z = d.length; g < z; ++g) + (l = d[g]), + (l.className = "L" + ((g + n) % 10)), + l.firstChild || l.appendChild(s.createTextNode("\xa0")), + r.appendChild(l); + a.appendChild(r); + } + function k(a, m) { + for (var e = m.length; --e >= 0; ) { + var h = m[e]; + A.hasOwnProperty(h) + ? window.console && + console.warn("cannot override language handler %s", h) + : (A[h] = a); + } + } + function C(a, m) { + if (!a || !A.hasOwnProperty(a)) + a = /^\s*= o && (h += 2); + e >= c && (a += 2); + } + } catch (w) { + "console" in window && console.log(w && w.stack ? w.stack : w); + } + } + var v = ["break,continue,do,else,for,if,return,while"], + w = [ + [ + v, + "auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile", + ], + "catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof", + ], + F = [ + w, + "alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where", + ], + G = [ + w, + "abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient", + ], + H = [ + G, + "as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var", + ], + w = [ + w, + "debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN", + ], + I = [ + v, + "and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None", + ], + J = [ + v, + "alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END", + ], + v = [v, "case,done,elif,esac,eval,fi,function,in,local,set,then,until"], + K = + /^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/, + N = /\S/, + O = u({ + keywords: [ + F, + H, + w, + "caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END" + + I, + J, + v, + ], + hashComments: !0, + cStyleComments: !0, + multiLineStrings: !0, + regexLiterals: !0, + }), + A = {}; + k(O, ["default-code"]); + k( + x( + [], + [ + ["pln", /^[^]*(?:>|$)/], + ["com", /^<\!--[\S\s]*?(?:--\>|$)/], + ["lang-", /^<\?([\S\s]+?)(?:\?>|$)/], + ["lang-", /^<%([\S\s]+?)(?:%>|$)/], + ["pun", /^(?:<[%?]|[%?]>)/], + ["lang-", /^]*>([\S\s]+?)<\/xmp\b[^>]*>/i], + ["lang-js", /^]*>([\S\s]*?)(<\/script\b[^>]*>)/i], + ["lang-css", /^]*>([\S\s]*?)(<\/style\b[^>]*>)/i], + ["lang-in.tag", /^(<\/?[a-z][^<>]*>)/i], + ], + ), + ["default-markup", "htm", "html", "mxml", "xhtml", "xml", "xsl"], + ); + k( + x( + [ + ["pln", /^\s+/, q, " \t\r\n"], + ["atv", /^(?:"[^"]*"?|'[^']*'?)/, q, "\"'"], + ], + [ + ["tag", /^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i], + ["atn", /^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i], + ["lang-uq.val", /^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/], + ["pun", /^[/<->]+/], + ["lang-js", /^on\w+\s*=\s*"([^"]+)"/i], + ["lang-js", /^on\w+\s*=\s*'([^']+)'/i], + ["lang-js", /^on\w+\s*=\s*([^\s"'>]+)/i], + ["lang-css", /^style\s*=\s*"([^"]+)"/i], + ["lang-css", /^style\s*=\s*'([^']+)'/i], + ["lang-css", /^style\s*=\s*([^\s"'>]+)/i], + ], + ), + ["in.tag"], + ); + k(x([], [["atv", /^[\S\s]+/]]), ["uq.val"]); + k(u({ keywords: F, hashComments: !0, cStyleComments: !0, types: K }), [ + "c", + "cc", + "cpp", + "cxx", + "cyc", + "m", + ]); + k(u({ keywords: "null,true,false" }), ["json"]); + k( + u({ + keywords: H, + hashComments: !0, + cStyleComments: !0, + verbatimStrings: !0, + types: K, + }), + ["cs"], + ); + k(u({ keywords: G, cStyleComments: !0 }), ["java"]); + k(u({ keywords: v, hashComments: !0, multiLineStrings: !0 }), [ + "bsh", + "csh", + "sh", + ]); + k( + u({ + keywords: I, + hashComments: !0, + multiLineStrings: !0, + tripleQuotedStrings: !0, + }), + ["cv", "py"], + ); + k( + u({ + keywords: + "caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END", + hashComments: !0, + multiLineStrings: !0, + regexLiterals: !0, + }), + ["perl", "pl", "pm"], + ); + k( + u({ + keywords: J, + hashComments: !0, + multiLineStrings: !0, + regexLiterals: !0, + }), + ["rb"], + ); + k(u({ keywords: w, cStyleComments: !0, regexLiterals: !0 }), ["js"]); + k( + u({ + keywords: + "all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes", + hashComments: 3, + cStyleComments: !0, + multilineStrings: !0, + tripleQuotedStrings: !0, + regexLiterals: !0, + }), + ["coffee"], + ); + k(x([], [["str", /^[\S\s]+/]]), ["regex"]); + window.prettyPrintOne = function (a, m, e) { + var h = document.createElement("PRE"); + h.innerHTML = a; + e && D(h, e); + E({ g: m, i: e, h: h }); + return h.innerHTML; + }; + window.prettyPrint = function (a) { + function m() { + for ( + var e = window.PR_SHOULD_USE_CONTINUATION ? l.now() + 250 : Infinity; + p < h.length && l.now() < e; + p++ + ) { + var n = h[p], + k = n.className; + if (k.indexOf("prettyprint") >= 0) { + var k = k.match(g), + f, + b; + if ((b = !k)) { + b = n; + for (var o = void 0, c = b.firstChild; c; c = c.nextSibling) + var i = c.nodeType, + o = + i === 1 + ? o + ? b + : c + : i === 3 + ? N.test(c.nodeValue) + ? b + : o + : o; + b = (f = o === b ? void 0 : o) && "CODE" === f.tagName; + } + b && (k = f.className.match(g)); + k && (k = k[1]); + b = !1; + for (o = n.parentNode; o; o = o.parentNode) + if ( + (o.tagName === "pre" || + o.tagName === "code" || + o.tagName === "xmp") && + o.className && + o.className.indexOf("prettyprint") >= 0 + ) { + b = !0; + break; + } + b || + ((b = (b = n.className.match(/\blinenums\b(?::(\d+))?/)) + ? b[1] && b[1].length + ? +b[1] + : !0 + : !1) && D(n, b), + (d = { g: k, h: n, i: b }), + E(d)); + } + } + p < h.length ? setTimeout(m, 250) : a && a(); + } + for ( + var e = [ + document.getElementsByTagName("pre"), + document.getElementsByTagName("code"), + document.getElementsByTagName("xmp"), + ], + h = [], + k = 0; + k < e.length; + ++k + ) + for (var t = 0, s = e[k].length; t < s; ++t) h.push(e[k][t]); + var e = q, + l = Date; + l.now || + (l = { + now: function () { + return +new Date(); + }, + }); + var p = 0, + d, + g = /\blang(?:uage)?-([\w.]+)(?!\S)/; + m(); + }; + window.PR = { + createSimpleLexer: x, + registerLangHandler: k, + sourceDecorator: u, + PR_ATTRIB_NAME: "atn", + PR_ATTRIB_VALUE: "atv", + PR_COMMENT: "com", + PR_DECLARATION: "dec", + PR_KEYWORD: "kwd", + PR_LITERAL: "lit", + PR_NOCODE: "nocode", + PR_PLAIN: "pln", + PR_PUNCTUATION: "pun", + PR_SOURCE: "src", + PR_STRING: "str", + PR_TAG: "tag", + PR_TYPE: "typ", + }; +})(); diff --git a/docs/styles/jsdoc-default.css b/docs/styles/jsdoc-default.css index 7d1729dc9..44a9ba8f4 100644 --- a/docs/styles/jsdoc-default.css +++ b/docs/styles/jsdoc-default.css @@ -1,307 +1,326 @@ @font-face { - font-family: 'Open Sans'; - font-weight: normal; - font-style: normal; - src: url('../fonts/OpenSans-Regular-webfont.eot'); - src: - local('Open Sans'), - local('OpenSans'), - url('../fonts/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'), - url('../fonts/OpenSans-Regular-webfont.woff') format('woff'), - url('../fonts/OpenSans-Regular-webfont.svg#open_sansregular') format('svg'); + font-family: "Open Sans"; + font-weight: normal; + font-style: normal; + src: url("../fonts/OpenSans-Regular-webfont.eot"); + src: local("Open Sans"), local("OpenSans"), + url("../fonts/OpenSans-Regular-webfont.eot?#iefix") + format("embedded-opentype"), + url("../fonts/OpenSans-Regular-webfont.woff") format("woff"), + url("../fonts/OpenSans-Regular-webfont.svg#open_sansregular") format("svg"); } @font-face { - font-family: 'Open Sans Light'; - font-weight: normal; - font-style: normal; - src: url('../fonts/OpenSans-Light-webfont.eot'); - src: - local('Open Sans Light'), - local('OpenSans Light'), - url('../fonts/OpenSans-Light-webfont.eot?#iefix') format('embedded-opentype'), - url('../fonts/OpenSans-Light-webfont.woff') format('woff'), - url('../fonts/OpenSans-Light-webfont.svg#open_sanslight') format('svg'); + font-family: "Open Sans Light"; + font-weight: normal; + font-style: normal; + src: url("../fonts/OpenSans-Light-webfont.eot"); + src: local("Open Sans Light"), local("OpenSans Light"), + url("../fonts/OpenSans-Light-webfont.eot?#iefix") + format("embedded-opentype"), + url("../fonts/OpenSans-Light-webfont.woff") format("woff"), + url("../fonts/OpenSans-Light-webfont.svg#open_sanslight") format("svg"); } -html -{ - overflow: auto; - background-color: #fff; - font-size: 14px; +html { + overflow: auto; + background-color: #fff; + font-size: 14px; } -body -{ - font-family: 'Open Sans', sans-serif; - line-height: 1.5; - color: #4d4e53; - background-color: white; +body { + font-family: "Open Sans", sans-serif; + line-height: 1.5; + color: #4d4e53; + background-color: white; } -a, a:visited, a:active { - color: #0095dd; - text-decoration: none; +a, +a:visited, +a:active { + color: #0095dd; + text-decoration: none; } a:hover { - text-decoration: underline; + text-decoration: underline; } -header -{ - display: block; - padding: 0px 4px; +header { + display: block; + padding: 0px 4px; } -tt, code, kbd, samp { - font-family: Consolas, Monaco, 'Andale Mono', monospace; +tt, +code, +kbd, +samp { + font-family: Consolas, Monaco, "Andale Mono", monospace; } .class-description { - font-size: 130%; - line-height: 140%; - margin-bottom: 1em; - margin-top: 1em; + font-size: 130%; + line-height: 140%; + margin-bottom: 1em; + margin-top: 1em; } .class-description:empty { - margin: 0; + margin: 0; } #main { - float: left; - width: 70%; + float: left; + width: 70%; } article dl { - margin-bottom: 40px; + margin-bottom: 40px; } article img { max-width: 100%; } -section -{ - display: block; - background-color: #fff; - padding: 12px 24px; - border-bottom: 1px solid #ccc; - margin-right: 30px; +section { + display: block; + background-color: #fff; + padding: 12px 24px; + border-bottom: 1px solid #ccc; + margin-right: 30px; } .variation { - display: none; + display: none; } .signature-attributes { - font-size: 60%; - color: #aaa; - font-style: italic; - font-weight: lighter; + font-size: 60%; + color: #aaa; + font-style: italic; + font-weight: lighter; } -nav -{ - display: block; - float: right; - margin-top: 28px; - width: 30%; - box-sizing: border-box; - border-left: 1px solid #ccc; - padding-left: 16px; +nav { + display: block; + float: right; + margin-top: 28px; + width: 30%; + box-sizing: border-box; + border-left: 1px solid #ccc; + padding-left: 16px; } nav ul { - font-family: 'Lucida Grande', 'Lucida Sans Unicode', arial, sans-serif; - font-size: 100%; - line-height: 17px; - padding: 0; - margin: 0; - list-style-type: none; + font-family: "Lucida Grande", "Lucida Sans Unicode", arial, sans-serif; + font-size: 100%; + line-height: 17px; + padding: 0; + margin: 0; + list-style-type: none; } -nav ul a, nav ul a:visited, nav ul a:active { - font-family: Consolas, Monaco, 'Andale Mono', monospace; - line-height: 18px; - color: #4D4E53; +nav ul a, +nav ul a:visited, +nav ul a:active { + font-family: Consolas, Monaco, "Andale Mono", monospace; + line-height: 18px; + color: #4d4e53; } nav h3 { - margin-top: 12px; + margin-top: 12px; } nav li { - margin-top: 6px; + margin-top: 6px; } footer { - display: block; - padding: 6px; - margin-top: 12px; - font-style: italic; - font-size: 90%; + display: block; + padding: 6px; + margin-top: 12px; + font-style: italic; + font-size: 90%; } -h1, h2, h3, h4 { - font-weight: 200; - margin: 0; +h1, +h2, +h3, +h4 { + font-weight: 200; + margin: 0; } -h1 -{ - font-family: 'Open Sans Light', sans-serif; - font-size: 48px; - letter-spacing: -2px; - margin: 12px 24px 20px; +h1 { + font-family: "Open Sans Light", sans-serif; + font-size: 48px; + letter-spacing: -2px; + margin: 12px 24px 20px; } -h2, h3.subsection-title -{ - font-size: 30px; - font-weight: 700; - letter-spacing: -1px; - margin-bottom: 12px; +h2, +h3.subsection-title { + font-size: 30px; + font-weight: 700; + letter-spacing: -1px; + margin-bottom: 12px; } -h3 -{ - font-size: 24px; - letter-spacing: -0.5px; - margin-bottom: 12px; +h3 { + font-size: 24px; + letter-spacing: -0.5px; + margin-bottom: 12px; } -h4 -{ - font-size: 18px; - letter-spacing: -0.33px; - margin-bottom: 12px; - color: #4d4e53; +h4 { + font-size: 18px; + letter-spacing: -0.33px; + margin-bottom: 12px; + color: #4d4e53; } -h5, .container-overview .subsection-title -{ - font-size: 120%; - font-weight: bold; - letter-spacing: -0.01em; - margin: 8px 0 3px 0; +h5, +.container-overview .subsection-title { + font-size: 120%; + font-weight: bold; + letter-spacing: -0.01em; + margin: 8px 0 3px 0; } -h6 -{ - font-size: 100%; - letter-spacing: -0.01em; - margin: 6px 0 3px 0; - font-style: italic; +h6 { + font-size: 100%; + letter-spacing: -0.01em; + margin: 6px 0 3px 0; + font-style: italic; } -table -{ - border-spacing: 0; - border: 0; - border-collapse: collapse; +table { + border-spacing: 0; + border: 0; + border-collapse: collapse; } -td, th -{ - border: 1px solid #ddd; - margin: 0px; - text-align: left; - vertical-align: top; - padding: 4px 6px; - display: table-cell; +td, +th { + border: 1px solid #ddd; + margin: 0px; + text-align: left; + vertical-align: top; + padding: 4px 6px; + display: table-cell; } -thead tr -{ - background-color: #ddd; - font-weight: bold; +thead tr { + background-color: #ddd; + font-weight: bold; } -th { border-right: 1px solid #aaa; } -tr > th:last-child { border-right: 1px solid #ddd; } +th { + border-right: 1px solid #aaa; +} +tr > th:last-child { + border-right: 1px solid #ddd; +} -.ancestors, .attribs { color: #999; } -.ancestors a, .attribs a -{ - color: #999 !important; - text-decoration: none; +.ancestors, +.attribs { + color: #999; +} +.ancestors a, +.attribs a { + color: #999 !important; + text-decoration: none; } -.clear -{ - clear: both; +.clear { + clear: both; } -.important -{ - font-weight: bold; - color: #950B02; +.important { + font-weight: bold; + color: #950b02; } .yes-def { - text-indent: -1000px; + text-indent: -1000px; } .type-signature { - color: #aaa; + color: #aaa; } -.name, .signature { - font-family: Consolas, Monaco, 'Andale Mono', monospace; +.name, +.signature { + font-family: Consolas, Monaco, "Andale Mono", monospace; } -.details { margin-top: 14px; border-left: 2px solid #DDD; } -.details dt { width: 120px; float: left; padding-left: 10px; padding-top: 6px; } -.details dd { margin-left: 70px; } -.details ul { margin: 0; } -.details ul { list-style-type: none; } -.details li { margin-left: 30px; padding-top: 6px; } -.details pre.prettyprint { margin: 0 } -.details .object-value { padding-top: 0; } +.details { + margin-top: 14px; + border-left: 2px solid #ddd; +} +.details dt { + width: 120px; + float: left; + padding-left: 10px; + padding-top: 6px; +} +.details dd { + margin-left: 70px; +} +.details ul { + margin: 0; +} +.details ul { + list-style-type: none; +} +.details li { + margin-left: 30px; + padding-top: 6px; +} +.details pre.prettyprint { + margin: 0; +} +.details .object-value { + padding-top: 0; +} .description { - margin-bottom: 1em; - margin-top: 1em; + margin-bottom: 1em; + margin-top: 1em; } -.code-caption -{ - font-style: italic; - font-size: 107%; - margin: 0; +.code-caption { + font-style: italic; + font-size: 107%; + margin: 0; } -.source -{ - border: 1px solid #ddd; - width: 80%; - overflow: auto; +.source { + border: 1px solid #ddd; + width: 80%; + overflow: auto; } .prettyprint.source { - width: inherit; + width: inherit; } -.source code -{ - font-size: 100%; - line-height: 18px; - display: block; - padding: 4px 12px; - margin: 0; - background-color: #fff; - color: #4D4E53; +.source code { + font-size: 100%; + line-height: 18px; + display: block; + padding: 4px 12px; + margin: 0; + background-color: #fff; + color: #4d4e53; } -.prettyprint code span.line -{ +.prettyprint code span.line { display: inline-block; } -.prettyprint.linenums -{ +.prettyprint.linenums { padding-left: 70px; -webkit-user-select: none; -moz-user-select: none; @@ -309,50 +328,46 @@ tr > th:last-child { border-right: 1px solid #ddd; } user-select: none; } -.prettyprint.linenums ol -{ +.prettyprint.linenums ol { padding-left: 0; } -.prettyprint.linenums li -{ +.prettyprint.linenums li { border-left: 3px #ddd solid; } .prettyprint.linenums li.selected, -.prettyprint.linenums li.selected * -{ +.prettyprint.linenums li.selected * { background-color: lightyellow; } -.prettyprint.linenums li * -{ +.prettyprint.linenums li * { -webkit-user-select: text; -moz-user-select: text; -ms-user-select: text; user-select: text; } -.params .name, .props .name, .name code { - color: #4D4E53; - font-family: Consolas, Monaco, 'Andale Mono', monospace; - font-size: 100%; +.params .name, +.props .name, +.name code { + color: #4d4e53; + font-family: Consolas, Monaco, "Andale Mono", monospace; + font-size: 100%; } .params td.description > p:first-child, -.props td.description > p:first-child -{ - margin-top: 0; - padding-top: 0; +.props td.description > p:first-child { + margin-top: 0; + padding-top: 0; } .params td.description > p:last-child, -.props td.description > p:last-child -{ - margin-bottom: 0; - padding-bottom: 0; +.props td.description > p:last-child { + margin-bottom: 0; + padding-bottom: 0; } .disabled { - color: #454545; + color: #454545; } diff --git a/docs/styles/prettify-tomorrow.css b/docs/styles/prettify-tomorrow.css index b6f92a78d..3c8d71ee5 100644 --- a/docs/styles/prettify-tomorrow.css +++ b/docs/styles/prettify-tomorrow.css @@ -4,96 +4,124 @@ /* SPAN elements with the classes below are added by prettyprint. */ /* plain text */ .pln { - color: #4d4d4c; } + color: #4d4d4c; +} @media screen { /* string content */ .str { - color: #718c00; } + color: #718c00; + } /* a keyword */ .kwd { - color: #8959a8; } + color: #8959a8; + } /* a comment */ .com { - color: #8e908c; } + color: #8e908c; + } /* a type name */ .typ { - color: #4271ae; } + color: #4271ae; + } /* a literal value */ .lit { - color: #f5871f; } + color: #f5871f; + } /* punctuation */ .pun { - color: #4d4d4c; } + color: #4d4d4c; + } /* lisp open bracket */ .opn { - color: #4d4d4c; } + color: #4d4d4c; + } /* lisp close bracket */ .clo { - color: #4d4d4c; } + color: #4d4d4c; + } /* a markup tag name */ .tag { - color: #c82829; } + color: #c82829; + } /* a markup attribute name */ .atn { - color: #f5871f; } + color: #f5871f; + } /* a markup attribute value */ .atv { - color: #3e999f; } + color: #3e999f; + } /* a declaration */ .dec { - color: #f5871f; } + color: #f5871f; + } /* a variable name */ .var { - color: #c82829; } + color: #c82829; + } /* a function name */ .fun { - color: #4271ae; } } + color: #4271ae; + } +} /* Use higher contrast and text-weight for printable form. */ @media print, projection { .str { - color: #060; } + color: #060; + } .kwd { color: #006; - font-weight: bold; } + font-weight: bold; + } .com { color: #600; - font-style: italic; } + font-style: italic; + } .typ { color: #404; - font-weight: bold; } + font-weight: bold; + } .lit { - color: #044; } + color: #044; + } - .pun, .opn, .clo { - color: #440; } + .pun, + .opn, + .clo { + color: #440; + } .tag { color: #006; - font-weight: bold; } + font-weight: bold; + } .atn { - color: #404; } + color: #404; + } .atv { - color: #060; } } + color: #060; + } +} /* Style */ /* pre.prettyprint { @@ -108,7 +136,8 @@ pre.prettyprint { /* Specify class=linenums on a pre to get line numbering */ ol.linenums { margin-top: 0; - margin-bottom: 0; } + margin-bottom: 0; +} /* IE indents via margin-left */ li.L0, @@ -121,7 +150,8 @@ li.L6, li.L7, li.L8, li.L9 { - /* */ } + /* */ +} /* Alternate shading for lines */ li.L1, @@ -129,4 +159,5 @@ li.L3, li.L5, li.L7, li.L9 { - /* */ } + /* */ +} diff --git a/e2e/demo.js b/e2e/demo.js index f9cc910d5..1b832cd60 100644 --- a/e2e/demo.js +++ b/e2e/demo.js @@ -3,9 +3,13 @@ import nwbuild from "nw-builder"; nwbuild({ srcDir: "./app/*", mode: "build", - version: "0.73.0", - flavor: "normal", - platform: "linux", - outDir: "./out/nix", + version: "latest", + flavor: "sdk", + platform: "osx", + arch: "arm64", + outDir: "./out", cacheDir: "./tmp", + downloadUrl: "https://github.com/corwin-of-amber/nw.js/releases/download", + manifestUrl: + "https://raw.githubusercontent.com/nwutils/nw-builder/main/src/util/osx.arm.versions.json", }); diff --git a/e2e/mode.js b/e2e/mode.js index b1af3d9d4..328fa2cda 100644 --- a/e2e/mode.js +++ b/e2e/mode.js @@ -31,6 +31,13 @@ export function mode() { }; it("should run", async () => { + if (nwOptions.platform === "osx" && nwOptions.arch === "arm64") { + nwOptions.downloadUrl = + "https://github.com/corwin-of-amber/nw.js/releases/download"; + nwOptions.manifestUrl = + "https://raw.githubusercontent.com/nwutils/nw-builder/dev-494/src/util/osx.arm.versions.json"; + } + await nwbuild({ ...nwOptions }); const options = new Options(); diff --git a/package-lock.json b/package-lock.json index 3cf98389f..132ae19c3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "nw-builder", - "version": "4.0.11", + "version": "4.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "nw-builder", - "version": "4.0.11", + "version": "4.1.0", "license": "MIT", "dependencies": { "archiver": "^5.3.1", @@ -58,30 +58,30 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.20.14", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.20.14.tgz", - "integrity": "sha512-0YpKHD6ImkWMEINCyDAD0HLLUH/lPCefG8ld9it8DJB2wnApraKuhgYTvTY1z7UFIfBTGy5LwncZ+5HWWGbhFw==", + "version": "7.21.0", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.21.0.tgz", + "integrity": "sha512-gMuZsmsgxk/ENC3O/fRw5QY8A9/uxQbbCEypnLIiYYc/qVJtEV7ouxC3EllIIwNzMqAQee5tanFabWsUOutS7g==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.20.12", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.20.12.tgz", - "integrity": "sha512-XsMfHovsUYHFMdrIHkZphTN/2Hzzi78R08NuHfDBehym2VsPDL6Zn/JAD/JQdnRvbSsbQc4mVaU1m6JgtTEElg==", + "version": "7.21.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.21.0.tgz", + "integrity": "sha512-PuxUbxcW6ZYe656yL3EAhpy7qXKq0DmYsrJLpbB8XrsCP9Nm+XCg9XFMb5vIDliPD7+U/+M+QJlH17XOcB7eXA==", "dev": true, "dependencies": { - "@ampproject/remapping": "^2.1.0", + "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.20.7", + "@babel/generator": "^7.21.0", "@babel/helper-compilation-targets": "^7.20.7", - "@babel/helper-module-transforms": "^7.20.11", - "@babel/helpers": "^7.20.7", - "@babel/parser": "^7.20.7", + "@babel/helper-module-transforms": "^7.21.0", + "@babel/helpers": "^7.21.0", + "@babel/parser": "^7.21.0", "@babel/template": "^7.20.7", - "@babel/traverse": "^7.20.12", - "@babel/types": "^7.20.7", + "@babel/traverse": "^7.21.0", + "@babel/types": "^7.21.0", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -112,13 +112,14 @@ } }, "node_modules/@babel/generator": { - "version": "7.20.14", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.20.14.tgz", - "integrity": "sha512-AEmuXHdcD3A52HHXxaTmYlb8q/xMEhoRP67B3T4Oq7lbmSoqroMZzjnGj3+i1io3pdnF8iBYVu4Ilj+c4hBxYg==", + "version": "7.21.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.21.1.tgz", + "integrity": "sha512-1lT45bAYlQhFn/BHivJs43AiW2rg3/UbLyShGfF3C0KmHvO5fSghWd5kBJy30kpRRucGzXStvnnCFniCR2kXAA==", "dev": true, "dependencies": { - "@babel/types": "^7.20.7", + "@babel/types": "^7.21.0", "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", "jsesc": "^2.5.1" }, "engines": { @@ -177,13 +178,13 @@ } }, "node_modules/@babel/helper-function-name": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.19.0.tgz", - "integrity": "sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w==", + "version": "7.21.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.21.0.tgz", + "integrity": "sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg==", "dev": true, "dependencies": { - "@babel/template": "^7.18.10", - "@babel/types": "^7.19.0" + "@babel/template": "^7.20.7", + "@babel/types": "^7.21.0" }, "engines": { "node": ">=6.9.0" @@ -214,9 +215,9 @@ } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.20.11", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.20.11.tgz", - "integrity": "sha512-uRy78kN4psmji1s2QtbtcCSaj/LILFDp0f/ymhpQH5QY3nljUZCaNWz9X1dEj/8MBdBEFECs7yRhKn8i7NjZgg==", + "version": "7.21.2", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.21.2.tgz", + "integrity": "sha512-79yj2AR4U/Oqq/WOV7Lx6hUjau1Zfo4cI+JLAVYeMV5XIlbOhmjEk5ulbTc9fMpmlojzZHkUUxAiK+UKn+hNQQ==", "dev": true, "dependencies": { "@babel/helper-environment-visitor": "^7.18.9", @@ -225,8 +226,8 @@ "@babel/helper-split-export-declaration": "^7.18.6", "@babel/helper-validator-identifier": "^7.19.1", "@babel/template": "^7.20.7", - "@babel/traverse": "^7.20.10", - "@babel/types": "^7.20.7" + "@babel/traverse": "^7.21.2", + "@babel/types": "^7.21.2" }, "engines": { "node": ">=6.9.0" @@ -284,23 +285,23 @@ } }, "node_modules/@babel/helper-validator-option": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz", - "integrity": "sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw==", + "version": "7.21.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.21.0.tgz", + "integrity": "sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { - "version": "7.20.13", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.20.13.tgz", - "integrity": "sha512-nzJ0DWCL3gB5RCXbUO3KIMMsBY2Eqbx8mBpKGE/02PgyRQFcPQLbkQ1vyy596mZLaP+dAfD+R4ckASzNVmW3jg==", + "version": "7.21.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.21.0.tgz", + "integrity": "sha512-XXve0CBtOW0pd7MRzzmoyuSj0e3SEzj8pgyFxnTT1NJZL38BD1MK7yYrm8yefRPIDvNNe14xR4FdbHwpInD4rA==", "dev": true, "dependencies": { "@babel/template": "^7.20.7", - "@babel/traverse": "^7.20.13", - "@babel/types": "^7.20.7" + "@babel/traverse": "^7.21.0", + "@babel/types": "^7.21.0" }, "engines": { "node": ">=6.9.0" @@ -392,9 +393,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.20.15", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.15.tgz", - "integrity": "sha512-DI4a1oZuf8wC+oAJA9RW6ga3Zbe8RZFt7kD9i4qAspz3I/yHet1VvC3DiSy/fsUvv5pvJuNPh0LPOdCcqinDPg==", + "version": "7.21.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.2.tgz", + "integrity": "sha512-URpaIJQwEkEC2T9Kn+Ai6Xe/02iNaVCuT/PtoRz3GPVJVDpPd7mLo+VddTbhCRU9TXqW5mSrQfXZyi8kDKOVpQ==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -595,19 +596,19 @@ } }, "node_modules/@babel/traverse": { - "version": "7.20.13", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.20.13.tgz", - "integrity": "sha512-kMJXfF0T6DIS9E8cgdLCSAL+cuCK+YEZHWiLK0SXpTo8YRj5lpJu3CDNKiIBCne4m9hhTIqUg6SYTAI39tAiVQ==", + "version": "7.21.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.21.2.tgz", + "integrity": "sha512-ts5FFU/dSUPS13tv8XiEObDu9K+iagEKME9kAbaP7r0Y9KtZJZ+NGndDvWoRAYNpeWafbpFeki3q9QoMD6gxyw==", "dev": true, "dependencies": { "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.20.7", + "@babel/generator": "^7.21.1", "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-function-name": "^7.19.0", + "@babel/helper-function-name": "^7.21.0", "@babel/helper-hoist-variables": "^7.18.6", "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/parser": "^7.20.13", - "@babel/types": "^7.20.7", + "@babel/parser": "^7.21.2", + "@babel/types": "^7.21.2", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -625,9 +626,9 @@ } }, "node_modules/@babel/types": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.7.tgz", - "integrity": "sha512-69OnhBxSSgK0OzTJai4kyPDiKTIe3j+ctaHdIGVbRahTLAT7L3R9oeXHC2aVSuGYt3cVnoAMDmOCgJ2yaiLMvg==", + "version": "7.21.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.21.2.tgz", + "integrity": "sha512-3wRZSs7jiFaB8AjxiiD+VqN5DTG2iRvJGQ+qYFrs/654lg6kGTQWIOFjlBo5RaXuAZjBmP3+OQH4dmhqiiyYxw==", "dev": true, "dependencies": { "@babel/helper-string-parser": "^7.19.4", @@ -1254,9 +1255,9 @@ } }, "node_modules/@sinclair/typebox": { - "version": "0.25.22", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.25.22.tgz", - "integrity": "sha512-6U6r2L7rnM7EG8G1tWzIjdB3QlsHF4slgcqXNN/SF0xJOAr0nDmT2GedlkyO3mrv8mDTJ24UuOMWR3diBrCvQQ==", + "version": "0.25.24", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.25.24.tgz", + "integrity": "sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ==", "dev": true }, "node_modules/@sinonjs/commons": { @@ -1328,9 +1329,9 @@ } }, "node_modules/@types/glob": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-8.0.1.tgz", - "integrity": "sha512-8bVUjXZvJacUFkJXHdyZ9iH1Eaj5V7I8c4NdH5sQJsdXkqT4CA5Dhb4yb4VE/3asyx4L9ayZr1NIhTsWHczmMw==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-IO+MJPVhoqz+28h1qLAcBEH2+xHMK6MTyHJc7MTnnYb6wsoLR29POVGJ7LycmVXIqyy/4/2ShP5sUwTXuOwb/w==", "dependencies": { "@types/minimatch": "^5.1.2", "@types/node": "*" @@ -1408,9 +1409,9 @@ "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==" }, "node_modules/@types/node": { - "version": "18.13.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.13.0.tgz", - "integrity": "sha512-gC3TazRzGoOnoKAhUx+Q0t8S9Tzs74z7m0ipwGpSqQrleP14hKxP4/JUeEQcD3W1/aIpnWl8pHowI7WokuZpXg==" + "version": "18.14.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.14.1.tgz", + "integrity": "sha512-QH+37Qds3E0eDlReeboBxfHbX9omAcBCXEzswCu6jySP642jiM3cYSIkU/REqwhCUqXdonHFuBfJDiAJxMNhaQ==" }, "node_modules/@types/prettier": { "version": "2.7.2", @@ -1643,9 +1644,9 @@ } }, "node_modules/archiver-utils/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -1950,9 +1951,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001452", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001452.tgz", - "integrity": "sha512-Lkp0vFjMkBB3GTpLR8zk4NwW5EdRdnitwYJHDOOKIU85x4ckYCPQ+9WlVvSVClHxVReefkUMtWZH2l9KGlD51w==", + "version": "1.0.30001457", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001457.tgz", + "integrity": "sha512-SDIV6bgE1aVbK6XyxdURbUE89zY7+k1BBBaOwYwkNCglXlel/E7mELiHC64HQ+W0xSKlqWhV9Wh7iHxUjMs4fA==", "dev": true, "funding": [ { @@ -2335,18 +2336,10 @@ "safe-buffer": "^5.1.1" } }, - "node_modules/decompress-tar/node_modules/is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/decompress-tar/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -2410,14 +2403,6 @@ "node": ">=4" } }, - "node_modules/decompress-tarbz2/node_modules/is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/decompress-targz": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/decompress-targz/-/decompress-targz-4.1.1.tgz", @@ -2431,14 +2416,6 @@ "node": ">=4" } }, - "node_modules/decompress-targz/node_modules/is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/decompress-unzip": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/decompress-unzip/-/decompress-unzip-4.0.1.tgz", @@ -2461,37 +2438,6 @@ "node": ">=0.10.0" } }, - "node_modules/decompress-unzip/node_modules/get-stream": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-2.3.1.tgz", - "integrity": "sha512-AUGhbbemXxrZJRD5cDvKtQxLuYaIbNtDTK8YqupCI393Q2KSTreEsLUN3ZxAWFGiKTzL6nKuzfcIvieflUX9qA==", - "dependencies": { - "object-assign": "^4.0.1", - "pinkie-promise": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/decompress/node_modules/make-dir": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", - "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", - "dependencies": { - "pify": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/decompress/node_modules/make-dir/node_modules/pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", - "engines": { - "node": ">=4" - } - }, "node_modules/dedent": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", @@ -2565,9 +2511,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.298", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.298.tgz", - "integrity": "sha512-dJZurgxDeaqn90VmS23Xz+QPQQl84BxnlAfwCDFNjfEhqO2yLMDkeaDoJ1yPXAbmiqTi+hd5TpB5zi1N4hwBuQ==", + "version": "1.4.311", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.311.tgz", + "integrity": "sha512-RoDlZufvrtr2Nx3Yx5MB8jX3aHIxm8nRWPJm3yVvyHmyKaRvn90RjzB6hNnt0AkhS3IInJdyRfQb4mWhPvUjVw==", "dev": true }, "node_modules/emittery": { @@ -2877,9 +2823,9 @@ } }, "node_modules/esquery": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.1.tgz", - "integrity": "sha512-3ZggxvMv5EEY1ssUVyHSVt0oPreyBfbUi1XikJVfjFiBeBDLdrb0IWoDiEwqT/2sUQi0TGaWtFhOGDD8RTpXgQ==", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.2.tgz", + "integrity": "sha512-JVSoLdTlTDkmjFmab7H/9SL9qGSyjElT3myyKp7krqjVFQCDLmj1QFaCLRFBszBKI0XVZaiiXvuPIX3ZwHe1Ng==", "dev": true, "dependencies": { "estraverse": "^5.1.0" @@ -2953,6 +2899,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/execa/node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/exit": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", @@ -3169,6 +3127,18 @@ "node": ">=8.0.0" } }, + "node_modules/get-stream": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-2.3.1.tgz", + "integrity": "sha512-AUGhbbemXxrZJRD5cDvKtQxLuYaIbNtDTK8YqupCI393Q2KSTreEsLUN3ZxAWFGiKTzL6nKuzfcIvieflUX9qA==", + "dependencies": { + "object-assign": "^4.0.1", + "pinkie-promise": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/glob": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", @@ -3544,14 +3514,11 @@ "dev": true }, "node_modules/is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==", "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=0.10.0" } }, "node_modules/is-wsl": { @@ -3623,6 +3590,30 @@ "node": ">=8" } }, + "node_modules/istanbul-lib-report/node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/istanbul-lib-report/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/istanbul-lib-source-maps": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", @@ -4504,9 +4495,9 @@ } }, "node_modules/jszip/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", "dev": true, "dependencies": { "core-util-is": "~1.0.0", @@ -4568,9 +4559,9 @@ } }, "node_modules/lazystream/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -4715,27 +4706,22 @@ } }, "node_modules/make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", "dependencies": { - "semver": "^6.0.0" + "pify": "^3.0.0" }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=4" } }, - "node_modules/make-dir/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" + "node_modules/make-dir/node_modules/pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "engines": { + "node": ">=4" } }, "node_modules/makeerror": { @@ -4764,9 +4750,9 @@ } }, "node_modules/markdown-it-anchor": { - "version": "8.6.6", - "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-8.6.6.tgz", - "integrity": "sha512-jRW30YGywD2ESXDc+l17AiritL0uVaSnWsb26f+68qaW9zgbIIr1f4v2Nsvc0+s0Z2N3uX6t/yAw7BwCQ1wMsA==", + "version": "8.6.7", + "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-8.6.7.tgz", + "integrity": "sha512-FlCHFwNnutLgVTflOYHPW2pPcl2AACqVzExlkGQNsi4CJgqOHN7YTgDd4LuhgN1BFO3TS0vLAruV1Td6dwWPJA==", "dev": true, "peerDependencies": { "@types/markdown-it": "*", @@ -5360,9 +5346,9 @@ "dev": true }, "node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.1.tgz", + "integrity": "sha512-+rQmrWMYGA90yenhTYsLWAsLsqVC8osOw6PKE1HDYiO0gdPeKe/xDHNzIAIn4C91YQ6oenEhfYqqc1883qHbjQ==", "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -5616,9 +5602,9 @@ } }, "node_modules/selenium-webdriver": { - "version": "4.8.0", - "resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.8.0.tgz", - "integrity": "sha512-s/HL8WNwy1ggHR244+tAhjhyKMJnZLt1HKJ6Gn7nQgVjB/ybDF+46Uui0qI2J7AjPNJzlUmTncdC/jg/kKkn0A==", + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.8.1.tgz", + "integrity": "sha512-p4MtfhCQdcV6xxkS7eI0tQN6+WNReRULLCAuT4RDGkrjfObBNXMJ3WT8XdK+aXTr5nnBKuh+PxIevM0EjJgkxA==", "dev": true, "dependencies": { "jszip": "^3.10.0", @@ -6296,6 +6282,17 @@ "node": ">= 6.4.0" } }, + "node_modules/winston/node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", diff --git a/package.json b/package.json index fc41814c9..670c833c4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nw-builder", - "version": "4.1.0", + "version": "4.1.0-beta.0", "description": "Build NW.js desktop applications for MacOS, Windows and Linux.", "keywords": [ "NW.js", diff --git a/src/bld/linuxCfg.js b/src/bld/linuxCfg.js index 9ac16930c..92103e584 100644 --- a/src/bld/linuxCfg.js +++ b/src/bld/linuxCfg.js @@ -7,9 +7,9 @@ import { log } from "../log.js"; * Generates a Desktop Entry file for Linux * https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s06.html * - * @param {object} app Multi platform configuration options - * @param {string} outDir Directory which stores build artifacts - * @return {undefined} + * @param {object} app Multi platform configuration options + * @param {string} outDir Directory which stores build artifacts + * @return {Promise} */ export const setLinuxConfig = async (app, outDir) => { if (platform === "win32") { diff --git a/src/get/decompress.js b/src/get/decompress.js index 53b39c8c8..03f941c40 100644 --- a/src/get/decompress.js +++ b/src/get/decompress.js @@ -20,6 +20,11 @@ const decompress = async (platform, cacheDir, downloadUrl) => { } else { await Decompress(resolve(cacheDir, "nw.zip"), cacheDir); } + } else if ( + downloadUrl === + "https://github.com/corwin-of-amber/nw.js/releases/download" + ) { + await Decompress(resolve(cacheDir, "nw.zip"), cacheDir); } else if ( downloadUrl === "https://github.com/nwjs-ffmpeg-prebuilt/nwjs-ffmpeg-prebuilt/releases/download" diff --git a/src/get/download.js b/src/get/download.js index ba48d36b5..5ae5db6ce 100644 --- a/src/get/download.js +++ b/src/get/download.js @@ -35,6 +35,14 @@ const download = ( platform === "linux" ? "tar.gz" : "zip" }`; out = resolve(cacheDir, `nw.${platform === "linux" ? "tar.gz" : "zip"}`); + } else if ( + downloadUrl === + "https://github.com/corwin-of-amber/nw.js/releases/download" + ) { + url = `${downloadUrl}/nw-v${version}/nwjs-${ + flavor === "sdk" ? "sdk-" : "" + }v${version}-${platform}-${architecture}.zip`; + out = resolve(cacheDir, `nw.zip`); } else if ( downloadUrl === "https://github.com/nwjs-ffmpeg-prebuilt/nwjs-ffmpeg-prebuilt/releases/download" @@ -46,9 +54,12 @@ const download = ( } https.get(url, (response) => { + // For GitHub releases, we need to follow the redirect if ( downloadUrl === - "https://github.com/nwjs-ffmpeg-prebuilt/nwjs-ffmpeg-prebuilt/releases/download" + "https://github.com/nwjs-ffmpeg-prebuilt/nwjs-ffmpeg-prebuilt/releases/download" || + downloadUrl === + "https://github.com/corwin-of-amber/nw.js/releases/download" ) { url = response.headers.location; } diff --git a/src/get/getReleaseInfo.js b/src/get/getReleaseInfo.js index 3b0b6e843..9f58cad0c 100644 --- a/src/get/getReleaseInfo.js +++ b/src/get/getReleaseInfo.js @@ -9,25 +9,37 @@ import { getManifest } from "./getManifest.js"; * Get version specific release metadata * * @param {string} version NW version + * @param {string} platform NW platform + * @param {string} arch NW architecture * @param {string} cacheDir Directory to store NW binaries * @param {string} manifestUrl Url to manifest * @return {object} Version specific release info */ -export const getReleaseInfo = async (version, cacheDir, manifestUrl) => { +export const getReleaseInfo = async ( + version, + platform, + arch, + cacheDir, + manifestUrl, +) => { let releaseData = undefined; + let manifestPath = undefined; + if (platform === "osx" && arch === "arm64") { + manifestPath = resolve(cacheDir, "manifest.mac.arm.json"); + } else { + manifestPath = resolve(cacheDir, "manifest.json"); + } try { - await access(resolve(cacheDir, "manifest.json")); + await access(manifestPath); log.debug(`Manifest file already exists locally under ${cacheDir}`); } catch (e) { log.debug(`Manifest file does not exist locally`); log.debug(`Downloading latest manifest file under ${cacheDir}`); const data = await getManifest(manifestUrl); - await writeFile(resolve(cacheDir, "manifest.json"), data.slice(9)); + await writeFile(manifestPath, data.slice(9)); } finally { log.debug("Store manifest metadata in memory"); - let manifest = JSON.parse( - await readFile(resolve(cacheDir, "manifest.json")), - ); + let manifest = JSON.parse(await readFile(resolve(manifestPath))); log.debug(`Search for ${version} specific release data`); if (version === "latest" || version === "stable" || version === "lts") { // Remove leading "v" from version string diff --git a/src/nwbuild.js b/src/nwbuild.js index ba3580994..9e17454c2 100644 --- a/src/nwbuild.js +++ b/src/nwbuild.js @@ -12,6 +12,7 @@ import { replaceFfmpeg } from "./util/ffmpeg.js"; import { getOptions } from "./util/options.js"; import { parse } from "./util/parse.js"; import { validate } from "./util/validate.js"; +import { xattr } from "./util/xattr.js"; import { log } from "./log.js"; @@ -62,7 +63,7 @@ import { log } from "./log.js"; * @property {"latest" | "stable" | string} [version="latest"] NW runtime version * @property {"normal" | "sdk"} [flavor="normal"] NW runtime build flavor * @property {"linux" | "osx" | "win"} platform NW supported platforms - * @property {"ia32" | "x64"} arch NW supported architectures + * @property {"ia32" | "x64" | "arm64"} arch NW supported architectures * @property {string} [outDir="./out"] Directory to store build artifacts * @property {"./cache" | string} [cacheDir="./cache"] Directory to store NW binaries * @property {"https://dl.nwjs.io"} [downloadUrl="https://dl.nwjs.io"] URI to download NW binaries from @@ -110,6 +111,8 @@ const nwbuild = async (options) => { // Validate options.version to get the version specific release info releaseInfo = await getReleaseInfo( options.version, + options.platform, + options.arch, options.cacheDir, options.manifestUrl, ); @@ -121,7 +124,8 @@ const nwbuild = async (options) => { // Variable to store nwDir file path nwDir = resolve( options.cacheDir, - `nwjs${options.flavor === "sdk" ? "-sdk" : ""}-v${options.version}-${options.platform + `nwjs${options.flavor === "sdk" ? "-sdk" : ""}-v${options.version}-${ + options.platform }-${options.arch}`, ); @@ -147,7 +151,9 @@ const nwbuild = async (options) => { } if (options.ffmpeg === true) { - log.warn("Using MP3 and H.264 codecs requires you to pay attention to the patent royalties and the license of the source code. Consult a lawyer if you do not understand the licensing constraints and using patented media formats in your app. See https://chromium.googlesource.com/chromium/third_party/ffmpeg.git/+/master/CREDITS.chromium for more information."); + log.warn( + "Using MP3 and H.264 codecs requires you to pay attention to the patent royalties and the license of the source code. Consult a lawyer if you do not understand the licensing constraints and using patented media formats in your app. See https://chromium.googlesource.com/chromium/third_party/ffmpeg.git/+/master/CREDITS.chromium for more information.", + ); if (options.platform === "win") { ffmpegFile = "libffmpeg.dll"; } else if (options.platform === "osx") { @@ -189,6 +195,8 @@ const nwbuild = async (options) => { } } + await xattr(options.platform, options.arch, nwDir); + if (options.mode === "run") { await develop(options.srcDir, nwDir, options.platform, options.argv); } diff --git a/src/util/arch.js b/src/util/arch.js index bdc28a8ca..c11df75b0 100644 --- a/src/util/arch.js +++ b/src/util/arch.js @@ -1,8 +1,8 @@ /** * Get user's computer architecture * - * @param {string} arch Node's process.arch - * @return {"ia32"| "x64" | "string"} NW.js supported architectures + * @param {string} arch Node's process.arch + * @return {"ia32"| "x64" | "arm64" | "string"} NW.js supported architectures */ export const getArch = (arch) => { return arch; diff --git a/src/util/osx.arm.versions.json b/src/util/osx.arm.versions.json new file mode 100644 index 000000000..09e3e83ac --- /dev/null +++ b/src/util/osx.arm.versions.json @@ -0,0 +1,17 @@ +{ + "latest": "v0.70.0", + "stable": "v0.70.0", + "lts": "v0.70.0", + "versions": [ + { + "version": "v0.70.0", + "date": "2022/11/30", + "files": ["osx-arm64"], + "flavors": ["normal", "sdk"], + "components": { + "node": "19.0.0", + "chromium": "107.0.5304.88" + } + } + ] +} diff --git a/src/util/xattr.js b/src/util/xattr.js new file mode 100644 index 000000000..43325bcfe --- /dev/null +++ b/src/util/xattr.js @@ -0,0 +1,30 @@ +import { exec } from "node:child_process"; +import { resolve } from "node:path"; + +import { log } from "../log.js"; + +/** + * Remove the quarantine attribute from the app bundle + * + * @param {string} platform - The platform to build for + * @param {string} arch - The arch to build for + * @param {string} nwDir - The path to the nw directory + * @return {Promise} - A promise that resolves when the attribute is removed + */ +export const xattr = (platform, arch, nwDir) => { + return new Promise((res, rej) => { + if (platform === "osx" && arch === "arm64") { + let app = resolve(nwDir, "nwjs.app"); + exec(`sudo xattr -d com.apple.quarantine ${app}`, (err, stdout) => { + log.debug(stdout); + if (err) { + rej(err); + } else { + res(); + } + }); + } else { + res(); + } + }); +};