alloy 2.1.0 → 3.0.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 (56) hide show
  1. package/.eslintrc.js +2 -1
  2. package/.github/workflows/build.yml +8 -9
  3. package/.github/workflows/cla.yaml +1 -1
  4. package/.github/workflows/publish.yml +47 -8
  5. package/Alloy/builtins/moment/lang/ar-dz.js +8 -8
  6. package/Alloy/builtins/moment/lang/ar-ly.js +8 -8
  7. package/Alloy/builtins/moment/lang/ar-ps.js +123 -0
  8. package/Alloy/builtins/moment/lang/ar.js +8 -8
  9. package/Alloy/builtins/moment/lang/be.js +2 -2
  10. package/Alloy/builtins/moment/lang/bs.js +14 -4
  11. package/Alloy/builtins/moment/lang/ca.js +6 -6
  12. package/Alloy/builtins/moment/lang/cs.js +5 -4
  13. package/Alloy/builtins/moment/lang/cv.js +2 -2
  14. package/Alloy/builtins/moment/lang/en-au.js +6 -6
  15. package/Alloy/builtins/moment/lang/en-ca.js +6 -6
  16. package/Alloy/builtins/moment/lang/en-gb.js +6 -6
  17. package/Alloy/builtins/moment/lang/en-ie.js +6 -6
  18. package/Alloy/builtins/moment/lang/en-il.js +6 -6
  19. package/Alloy/builtins/moment/lang/en-in.js +6 -6
  20. package/Alloy/builtins/moment/lang/en-nz.js +6 -6
  21. package/Alloy/builtins/moment/lang/en-sg.js +6 -6
  22. package/Alloy/builtins/moment/lang/it.js +4 -4
  23. package/Alloy/builtins/moment/lang/ku-kmr.js +125 -0
  24. package/Alloy/builtins/moment/lang/lt.js +2 -2
  25. package/Alloy/builtins/moment/lang/me.js +2 -2
  26. package/Alloy/builtins/moment/lang/nb.js +4 -4
  27. package/Alloy/builtins/moment/lang/nl-be.js +1 -1
  28. package/Alloy/builtins/moment/lang/nl.js +1 -1
  29. package/Alloy/builtins/moment/lang/oc-lnc.js +6 -6
  30. package/Alloy/builtins/moment/lang/ru.js +2 -2
  31. package/Alloy/builtins/moment/lang/sv.js +6 -6
  32. package/Alloy/builtins/moment/lang/tet.js +6 -6
  33. package/Alloy/builtins/moment/lang/tlh.js +8 -8
  34. package/Alloy/builtins/moment/lang/tzl.js +2 -2
  35. package/Alloy/builtins/moment/lang/uk.js +4 -4
  36. package/Alloy/builtins/moment/lang/x-pseudo.js +6 -6
  37. package/Alloy/builtins/moment.js +368 -365
  38. package/Alloy/commands/compile/ast/controller.js +6 -2
  39. package/Alloy/commands/compile/compilerUtils.js +3 -2
  40. package/Alloy/commands/compile/parsers/Alloy.Abstract.FixedSpace.js +2 -11
  41. package/Alloy/commands/compile/parsers/Alloy.Abstract.FlexSpace.js +2 -11
  42. package/Alloy/commands/compile/parsers/Alloy.Abstract.Option.js +2 -2
  43. package/Alloy/commands/compile/parsers/Alloy.Abstract._ItemContainer.js +9 -2
  44. package/Alloy/commands/compile/parsers/Ti.UI.AttributedString.js +0 -5
  45. package/Alloy/commands/compile/parsers/Ti.UI.Button.js +2 -11
  46. package/Alloy/commands/compile/parsers/Ti.UI.NavigationWindow.js +0 -15
  47. package/Alloy/commands/compile/parsers/Ti.UI.OptionBar.js +0 -5
  48. package/Alloy/commands/compile/parsers/Ti.UI.TabbedBar.js +0 -9
  49. package/Alloy/commands/compile/parsers/Ti.UI.Toolbar.js +0 -6
  50. package/Alloy/common/constants.js +1 -1
  51. package/Alloy/lib/alloy/backbone/1.6.0/backbone.js +2155 -0
  52. package/Alloy/tiapp.js +1 -11
  53. package/README.md +16 -0
  54. package/package.json +6 -25
  55. package/test/projects/HarnessTemplate/tiapp.xml +1 -0
  56. package/Alloy/commands/compile/parsers/Ti.UI.iPhone.NavigationGroup.js +0 -58
