@breakside/jskit 2022.49.0 → 2022.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/Frameworks/DOM.jsframework/Info.json +2 -2
  2. package/Frameworks/DOM.jsframework/io.breakside.JSKit.DOM-bundle.js +2 -2
  3. package/Frameworks/FontKit.jsframework/Info.json +2 -2
  4. package/Frameworks/FontKit.jsframework/io.breakside.JSKit.FontKit-bundle.js +2 -2
  5. package/Frameworks/Foundation.jsframework/Info.json +2 -2
  6. package/Frameworks/Foundation.jsframework/JS/JSObject.js +5 -4
  7. package/Frameworks/Foundation.jsframework/JS/Number+JS.js +3 -1
  8. package/Frameworks/Foundation.jsframework/io.breakside.JSKit.Foundation-bundle.js +2 -2
  9. package/Frameworks/SecurityKit.jsframework/Info.json +2 -2
  10. package/Frameworks/SecurityKit.jsframework/io.breakside.JSKit.SecurityKit-bundle.js +2 -2
  11. package/Info.json +2 -2
  12. package/Node/HTMLBuilder.js +77 -8
  13. package/Node/io.breakside.jskit-bundle.js +2 -2
  14. package/Root/Frameworks/APIKit/Info.yaml +1 -1
  15. package/Root/Frameworks/APIKitTesting/Info.yaml +1 -1
  16. package/Root/Frameworks/AuthKit/Info.yaml +1 -1
  17. package/Root/Frameworks/CSSOM/Info.yaml +1 -1
  18. package/Root/Frameworks/ChartKit/Info.yaml +1 -1
  19. package/Root/Frameworks/ConferenceKit/Info.yaml +1 -1
  20. package/Root/Frameworks/DBKit/Info.yaml +1 -1
  21. package/Root/Frameworks/DOM/Info.yaml +1 -1
  22. package/Root/Frameworks/Dispatch/Info.yaml +1 -1
  23. package/Root/Frameworks/FontKit/Info.yaml +1 -1
  24. package/Root/Frameworks/Foundation/Info.yaml +1 -1
  25. package/Root/Frameworks/Foundation/JSObject.js +5 -4
  26. package/Root/Frameworks/Foundation/Number+JS.js +3 -1
  27. package/Root/Frameworks/ImageKit/Info.yaml +1 -1
  28. package/Root/Frameworks/MediaKit/Info.yaml +1 -1
  29. package/Root/Frameworks/MediaKitUI/Info.yaml +1 -1
  30. package/Root/Frameworks/NotificationKit/Info.yaml +1 -1
  31. package/Root/Frameworks/PDFKit/Info.yaml +1 -1
  32. package/Root/Frameworks/QRKit/Info.yaml +1 -1
  33. package/Root/Frameworks/SearchKit/Info.yaml +1 -1
  34. package/Root/Frameworks/SecurityKit/Info.yaml +1 -1
  35. package/Root/Frameworks/ServerKit/Info.yaml +1 -1
  36. package/Root/Frameworks/ServerKitTesting/Info.yaml +1 -1
  37. package/Root/Frameworks/TestKit/Info.yaml +1 -1
  38. package/Root/Frameworks/UIKit/Info.yaml +1 -1
  39. package/Root/Frameworks/UIKit/UICheckbox.js +2 -1
  40. package/Root/Frameworks/UIKitTesting/Info.yaml +1 -1
  41. package/Root/Templates/html/${PROJECT_NAME}/www/service-worker.js +3 -3
  42. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "JSBundleType": "framework",
3
3
  "JSBundleIdentifier": "io.breakside.JSKit.DOM",
4
- "JSBundleVersion": "2022.49.0",
4
+ "JSBundleVersion": "2022.50.0",
5
5
  "JSDevelopmentLanguage": "en",
6
6
  "JSCopyright": "Copyright © 2020 Breakside Inc.",
7
7
  "JSBundleEnvironments": {
@@ -9,5 +9,5 @@
9
9
  "node": "DOM+Node.js"
10
10
  },
11
11
  "JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
