Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(all): update node dependencies #598

Merged
merged 6 commits into from
Jan 13, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
19 changes: 18 additions & 1 deletion lib/jsanalyze.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,23 @@ const path = require('path');
const SOURCE_MAPPING_URL_REGEXP = /\/\/#[ \t]+sourceMappingURL=([^\s'"`]+?)[ \t]*$/mg;
const __ = appc.i18n(__dirname).__;

function sortObject (o) {
m1ga marked this conversation as resolved.
Show resolved Hide resolved
m1ga marked this conversation as resolved.
Show resolved Hide resolved
var sorted = {},
key,
a = [];

for (key in o) {
m1ga marked this conversation as resolved.
Show resolved Hide resolved
a.push(key);
}

a.sort();

for (key = 0; key < a.length; key++) {
sorted[a[key]] = o[a[key]];
}
return sorted;
}

/**
* Returns an object with the Titanium API usage statistics.
*
Expand Down Expand Up @@ -228,7 +245,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