package/Alloy/tiapp.js CHANGED
@@ -35,20 +35,10 @@ tiapp.getSdkVersion = function() {
35
35
  } else {
36
36
  if (process.env.sdk) {
37
37
  return process.env.sdk;
38
- } else {
39
- return getSdkSelectVersion();
40
38
  }
41
39
  }
42
40
  };
43
- function getSdkSelectVersion() {
44
- var homeDir = process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'],
45
- file = path.join(homeDir, '.titanium', 'config.json');
46
- if (!fs.existsSync(file)) {
47
- U.die('Titanium configuration file does not exist at "' + file + '"');
48
- }
49
- var ticonfig = JSON.parse(fs.readFileSync(file, {encoding: 'utf8'}));
50
- return ticonfig.sdk.selected;
51
- }
41
+
52
42
 
53
43
  // Get the value of a property from the tiapp.xml
54
44
  tiapp.getProperty = function(name) {
package/README.md CHANGED
@@ -70,6 +70,22 @@ jake app:run dir=basics/simple
70
70
  * If you decide to ignore my advice and run the tests anyway on Windows, make sure that if you imported the Harness into TiStudio that you _don't_ have TiStudio running. Windows creates locks on key files in that project that are necessary for the testing process. It will make tests fail erroneously.
71
71
  * If you're still that stubborn, are running the test suite on Windows, and you're getting those intermittent, erroneous errors, try running them one spec at a time. Instead of doing `jake test:all`, do `jake test:spec[SPEC_NAME]`, where `SPEC_NAME` is JS file in the [test specs folder](https://github.com/tidev/alloy/tree/master/test/specs).
72
72
 
73
+ ## Update moment.js/Backbone/Underscore
74
+
75
+ ### moment.js
76
+
77
+ Download the latest ZIP from https://github.com/moment/moment and then copy /moment.js (not dist/moment.js!) into `Alloy/builtins` and the locale/* files (not dist/locale/* !) to `Alloy/builtins/moment/lang`. After that do a search & replace and replace all `require('../moment')` with `require('/alloy/moment')`.
78
+
79
+ ### Backbone
80
+
81
+ Download the development version from https://backbonejs.org/ and put it into `Alloy/lib/alloy/backbone` with the correct version number. Open `Alloy/common/constants.js` and add the version to `SUPPORTED_BACKBONE_VERSIONS`. Then you can use your apps config.json file to switch to that version. If you want to make it the default version you can edit `DEFAULT_BACKBONE_VERSION` and the config.json files in all `template/` projects.
82
+
83
+ Open the backbone.js file and replace `var _ = require('underscore'), $;` with `var _ = require('/alloy/underscore'), $;`. Use `console.log(Backbone.VERSION);` to check the version inside your app.
84
+
85
+ ### Underscore
86
+
87
+ Download the UMD (dev) version from https://underscorejs.org/ and replace `Alloy/lib/alloy/underscore.js`. Use `console.log(_.VERSION);` to check the version inside your app.
88
+
73
89
  ## Contributing
74
90
 
75
91
  Interested in contributing? There are several ways you can help contribute to this project.
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "html5",
12
12
  "appc-client"
13
13
  ],
14
- "version": "2.1.0",
14
+ "version": "3.0.0",
15
15
  "author": "TiDev, Inc. <npm@tidev.io>",
16
16
  "bugs": {
17
17
  "url": "https://github.com/tidev/alloy/issues"
@@ -29,6 +29,7 @@
29
29
  "@babel/template": "^7.18.10",
30
30
  "@babel/traverse": "^7.18.15",
31
31
  "@babel/types": "^7.20.0",
32
+ "@prantlf/jsonlint": "11.7.0",
32
33
  "@xmldom/xmldom": "^0.8.5",
33
34
  "async": "^3.2.4",
34
35
  "colors": "1.4.0",
@@ -36,10 +37,9 @@
36
37
  "ejs": "3.1.8",
37
38
  "fs-extra": "^10.1.0",
38
39
  "global-paths": "^1.0.0",
39
- "@prantlf/jsonlint": "11.7.0",
40
40
  "lodash": "^4.17.4",
41
- "moment": "2.29.4",
42
- "node.extend": "2.0.2",
41
+ "moment": "2.30.1",
42
+ "node.extend": "2.0.3",
43
43
  "pkginfo": "0.4.1",
44
44
  "resolve": "^1.22.1",
45
45
  "source-map": "^0.7.4",
@@ -57,30 +57,11 @@
57
57
  },
58
58
  "main": "./Alloy/alloy",
59
59
  "engines": {
60
- "node": ">=0.10"
60
+ "node": ">=20.18.1"
61
61
  },
62
62
  "devDependencies": {
63
- "@semantic-release/changelog": "^6.0.0",
64
- "@semantic-release/git": "^10.0.0",
65
63
  "diff": "^5.1.0",
66
64
  "eslint": "^8.26.0",
67
- "jake": "^10.8.2",
68
- "semantic-release": "^19.0.5"
69
- },
70
- "release": {
71
- "tagFormat": "${version}",
72
- "plugins": [
73
- "@semantic-release/commit-analyzer",
74
- "@semantic-release/release-notes-generator",
75
- "@semantic-release/changelog",
76
- "@semantic-release/npm",
77
- "@semantic-release/git",
78
- [
79
- "@semantic-release/github",
80
- {
81
- "successComment": false
82
- }
83
- ]
84
- ]
65
+ "jake": "^10.8.2"
85
66
  }
86
67
  }