12
- "GitRevision": "115cb8f3373561b8f20dc12b628bb8742aabecdc"
12
+ "GitRevision": "28227032ddb908d100f267545432254d514ff4b3"
13
13
  }
@@ -3,7 +3,7 @@ JSBundle.bundles['io.breakside.JSKit.DOM'] = {
3
3
  "Info": {
4
4
  "JSBundleType": "framework",
5
5
  "JSBundleIdentifier": "io.breakside.JSKit.DOM",
6
- "JSBundleVersion": "2022.49.0",
6
+ "JSBundleVersion": "2022.50.0",
7
7
  "JSDevelopmentLanguage": "en",
8
8
  "JSCopyright": "Copyright © 2020 Breakside Inc.",
9
9
  "JSBundleEnvironments": {
@@ -11,7 +11,7 @@ JSBundle.bundles['io.breakside.JSKit.DOM'] = {
11
11
  "node": "DOM+Node.js"
12
12
  },
13
13
  "JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
14
- "GitRevision": "115cb8f3373561b8f20dc12b628bb8742aabecdc"
14
+ "GitRevision": "28227032ddb908d100f267545432254d514ff4b3"
15
15
  },
16
16
  "Resources": [],
17
17
  "ResourceLookup": {
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "JSBundleType": "framework",
3
3
  "JSBundleIdentifier": "io.breakside.JSKit.FontKit",
4
- "JSBundleVersion": "2022.49.0",
4
+ "JSBundleVersion": "2022.50.0",
5
5
  "JSDevelopmentLanguage": "en",
6
6
  "JSCopyright": "Copyright © 2020 Breakside Inc.",
7
7
  "JSBundleEnvironments": {
8
8
  "html": "FontKit+HTML.js"
9
9
  },
10
10
  "JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
11
- "GitRevision": "115cb8f3373561b8f20dc12b628bb8742aabecdc"
11
+ "GitRevision": "28227032ddb908d100f267545432254d514ff4b3"
12
12
  }
@@ -3,14 +3,14 @@ JSBundle.bundles['io.breakside.JSKit.FontKit'] = {
3
3
  "Info": {
4
4
  "JSBundleType": "framework",
5
5
  "JSBundleIdentifier": "io.breakside.JSKit.FontKit",
6
- "JSBundleVersion": "2022.49.0",
6
+ "JSBundleVersion": "2022.50.0",
7
7
  "JSDevelopmentLanguage": "en",
8
8
  "JSCopyright": "Copyright © 2020 Breakside Inc.",
9
9
  "JSBundleEnvironments": {
10
10
  "html": "FontKit+HTML.js"
11
11
  },
12
12
  "JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
13
- "GitRevision": "115cb8f3373561b8f20dc12b628bb8742aabecdc"
13
+ "GitRevision": "28227032ddb908d100f267545432254d514ff4b3"
14
14
  },
15
15
  "Resources": [],
16
16
  "ResourceLookup": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "JSBundleType": "framework",
3
3
  "JSBundleIdentifier": "io.breakside.JSKit.Foundation",
4
- "JSBundleVersion": "2022.49.0",
4
+ "JSBundleVersion": "2022.50.0",
5
5
  "JSDevelopmentLanguage": "en",
6
6
  "JSCopyright": "Copyright © 2020 Breakside Inc.",
7
7
  "JSBundleEnvironments": {
@@ -9,5 +9,5 @@
9
9
  "node": "Foundation+Node.js"
10
10
  },
11
11
  "JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
12
- "GitRevision": "115cb8f3373561b8f20dc12b628bb8742aabecdc"
12
+ "GitRevision": "28227032ddb908d100f267545432254d514ff4b3"
13
13
  }
@@ -15,6 +15,7 @@
15
15
 
16
16
  // #import "JSClass.js"
17
17
  // #import "JSValueTransformer.js"
18
+ // #import "Number+JS.js"
18
19
  /* global JSSpec */
19
20
  'use strict';
20
21
 
@@ -156,21 +157,21 @@ JSObject.definePropertiesFromExtensions({
156
157
  this._updateValueForBinding(context.binding);
157
158
  }else if (change.type == JSObject.KeyValueChange.Insertion){
158
159
  key = bindingInfo.binding;
159
- change.indexes.sort();
160
+ change.indexes.sort(Number.jskitCompare);
160
161
  for (i = 0, l = change.indexes.length; i < l; ++i){
161
162
  index = change.indexes[i];
162
163
  this.silentlyInsertObjectInKeyAtIndex(change.sourceObject.objectInKeyAtIndex(change.sourceKey, index), key, index);
163
164
  }
164
165
  }else if (change.type == JSObject.KeyValueChange.Removal){
165
166
  key = bindingInfo.binding;
166
- change.indexes.sort();
167
+ change.indexes.sort(Number.jskitCompare);
167
168
  for (i = change.indexes.length - 1; i >= 0; --i){
168
169
  index = change.indexes[i];
169
170
  this.silentlyRemoveObjectFromKeyAtIndex(key, index);
170
171
  }
171
172
  }else if (change.type == JSObject.KeyValueChange.Replacement){
172
173
  key = bindingInfo.binding;
173
- change.indexes.sort();
174
+ change.indexes.sort(Number.jskitCompare);
174
175
  for (i = 0, l = change.indexes.length; i < l; ++i){
175
176
  index = change.indexes[i];
176
177
  this.silentlyReplaceObjectInKeyAtIndexWithObject(key, index, change.sourceObject.objectInKeyAtIndex(change.sourceKey, index));
@@ -613,7 +614,7 @@ JSObject.definePropertiesFromExtensions({
613
614
  targetObject = targetObject.valueForKeyPath(keyParts.join('.'));
614
615
  }
615
616
  if (targetObject){
616
- indexes.sort();
617
+ indexes.sort(Number.jskitCompare);
617
618
  if (change == JSObject.KeyValueChange.Insertion){
618
619
  for (i = 0, l = indexes.length; i < l; ++i){
619
620
  index = indexes[i];
@@ -17,4 +17,6 @@
17
17
 
18
18
  Number.prototype.parseNumberArray = function(){
19
19
  return [this];
20
- };
20
+ };
21
+
22
+ Number.jskitCompare = function(a, b){ return a - b; };
@@ -3,7 +3,7 @@ JSBundle.bundles['io.breakside.JSKit.Foundation'] = {
3
3
  "Info": {
4
4
  "JSBundleType": "framework",
5
5
  "JSBundleIdentifier": "io.breakside.JSKit.Foundation",
6
- "JSBundleVersion": "2022.49.0",
6
+ "JSBundleVersion": "2022.50.0",
7
7
  "JSDevelopmentLanguage": "en",
8
8
  "JSCopyright": "Copyright © 2020 Breakside Inc.",
9
9
  "JSBundleEnvironments": {
@@ -11,7 +11,7 @@ JSBundle.bundles['io.breakside.JSKit.Foundation'] = {
11
11
  "node": "Foundation+Node.js"
12
12
  },
13
13
  "JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
14
- "GitRevision": "115cb8f3373561b8f20dc12b628bb8742aabecdc"
14
+ "GitRevision": "28227032ddb908d100f267545432254d514ff4b3"
15
15
  },
16
16
  "Resources": [
17
17
  {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "JSBundleType": "framework",
3
3
  "JSBundleIdentifier": "io.breakside.JSKit.SecurityKit",
4
- "JSBundleVersion": "2022.49.0",
4
+ "JSBundleVersion": "2022.50.0",
5
5
  "JSDevelopmentLanguage": "en",
6
6
  "JSCopyright": "Copyright © 2020 Breakside Inc.",
7
7
  "JSBundleEnvironments": {
@@ -9,5 +9,5 @@
9
9
  "node": "SecurityKit+Node.js"
10
10
  },
11
11
  "JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
12
- "GitRevision": "115cb8f3373561b8f20dc12b628bb8742aabecdc"
12
+ "GitRevision": "28227032ddb908d100f267545432254d514ff4b3"
13
13
  }
@@ -3,7 +3,7 @@ JSBundle.bundles['io.breakside.JSKit.SecurityKit'] = {
3
3
  "Info": {
4
4
  "JSBundleType": "framework",
5
5
  "JSBundleIdentifier": "io.breakside.JSKit.SecurityKit",
6
- "JSBundleVersion": "2022.49.0",
6
+ "JSBundleVersion": "2022.50.0",
7
7
  "JSDevelopmentLanguage": "en",
8
8
  "JSCopyright": "Copyright © 2020 Breakside Inc.",
9
9
  "JSBundleEnvironments": {
@@ -11,7 +11,7 @@ JSBundle.bundles['io.breakside.JSKit.SecurityKit'] = {
11
11
  "node": "SecurityKit+Node.js"
12
12
  },
13
13
  "JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
14
- "GitRevision": "115cb8f3373561b8f20dc12b628bb8742aabecdc"
14
+ "GitRevision": "28227032ddb908d100f267545432254d514ff4b3"
15
15
  },
16
16
  "Resources": [],
17
17
  "ResourceLookup": {
package/Info.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "JSBundleType": "node",
3
3
  "JSBundleIdentifier": "io.breakside.jskit",
4
- "JSBundleVersion": "2022.49.0",
4
+ "JSBundleVersion": "2022.50.0",
5
5
  "JSExecutableName": "jskit",
6
6
  "NPMOrganization": "breakside",
7
7
  "JSResources": [
8
8
  "Tests/HTMLTestRunner.js",
9
9
  "Tests/NodeTestRunner.js"
10
10
  ],
11
- "GitRevision": "115cb8f3373561b8f20dc12b628bb8742aabecdc"
11
+ "GitRevision": "28227032ddb908d100f267545432254d514ff4b3"
12
12
  }
@@ -56,6 +56,7 @@ JSClass("HTMLBuilder", Builder, {
56
56
  bundleURL: null,
57
57
  wwwURL: null,
58
58
  confURL: null,
59
+ s3URL: null,
59
60
  logsURL: null,
60
61
  cacheBustingURL: null,
61
62
  sourcesURL: null,
@@ -86,6 +87,7 @@ JSClass("HTMLBuilder", Builder, {
86
87
  this.bundleURL = this.buildURL.appendingPathComponent(this.project.name, true);
87
88
  this.wwwURL = this.bundleURL.appendingPathComponent('www', true);
88
89
  this.confURL = this.bundleURL.appendingPathComponent('conf', true);
90
+ this.s3URL = this.bundleURL.appendingPathComponent('s3', true);
89
91
  this.logsURL = this.bundleURL.appendingPathComponent('logs', true);
90
92
  this.tzURL = this.bundleURL.appendingPathComponent('tz', true);
91
93
  this.cacheBustingURL = this.wwwURL.appendingPathComponent(this.debug ? 'debug' : this.buildId);
@@ -128,6 +130,7 @@ JSClass("HTMLBuilder", Builder, {
128
130
  await this.bundleWWW();
129
131
  await this.buildServiceWorker();
130
132
  await this.bundleConf();
133
+ await this.bundleS3DeployScript();
131
134
  await this.copyLicense();
132
135
  await this.bundleInfo();
133
136
  await this.buildDocker();
@@ -582,6 +585,8 @@ JSClass("HTMLBuilder", Builder, {
582
585
  }
583
586
  },
584
587
 
588
+ indexURL: null,
589
+
585
590
  buildIndex: async function(sourceURL, toURL){
586
591
  let contents = await this.fileManager.contentsAtURL(sourceURL);
587
592
  let html = contents.stringByDecodingUTF8();
@@ -654,6 +659,7 @@ JSClass("HTMLBuilder", Builder, {
654
659
  let serializer = new XMLSerializer();
655
660
  html = serializer.serializeToString(document);
656
661
  await this.fileManager.createFileAtURL(toURL, html.utf8());
662
+ this.indexURL = toURL;
657
663
  },
658
664
 
659
665
  buildCSS: async function(){
@@ -716,35 +722,36 @@ JSClass("HTMLBuilder", Builder, {
716
722
  return;
717
723
  }
718
724
  this.printer.setStatus("Creating service worker...");
719
- var sources = {'./': {required: true}};
725
+ var sources = {'./': {required: true, cache: "no-store"}};
720
726
  for (let i = 0, l = this.wwwPaths.length; i < l; ++i){
721
- sources[this.wwwPaths[i]] = {required: true};
727
+ sources[this.wwwPaths[i]] = {required: true, cache: "no-store"};
722
728
  }
723
729
  for (let i = 0, l = this.wwwJavascriptPaths.length; i < l; ++i){
724
- sources[this.wwwJavascriptPaths[i]] = {required: true};
730
+ sources[this.wwwJavascriptPaths[i]] = {required: true, cache: "no-store"};
725
731
  }
726
732
  if (this.preflightURL !== null){
727
733
  let path = this.preflightURL.encodedStringRelativeTo(this.wwwURL);
728
- sources[path] = {required: true};
734
+ sources[path] = {required: true, cache: "default"};
729
735
  }
730
736
  if (this.workerURL !== null && this.hasLinkedDispatchFramework){
731
737
  let path = this.workerURL.encodedStringRelativeTo(this.wwwURL);
732
- sources[path] = {required: true};
738
+ sources[path] = {required: true, cache: "no-store"};
733
739
  }
734
740
  for (let i = 0, l = this.wwwResourcePaths.length; i < l; ++i){
735
- sources[this.wwwResourcePaths[i]] = {required: true};
741
+ sources[this.wwwResourcePaths[i]] = {required: true, cache: "default"};
736
742
  }
737
743
  for (let i = 0, l = this.wwwCSSPaths.length; i < l; ++i){
738
- sources[this.wwwCSSPaths[i]] = {required: true};
744
+ sources[this.wwwCSSPaths[i]] = {required: true, cache: "no-store"};
739
745
  }
740
746
  for (let i = 0, l = this.uncachedWWWPaths.length; i < l; ++i){
741
- sources[this.uncachedWWWPaths[i]] = {required: false};
747
+ sources[this.uncachedWWWPaths[i]] = {required: false, cache: "default"};
742
748
  }
743
749
  var params = {
744
750
  JSKIT_APP: JSON.stringify({
745
751
  buildId: this.buildId,
746
752
  environment: this.project.info.HTMLApplicationEnvironment,
747
753
  sources: sources,
754
+ debug: this.debug
748
755
  }, null, 2)
749
756
  };
750
757
  var workerConents = await this.fileManager.contentsAtURL(this.serviceWorkerSourceURL);
@@ -893,6 +900,68 @@ JSClass("HTMLBuilder", Builder, {
893
900
  this.commands.push("nginx -p %s".sprintf(bundlePath));
894
901
  },
895
902
 
903
+ // -----------------------------------------------------------------------
904
+ // MARK: - S3 Deploy
905
+
906
+ bundleS3DeployScript: async function(){
907
+ this.printer.setStatus("Creating s3 deploy script...");
908
+ var emptyURL = this.s3URL.appendingPathComponent("empty");
909
+ await this.fileManager.createFileAtURL(emptyURL, JSData.initWithLength(0));
910
+ var scriptURL = this.s3URL.appendingPathComponent("deploy.sh");
911
+ var localRootPath = this.fileManager.pathForURL(this.wwwURL.settingHasDirectoryPath(false));
912
+ var lines = [];
913
+ lines.push("#!/bin/sh");
914
+ lines.push("");
915
+ lines.push("S3_BUCKET=$1");
916
+ lines.push("S3_PREFIX=$2");
917
+ lines.push("S3_ROOT=s3://${S3_BUCKET}${S3_PREFIX}");
918
+ lines.push("LOCAL_ROOT=%s".sprintf(localRootPath));
919
+ lines.push("");
920
+ lines.push("if [ -z \"$S3_ROOT\" ]; then");
921
+ lines.push(" echo \"Usage: deploy.sh s3-bucket [s3-prefix]\"");
922
+ lines.push(" exit 1");
923
+ lines.push("fi");
924
+ lines.push("");
925
+ let resourcesPath = this.resourcesURL.settingHasDirectoryPath(true).encodedStringRelativeTo(this.wwwURL);
926
+ let cacheBustingPath = this.cacheBustingURL.settingHasDirectoryPath(true).encodedStringRelativeTo(this.wwwURL);
927
+ let indexPath = this.indexURL.encodedStringRelativeTo(this.wwwURL);
928
+ let preflightPath = this.preflightURL.encodedStringRelativeTo(this.wwwURL);
929
+ let manifestPath = null;
930
+ let serviceWorkerPath = null;
931
+ let bootstrapperPath = "HTMLAppBootstrapper.js";
932
+ let excludes = [
933
+ cacheBustingPath + "*",
934
+ resourcesPath + "*",
935
+ preflightPath,
936
+ indexPath,
937
+ bootstrapperPath
938
+ ];
939
+ if (this.manifestURL !== null){
940
+ manifestPath = this.manifestURL.encodedStringRelativeTo(this.wwwURL);
941
+ excludes.push(manifestPath);
942
+ }
943
+ if (this.serviceWorkerURL !== null){
944
+ serviceWorkerPath = this.serviceWorkerURL.encodedStringRelativeTo(this.wwwURL);
945
+ excludes.push(serviceWorkerPath);
946
+ }
947
+ lines.push("aws s3 sync ${LOCAL_ROOT} ${S3_ROOT} %s || exit 1".sprintf(excludes.map(e => "--exclude '" + e + "'").join(" ")));
948
+ lines.push("aws s3 sync ${LOCAL_ROOT}/%1$s ${S3_ROOT}/%1$s --cache-control='max-age=315360000' --expires 'Thu, 31 Dec 2037 23:55:55 GMT' || exit 1".sprintf(cacheBustingPath));
949
+ lines.push("aws s3 sync ${LOCAL_ROOT}/%1$s ${S3_ROOT}/%1$s --size-only --cache-control='max-age=315360000' --expires 'Thu, 31 Dec 2037 23:55:55 GMT' || exit 1".sprintf(resourcesPath));
950
+ lines.push("aws s3 cp ${LOCAL_ROOT}/%1$s ${S3_ROOT}/%1$s --cache-control='max-age=315360000' --expires 'Thu, 31 Dec 2037 23:55:55 GMT' || exit 1".sprintf(preflightPath));
951
+ lines.push("aws s3 cp ${LOCAL_ROOT}/%1$s ${S3_ROOT}/%1$s --cache-control='no-cache' --expires 'Thu, 01 Jan 1970 00:00:01 GMT' || exit 1".sprintf(bootstrapperPath));
952
+ lines.push("aws s3 cp ${LOCAL_ROOT}/%1$s ${S3_ROOT}/%1$s --cache-control='no-cache' --expires 'Thu, 01 Jan 1970 00:00:01 GMT' || exit 1".sprintf(indexPath));
953
+ if (manifestPath !== null){
954
+ lines.push("aws s3 cp ${LOCAL_ROOT}/%1$s ${S3_ROOT}/%1$s --cache-control='no-cache' --expires 'Thu, 01 Jan 1970 00:00:01 GMT' --content-type='text/cache-manifest' || exit 1".sprintf(manifestPath));
955
+ }
956
+ if (serviceWorkerPath !== null){
957
+ lines.push("aws s3 cp ${LOCAL_ROOT}/%1$s ${S3_ROOT}/%1$s --cache-control='no-cache' --expires 'Thu, 01 Jan 1970 00:00:01 GMT' || exit 1".sprintf(serviceWorkerPath));
958
+ }
959
+ lines.push("");
960
+ var contents = lines.join("\n").utf8();
961
+ await this.fileManager.createFileAtURL(scriptURL, contents);
962
+ await this.fileManager.makeExecutableAtURL(scriptURL);
963
+ },
964
+
896
965
  // -----------------------------------------------------------------------
897
966
  // MARK: - Info & License
898
967
 
@@ -3,14 +3,14 @@ JSBundle.bundles['io.breakside.jskit'] = {
3
3
  "Info": {
4
4
  "JSBundleType": "node",
5
5
  "JSBundleIdentifier": "io.breakside.jskit",
6
- "JSBundleVersion": "2022.49.0",
6
+ "JSBundleVersion": "2022.50.0",
7
7
  "JSExecutableName": "jskit",
8
8
  "NPMOrganization": "breakside",
9
9
  "JSResources": [
10
10
  "Tests/HTMLTestRunner.js",
11
11
  "Tests/NodeTestRunner.js"
12
12
  ],
13
- "GitRevision": "115cb8f3373561b8f20dc12b628bb8742aabecdc"
13
+ "GitRevision": "28227032ddb908d100f267545432254d514ff4b3"
14
14
  },
15
15
  "Resources": [
16
16
  {
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.APIKit
3
- JSBundleVersion: 2022.49.0
3
+ JSBundleVersion: 2022.50.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSIncludeDirectories:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.APIKitTesting
3
- JSBundleVersion: 2022.49.0
3
+ JSBundleVersion: 2022.50.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.AuthKit
3
- JSBundleVersion: 2022.49.0
3
+ JSBundleVersion: 2022.50.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.CSSOM
3
- JSBundleVersion: 2022.49.0
3
+ JSBundleVersion: 2022.50.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.ChartKit
3
- JSBundleVersion: 2022.49.0
3
+ JSBundleVersion: 2022.50.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2021 Breakside Inc.
6
6
  # JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.ConferenceKit
3
- JSBundleVersion: 2022.49.0
3
+ JSBundleVersion: 2022.50.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.DBKit
3
- JSBundleVersion: 2022.49.0
3
+ JSBundleVersion: 2022.50.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.DOM
3
- JSBundleVersion: 2022.49.0
3
+ JSBundleVersion: 2022.50.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.Dispatch
3
- JSBundleVersion: 2022.49.0
3
+ JSBundleVersion: 2022.50.0
4
4
  JSCopyright: Copyright © 2020 Breakside Inc.
5
5
  JSBundleEnvironments:
6
6
  html: Dispatch+HTML.js
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.FontKit
3
- JSBundleVersion: 2022.49.0
3
+ JSBundleVersion: 2022.50.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.Foundation
3
- JSBundleVersion: 2022.49.0
3
+ JSBundleVersion: 2022.50.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -15,6 +15,7 @@
15
15
 
16
16
  // #import "JSClass.js"
17
17
  // #import "JSValueTransformer.js"
18
+ // #import "Number+JS.js"
18
19
  /* global JSSpec */
19
20
  'use strict';
20
21
 
@@ -156,21 +157,21 @@ JSObject.definePropertiesFromExtensions({
156
157
  this._updateValueForBinding(context.binding);
157
158
  }else if (change.type == JSObject.KeyValueChange.Insertion){
158
159
  key = bindingInfo.binding;
159
- change.indexes.sort();
160
+ change.indexes.sort(Number.jskitCompare);
160
161
  for (i = 0, l = change.indexes.length; i < l; ++i){
161
162
  index = change.indexes[i];
162
163
  this.silentlyInsertObjectInKeyAtIndex(change.sourceObject.objectInKeyAtIndex(change.sourceKey, index), key, index);
163
164
  }
164
165
  }else if (change.type == JSObject.KeyValueChange.Removal){
165
166
  key = bindingInfo.binding;
166
- change.indexes.sort();
167
+ change.indexes.sort(Number.jskitCompare);
167
168
  for (i = change.indexes.length - 1; i >= 0; --i){
168
169
  index = change.indexes[i];
169
170
  this.silentlyRemoveObjectFromKeyAtIndex(key, index);
170
171
  }
171
172
  }else if (change.type == JSObject.KeyValueChange.Replacement){
172
173
  key = bindingInfo.binding;
173
- change.indexes.sort();
174
+ change.indexes.sort(Number.jskitCompare);
174
175
  for (i = 0, l = change.indexes.length; i < l; ++i){
175
176
  index = change.indexes[i];
176
177
  this.silentlyReplaceObjectInKeyAtIndexWithObject(key, index, change.sourceObject.objectInKeyAtIndex(change.sourceKey, index));
@@ -613,7 +614,7 @@ JSObject.definePropertiesFromExtensions({
613
614
  targetObject = targetObject.valueForKeyPath(keyParts.join('.'));
614
615
  }
615
616
  if (targetObject){
616
- indexes.sort();
617
+ indexes.sort(Number.jskitCompare);
617
618
  if (change == JSObject.KeyValueChange.Insertion){
618
619
  for (i = 0, l = indexes.length; i < l; ++i){
619
620
  index = indexes[i];
@@ -17,4 +17,6 @@
17
17
 
18
18
  Number.prototype.parseNumberArray = function(){
19
19
  return [this];
20
- };
20
+ };
21
+
22
+ Number.jskitCompare = function(a, b){ return a - b; };
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.ImageKit
3
- JSBundleVersion: 2022.49.0
3
+ JSBundleVersion: 2022.50.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.MediaKit
3
- JSBundleVersion: 2022.49.0
3
+ JSBundleVersion: 2022.50.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.MediaKitUI
3
- JSBundleVersion: 2022.49.0
3
+ JSBundleVersion: 2022.50.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.NotificationKit
3
- JSBundleVersion: 2022.49.0
3
+ JSBundleVersion: 2022.50.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2021 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.PDFKit
3
- JSBundleVersion: 2022.49.0
3
+ JSBundleVersion: 2022.50.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.QRKit
3
- JSBundleVersion: 2022.49.0
3
+ JSBundleVersion: 2022.50.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.SearchKit
3
- JSBundleVersion: 2022.49.0
3
+ JSBundleVersion: 2022.50.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.SecurityKit
3
- JSBundleVersion: 2022.49.0
3
+ JSBundleVersion: 2022.50.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.ServerKit
3
- JSBundleVersion: 2022.49.0
3
+ JSBundleVersion: 2022.50.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.ServerKitTesting
3
- JSBundleVersion: 2022.49.0
3
+ JSBundleVersion: 2022.50.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.TestKit
3
- JSBundleVersion: 2022.49.0
3
+ JSBundleVersion: 2022.50.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.UIKit
3
- JSBundleVersion: 2022.49.0
3
+ JSBundleVersion: 2022.50.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -329,8 +329,9 @@ JSClass("UICheckboxDefaultStyler", UICheckboxStyler, {
329
329
  maxTitleSize.width -= boxWidth;
330
330
  checkbox._titleLabel.sizeToFitSize(maxTitleSize);
331
331
  checkbox.bounds = JSRect(0, 0, boxWidth + checkbox._titleLabel.frame.size.width, height);
332
+ }else{
333
+ checkbox.bounds = JSRect(0, 0, height, height);
332
334
  }
333
- checkbox.bounds = JSRect(0, 0, height, height);
334
335
  },
335
336
 
336
337
  intrinsicSizeOfControl: function(checkbox){
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.UIKitTesting
3
- JSBundleVersion: 2022.49.0
3
+ JSBundleVersion: 2022.50.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
@@ -12,7 +12,7 @@ function install(){
12
12
  for (var path in app.sources){
13
13
  source = app.sources[path];
14
14
  if (source.required){
15
- required.push(path);
15
+ required.push({path: path, cache: source.cache});
16
16
  }
17
17
  }
18
18
  var loaded = 0;
@@ -20,8 +20,8 @@ function install(){
20
20
  return clients.matchAll({includeUncontrolled: true}).then(function(clients){
21
21
  var client = clients[0];
22
22
  return caches.open(cacheKey).then(function(cache){
23
- return Promise.all(required.map(function(path){
24
- return cache.add(path).then(function(){
23
+ return Promise.all(required.map(function(resource){
24
+ return cache.add(new Request(resource.path, {cache: resource.cache || "default"})).then(function(){
25
25
  ++loaded;
26
26
  client.postMessage({type: 'progress', loaded: loaded, total: total});
27
27
  });
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "node": ">=10.10.0"
10
10
  },
11
11
  "name": "@breakside/jskit",
12
- "version": "2022.49.0",
12
+ "version": "2022.50.0",
13
13
  "license": "SEE LICENSE IN LICENSE.txt",
14
14
  "files": [
15
15
  "*"