From 5cf471476eb7ba4bb5ac4de0b050c35a7cc92b8e Mon Sep 17 00:00:00 2001 From: m1ga Date: Mon, 30 Sep 2024 13:35:37 +0200 Subject: [PATCH 1/5] fix models length issue --- Alloy/commands/compile/compilerUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Alloy/commands/compile/compilerUtils.js b/Alloy/commands/compile/compilerUtils.js index e35616545..922d1fdf1 100755 --- a/Alloy/commands/compile/compilerUtils.js +++ b/Alloy/commands/compile/compilerUtils.js @@ -1018,7 +1018,7 @@ exports.generateCollectionBindingTemplate = function(args) { code += ' if (e && e.fromAdapter) { return; }'; code += ' var opts = ' + handlerFunc + '.opts || {};'; code += ' var models = ' + whereCode + ';'; - code += ' var len = models.length;'; + code += ' var len = models ? models.length : 0;'; code += '<%= pre %>'; code += ' for (var i = 0; i < len; i++) {'; code += ' var <%= localModel %> = models[i];'; From c04bab99d6c50dfe25cb8667c22b608368c8d5a9 Mon Sep 17 00:00:00 2001 From: m1ga Date: Tue, 1 Oct 2024 19:41:34 +0200 Subject: [PATCH 2/5] workflow --- .github/workflows/build.yml | 15 +++++++-------- .github/workflows/publish.yml | 6 +++--- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2c8fa986b..c5d792807 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,12 +11,12 @@ jobs: Lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v4 with: - node-version: '16.x' + node-version: '18.x' - name: Install dependencies run: npm ci - name: Lint @@ -28,23 +28,22 @@ jobs: strategy: fail-fast: false matrix: - nodeVersion: [ '16.x' ] + nodeVersion: [ '18.x' ] os: [ macos-latest ] tiSDK: [ latest ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v4 with: node-version: ${{ matrix.nodeVersion }} - name: Install dependencies run: | npm ci npm i titanium -g - ti sdk install ${{ matrix.tiSDK }} -d + ti sdk install ${{ matrix.tiSDK }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Run tests run: npm test - diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1ed15caa2..300428964 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,14 +8,14 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Setup node - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: - node-version: '16' + node-version: '18' registry-url: 'https://registry.npmjs.org' - name: Install dependencies From e7fe3f10f012c96fbe89a16eecf3a6add12b4c7c Mon Sep 17 00:00:00 2001 From: m1ga Date: Tue, 1 Oct 2024 20:17:58 +0200 Subject: [PATCH 3/5] just for testing --- Alloy/tiapp.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Alloy/tiapp.js b/Alloy/tiapp.js index 0f15181e6..b874dae83 100644 --- a/Alloy/tiapp.js +++ b/Alloy/tiapp.js @@ -44,7 +44,8 @@ function getSdkSelectVersion() { var homeDir = process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'], file = path.join(homeDir, '.titanium', 'config.json'); if (!fs.existsSync(file)) { - U.die('Titanium configuration file does not exist at "' + file + '"'); + //U.die('Titanium configuration file does not exist at "' + file + '"'); + return "" } var ticonfig = JSON.parse(fs.readFileSync(file, {encoding: 'utf8'})); return ticonfig.sdk.selected; From 962b7701f585ac7414d99c56df2d8fd0ef708913 Mon Sep 17 00:00:00 2001 From: m1ga Date: Tue, 1 Oct 2024 20:19:07 +0200 Subject: [PATCH 4/5] just for testing --- Alloy/tiapp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Alloy/tiapp.js b/Alloy/tiapp.js index b874dae83..e5c152143 100644 --- a/Alloy/tiapp.js +++ b/Alloy/tiapp.js @@ -45,7 +45,7 @@ function getSdkSelectVersion() { file = path.join(homeDir, '.titanium', 'config.json'); if (!fs.existsSync(file)) { //U.die('Titanium configuration file does not exist at "' + file + '"'); - return "" + return '12.5.0.GA'; } var ticonfig = JSON.parse(fs.readFileSync(file, {encoding: 'utf8'})); return ticonfig.sdk.selected; From b68578bc251349286f37638635ab7694765dc962 Mon Sep 17 00:00:00 2001 From: m1ga Date: Tue, 1 Oct 2024 20:47:07 +0200 Subject: [PATCH 5/5] ignore files again --- .github/workflows/build.yml | 15 ++++++++------- .github/workflows/publish.yml | 6 +++--- Alloy/tiapp.js | 3 +-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c5d792807..2c8fa986b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,12 +11,12 @@ jobs: Lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v2 with: fetch-depth: 0 - - uses: actions/setup-node@v4 + - uses: actions/setup-node@v1 with: - node-version: '18.x' + node-version: '16.x' - name: Install dependencies run: npm ci - name: Lint @@ -28,22 +28,23 @@ jobs: strategy: fail-fast: false matrix: - nodeVersion: [ '18.x' ] + nodeVersion: [ '16.x' ] os: [ macos-latest ] tiSDK: [ latest ] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v2 with: fetch-depth: 0 - - uses: actions/setup-node@v4 + - uses: actions/setup-node@v1 with: node-version: ${{ matrix.nodeVersion }} - name: Install dependencies run: | npm ci npm i titanium -g - ti sdk install ${{ matrix.tiSDK }} + ti sdk install ${{ matrix.tiSDK }} -d env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Run tests run: npm test + diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 300428964..1ed15caa2 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,14 +8,14 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Setup node - uses: actions/setup-node@v4 + uses: actions/setup-node@v2 with: - node-version: '18' + node-version: '16' registry-url: 'https://registry.npmjs.org' - name: Install dependencies diff --git a/Alloy/tiapp.js b/Alloy/tiapp.js index e5c152143..0f15181e6 100644 --- a/Alloy/tiapp.js +++ b/Alloy/tiapp.js @@ -44,8 +44,7 @@ function getSdkSelectVersion() { var homeDir = process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'], file = path.join(homeDir, '.titanium', 'config.json'); if (!fs.existsSync(file)) { - //U.die('Titanium configuration file does not exist at "' + file + '"'); - return '12.5.0.GA'; + U.die('Titanium configuration file does not exist at "' + file + '"'); } var ticonfig = JSON.parse(fs.readFileSync(file, {encoding: 'utf8'})); return ticonfig.sdk.selected;