@@ -69,4 +69,5 @@
69
69
  <module platform="android">ti.map</module>
70
70
  <module platform="iphone">ti.map</module>
71
71
  </modules>
72
+ <sdk-version>12.6.1.GA</sdk-version>
72
73
  </ti:app>
@@ -1,58 +0,0 @@
1
- var styler = require('../styler'),
2
- U = require('../../../utils'),
3
- CU = require('../compilerUtils'),
4
- tiapp = require('../../../tiapp'),
5
- logger = require('../../../logger');
6
-
7
- var DEPRECATED_VERSION = '3.1.3';
8
-
9
- exports.parse = function(node, state) {
10
- return require('./base').parse(node, state, parse);
11
- };
12
-
13
- function parse(node, state, args) {
14
- if (tiapp.version.gte(tiapp.getSdkVersion(), DEPRECATED_VERSION)) {
15
- logger.warn([
16
- 'Ti.UI.iPhone.NavigationGroup (line ' + node.lineNumber + ') is deprecated as of Titanium ' + DEPRECATED_VERSION,
17
- 'Use Ti.UI.NavigationWindow instead'
18
- ]);
19
- }
20
-
21
- var children = U.XML.getElementsFromNodes(node.childNodes),
22
- err = ['NavigationGroup must have only one child element, which must be a Window'],
23
- code = '';
24
-
25
- // NavigationGroup must have 1 window as a child
26
- if (children.length !== 1) {
27
- U.die(err);
28
- }
29
-
30
- var child = children[0],
31
- childArgs = CU.getParserArgs(child),
32
- theNode = CU.validateNodeName(child, 'Ti.UI.Window'),
33
- windowSymbol;
34
-
35
- // generate the code for the Window first
36
- if (theNode) {
37
- code += CU.generateNodeExtended(child, state, {
38
- parent: {},
39
- post: function(node, state, args) {
40
- windowSymbol = state.parent.symbol;
41
- }
42
- });
43
- } else {
44
- err.unshift('Invalid NavigationGroup child "' + childArgs.fullname + '"');
45
- U.die(err);
46
- }
47
-
48
- // create navgroup with window
49
- state.extraStyle = styler.createVariableStyle('window', windowSymbol);
50
- code += require('./default').parse(node, state).code;
51
-
52
- // Update the parsing state
53
- return {
54
- parent: {},
55
- styles: state.styles,
56
- code: code
57
- };
58
- }