Skip to content

Commit

Permalink
Merge pull request #598 from tidev/nodeDep
Browse files Browse the repository at this point in the history
feat(all): update node dependencies
  • Loading branch information
cb1kenobi authored Jan 13, 2023
2 parents 963746e + 7d1d112 commit 4e564d3
Show file tree
Hide file tree
Showing 8 changed files with 4,429 additions and 8,898 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: macos-latest
strategy:
matrix:
node: [ '12', '14' ]
node: [ '16' ]
name: Node ${{ matrix.node }}
steps:
- uses: actions/checkout@v2
Expand All @@ -34,10 +34,10 @@ jobs:
- run: npm ci
name: Install dependencies
if: steps.node-cache.outputs.cache-hit != 'true'

- run: npm run lint
name: Lint

- name: Build and Test
uses: reactivecircus/android-emulator-runner@v2
with:
Expand All @@ -48,10 +48,10 @@ jobs:

- run: npm pack
name: Package
if: matrix.node == '12'
if: matrix.node == '16'

- uses: actions/upload-artifact@v2
if: matrix.node == '12'
if: matrix.node == '16'
with:
name: node-titanium-sdk
path: node-titanium-sdk-*.tgz
11 changes: 10 additions & 1 deletion lib/jsanalyze.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ const path = require('path');
const SOURCE_MAPPING_URL_REGEXP = /\/\/#[ \t]+sourceMappingURL=([^\s'"`]+?)[ \t]*$/mg;
const __ = appc.i18n(__dirname).__;

function sortObject(o) {
const sorted = {};
for (const key of Object.keys(o).sort()) {
sorted[key] = o[key];
}
return sorted;
}
exports.sortObject = sortObject;

/**
* Returns an object with the Titanium API usage statistics.
*
Expand Down Expand Up @@ -228,7 +237,7 @@ exports.analyzeJs = function analyzeJs(contents, opts = {}) {
// Well, if there's only one source with the same basename and we rename it to just the basename, that "fixes" the Web Inspector display
// IDEA: What if we fix iOS to report URIs like /app.js as Android does, will that make it behave more properly?
}

transformed.map = sortObject(transformed.map);
// Do our own inlined source map so we can have control over the map object that is written!
const base64Contents = Buffer.from(JSON.stringify(transformed.map)).toString('base64');
// NOTE: We MUST append a \n or else iOS will break, because it injects a ';' after the
Expand Down
Loading

0 comments on commit 4e564d3

Please sign in to comment.