From 79251c27a8f854b2ac59fe32871d0fabf47ad1af Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Sat, 23 May 2026 16:43:30 -0700 Subject: [PATCH] ci: trusted publishers --- .github/workflows/npm_trusted_release.yml | 277 ++++++++++++++++++++++ packages/ios-hermes/LICENSE | 201 ++++++++++++++++ packages/ios-hermes/README.md | 13 + packages/ios-hermes/package.json | 27 +++ packages/ios-jsc/LICENSE | 201 ++++++++++++++++ packages/ios-jsc/README.md | 13 + packages/ios-jsc/package.json | 28 +++ packages/ios-quickjs/LICENSE | 201 ++++++++++++++++ packages/ios-quickjs/README.md | 13 + packages/ios-quickjs/package.json | 27 +++ packages/ios-v8/LICENSE | 201 ++++++++++++++++ packages/ios-v8/README.md | 13 + packages/ios-v8/package.json | 27 +++ scripts/build_all_ios.sh | 7 +- scripts/build_npm_ios.sh | 10 +- scripts/get-next-version.js | 4 + scripts/get-npm-tag.js | 4 + scripts/update_version.sh | 2 +- 18 files changed, 1265 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/npm_trusted_release.yml create mode 100644 packages/ios-hermes/LICENSE create mode 100644 packages/ios-hermes/README.md create mode 100644 packages/ios-hermes/package.json create mode 100644 packages/ios-jsc/LICENSE create mode 100644 packages/ios-jsc/README.md create mode 100644 packages/ios-jsc/package.json create mode 100644 packages/ios-quickjs/LICENSE create mode 100644 packages/ios-quickjs/README.md create mode 100644 packages/ios-quickjs/package.json create mode 100644 packages/ios-v8/LICENSE create mode 100644 packages/ios-v8/README.md create mode 100644 packages/ios-v8/package.json diff --git a/.github/workflows/npm_trusted_release.yml b/.github/workflows/npm_trusted_release.yml new file mode 100644 index 00000000..04c54be1 --- /dev/null +++ b/.github/workflows/npm_trusted_release.yml @@ -0,0 +1,277 @@ +name: NPM Trusted Release (iOS engines) + +# Publishes one or more engine-specific NativeScript iOS runtime packages +# (@nativescript/ios-v8, @nativescript/ios-hermes, @nativescript/ios-jsc, +# @nativescript/ios-quickjs) via npm trusted publishing (OIDC). +# +# Each package must be configured on npmjs.com with a trusted publisher that +# points at this repository + workflow + environment. With `engine: all`, the +# workflow fans out across all four engines via a matrix. + +on: + workflow_dispatch: + inputs: + engine: + description: "Engine to release (or 'all' to publish every engine)" + required: true + type: choice + default: v8 + options: + - v8 + - hermes + - jsc + - quickjs + - all + release-type: + description: "Version bump (patch/minor/major publish to 'latest'; prerelease uses 'preid' as the dist-tag)" + required: false + type: choice + default: prerelease + options: + - prerelease + - patch + - minor + - major + preid: + description: "Prerelease identifier (used only when release-type=prerelease; also becomes the npm dist-tag, e.g. next | canary)" + required: false + type: string + default: next + dry-run: + description: "Run release steps without making changes (no git push, no publish)" + required: false + type: boolean + default: true + +concurrency: + # Avoid overlapping publishes on the same ref/engine selection. + group: npm-trusted-release-${{ github.ref }}-${{ inputs.engine }} + cancel-in-progress: false + +env: + XCODE_VERSION: "26.2.0" + +jobs: + matrix: + name: Resolve engine matrix + runs-on: ubuntu-latest + outputs: + engines: ${{ steps.compute.outputs.engines }} + steps: + - name: Compute matrix + id: compute + run: | + if [ "${{ inputs.engine }}" = "all" ]; then + echo 'engines=["v8","hermes","jsc","quickjs"]' >> "$GITHUB_OUTPUT" + else + echo "engines=[\"${{ inputs.engine }}\"]" >> "$GITHUB_OUTPUT" + fi + + build: + name: Build ${{ matrix.engine }} + needs: matrix + runs-on: macos-26 + strategy: + fail-fast: false + matrix: + engine: ${{ fromJson(needs.matrix.outputs.engines) }} + outputs: + # Per-engine outputs aren't natively supported with matrices, so each job + # uploads its computed metadata alongside the tarball artifact. + placeholder: noop + env: + IOS_VARIANT: ios-${{ matrix.engine }} + steps: + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + with: + egress-policy: audit + - uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0 + with: + xcode-version: ${{ env.XCODE_VERSION }} + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 + with: + fetch-depth: 0 + submodules: recursive + - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 + with: + node-version: 24 + registry-url: "https://registry.npmjs.org" + - name: Install Python + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 + with: + python-version: "3" + - name: Install Dependencies + run: | + npm install + python3 -m pip install --upgrade pip six + if ! command -v ld64.lld >/dev/null; then + brew list lld || brew install lld + fi + if ! command -v cmake >/dev/null; then + brew list cmake || brew install cmake + fi + if [ ! -x /usr/local/bin/cmake ]; then + sudo mkdir -p /usr/local/bin + sudo ln -sf "$(command -v cmake)" /usr/local/bin/cmake + fi + - name: Bump version + id: bump + shell: bash + run: | + set -euo pipefail + release_type='${{ inputs.release-type }}' + preid='${{ inputs.preid }}' + pkg_dir="packages/${IOS_VARIANT}" + + pushd "$pkg_dir" >/dev/null + if [ "$release_type" = "prerelease" ]; then + npm version prerelease --preid "$preid" --no-git-tag-version >/dev/null + else + npm version "$release_type" --no-git-tag-version >/dev/null + fi + NPM_VERSION=$(node -e "console.log(require('./package.json').version)") + popd >/dev/null + + NPM_TAG=$(NPM_VERSION="$NPM_VERSION" node ./scripts/get-npm-tag.js "$IOS_VARIANT") + echo "NPM_VERSION=$NPM_VERSION" >> "$GITHUB_OUTPUT" + echo "NPM_TAG=$NPM_TAG" >> "$GITHUB_OUTPUT" + echo "Resolved $IOS_VARIANT@$NPM_VERSION (tag: $NPM_TAG)" + - name: Build (--${{ matrix.engine }}) + run: ./scripts/build_all_ios.sh --${{ matrix.engine }} + - name: Record metadata + shell: bash + run: | + mkdir -p packages/${IOS_VARIANT}/dist + cat > packages/${IOS_VARIANT}/dist/release-meta.json <&2 + exit 1 + fi + NPM_VERSION=$(node -e "console.log(require('./$meta').version)") + NPM_TAG=$(node -e "console.log(require('./$meta').tag)") + PACKAGE_NAME=$(node -e "console.log(require('./$meta').package_name)") + echo "NPM_VERSION=$NPM_VERSION" >> "$GITHUB_OUTPUT" + echo "NPM_TAG=$NPM_TAG" >> "$GITHUB_OUTPUT" + echo "PACKAGE_NAME=$PACKAGE_NAME" >> "$GITHUB_OUTPUT" + - name: Publish package (OIDC trusted publishing) + if: ${{ vars.USE_NPM_TOKEN != 'true' }} + shell: bash + env: + NPM_VERSION: ${{ steps.meta.outputs.NPM_VERSION }} + NPM_TAG: ${{ steps.meta.outputs.NPM_TAG }} + PACKAGE_NAME: ${{ steps.meta.outputs.PACKAGE_NAME }} + DRY_RUN: ${{ inputs.dry-run }} + NODE_AUTH_TOKEN: "" + run: | + set -euo pipefail + TARBALL="packages/ios-${{ matrix.engine }}/dist/nativescript-ios-${{ matrix.engine }}-${NPM_VERSION}.tgz" + PUBLISH_ARGS=("$TARBALL" --tag "$NPM_TAG" --access public --provenance) + if [ "$DRY_RUN" = "true" ]; then + PUBLISH_ARGS+=(--dry-run) + fi + echo "Publishing ${PACKAGE_NAME}@${NPM_VERSION} (tag: $NPM_TAG, dry-run: $DRY_RUN) via OIDC trusted publishing..." + unset NODE_AUTH_TOKEN + rm -f ~/.npmrc || true + if [ -n "${NPM_CONFIG_USERCONFIG:-}" ]; then + rm -f "$NPM_CONFIG_USERCONFIG" || true + fi + npm publish "${PUBLISH_ARGS[@]}" + - name: Publish package (granular token fallback) + if: ${{ vars.USE_NPM_TOKEN == 'true' }} + shell: bash + env: + NPM_VERSION: ${{ steps.meta.outputs.NPM_VERSION }} + NPM_TAG: ${{ steps.meta.outputs.NPM_TAG }} + PACKAGE_NAME: ${{ steps.meta.outputs.PACKAGE_NAME }} + DRY_RUN: ${{ inputs.dry-run }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} + run: | + set -euo pipefail + TARBALL="packages/ios-${{ matrix.engine }}/dist/nativescript-ios-${{ matrix.engine }}-${NPM_VERSION}.tgz" + PUBLISH_ARGS=("$TARBALL" --tag "$NPM_TAG" --access public --provenance) + if [ "$DRY_RUN" = "true" ]; then + PUBLISH_ARGS+=(--dry-run) + fi + echo "Publishing ${PACKAGE_NAME}@${NPM_VERSION} (tag: $NPM_TAG, dry-run: $DRY_RUN) via granular token..." + npm publish "${PUBLISH_ARGS[@]}" + + summary: + name: Release summary + if: always() + needs: + - matrix + - build + - publish + runs-on: ubuntu-latest + steps: + - name: Print summary + run: | + echo "Engine selection: ${{ inputs.engine }}" + echo "Release type: ${{ inputs.release-type }}" + echo "Preid: ${{ inputs.preid }}" + echo "Dry run: ${{ inputs.dry-run }}" + echo "Engines: ${{ needs.matrix.outputs.engines }}" + echo "Build result: ${{ needs.build.result }}" + echo "Publish result: ${{ needs.publish.result }}" diff --git a/packages/ios-hermes/LICENSE b/packages/ios-hermes/LICENSE new file mode 100644 index 00000000..6f231e7c --- /dev/null +++ b/packages/ios-hermes/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2023 Yagiz Nizipli and Daniel Lemire + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/packages/ios-hermes/README.md b/packages/ios-hermes/README.md new file mode 100644 index 00000000..ea5235ac --- /dev/null +++ b/packages/ios-hermes/README.md @@ -0,0 +1,13 @@ +# @nativescript/ios-hermes + +NativeScript runtime package for iOS, built with the Hermes JavaScript engine. + +## Build + +From the repo root: + +```sh +npm run build-ios -- --hermes +``` + +This stages the package in `packages/ios-hermes/dist/package` and produces the npm artifact in `packages/ios-hermes/dist/`. diff --git a/packages/ios-hermes/package.json b/packages/ios-hermes/package.json new file mode 100644 index 00000000..e4a7bc3b --- /dev/null +++ b/packages/ios-hermes/package.json @@ -0,0 +1,27 @@ +{ + "name": "@nativescript/ios-hermes", + "version": "0.0.2", + "description": "NativeScript Runtime for iOS (Hermes engine)", + "keywords": [ + "NativeScript", + "iOS", + "runtime", + "hermes" + ], + "repository": { + "type": "git", + "url": "https://github.com/NativeScript/napi-ios", + "directory": "packages/ios-hermes" + }, + "author": { + "name": "NativeScript Team", + "email": "oss@nativescript.org" + }, + "scripts": { + "build": "cd ../.. && ./scripts/build_all_ios.sh --hermes" + }, + "files": [ + "framework" + ], + "license": "Apache-2.0" +} diff --git a/packages/ios-jsc/LICENSE b/packages/ios-jsc/LICENSE new file mode 100644 index 00000000..6f231e7c --- /dev/null +++ b/packages/ios-jsc/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2023 Yagiz Nizipli and Daniel Lemire + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/packages/ios-jsc/README.md b/packages/ios-jsc/README.md new file mode 100644 index 00000000..a85c1250 --- /dev/null +++ b/packages/ios-jsc/README.md @@ -0,0 +1,13 @@ +# @nativescript/ios-jsc + +NativeScript runtime package for iOS, built with the JavaScriptCore engine. + +## Build + +From the repo root: + +```sh +npm run build-ios -- --jsc +``` + +This stages the package in `packages/ios-jsc/dist/package` and produces the npm artifact in `packages/ios-jsc/dist/`. diff --git a/packages/ios-jsc/package.json b/packages/ios-jsc/package.json new file mode 100644 index 00000000..4966ca51 --- /dev/null +++ b/packages/ios-jsc/package.json @@ -0,0 +1,28 @@ +{ + "name": "@nativescript/ios-jsc", + "version": "0.0.2", + "description": "NativeScript Runtime for iOS (JavaScriptCore engine)", + "keywords": [ + "NativeScript", + "iOS", + "runtime", + "jsc", + "javascriptcore" + ], + "repository": { + "type": "git", + "url": "https://github.com/NativeScript/napi-ios", + "directory": "packages/ios-jsc" + }, + "author": { + "name": "NativeScript Team", + "email": "oss@nativescript.org" + }, + "scripts": { + "build": "cd ../.. && ./scripts/build_all_ios.sh --jsc" + }, + "files": [ + "framework" + ], + "license": "Apache-2.0" +} diff --git a/packages/ios-quickjs/LICENSE b/packages/ios-quickjs/LICENSE new file mode 100644 index 00000000..6f231e7c --- /dev/null +++ b/packages/ios-quickjs/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2023 Yagiz Nizipli and Daniel Lemire + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/packages/ios-quickjs/README.md b/packages/ios-quickjs/README.md new file mode 100644 index 00000000..43dd6d9c --- /dev/null +++ b/packages/ios-quickjs/README.md @@ -0,0 +1,13 @@ +# @nativescript/ios-quickjs + +NativeScript runtime package for iOS, built with the QuickJS JavaScript engine. + +## Build + +From the repo root: + +```sh +npm run build-ios -- --quickjs +``` + +This stages the package in `packages/ios-quickjs/dist/package` and produces the npm artifact in `packages/ios-quickjs/dist/`. diff --git a/packages/ios-quickjs/package.json b/packages/ios-quickjs/package.json new file mode 100644 index 00000000..757d1668 --- /dev/null +++ b/packages/ios-quickjs/package.json @@ -0,0 +1,27 @@ +{ + "name": "@nativescript/ios-quickjs", + "version": "0.0.2", + "description": "NativeScript Runtime for iOS (QuickJS engine)", + "keywords": [ + "NativeScript", + "iOS", + "runtime", + "quickjs" + ], + "repository": { + "type": "git", + "url": "https://github.com/NativeScript/napi-ios", + "directory": "packages/ios-quickjs" + }, + "author": { + "name": "NativeScript Team", + "email": "oss@nativescript.org" + }, + "scripts": { + "build": "cd ../.. && ./scripts/build_all_ios.sh --quickjs" + }, + "files": [ + "framework" + ], + "license": "Apache-2.0" +} diff --git a/packages/ios-v8/LICENSE b/packages/ios-v8/LICENSE new file mode 100644 index 00000000..6f231e7c --- /dev/null +++ b/packages/ios-v8/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2023 Yagiz Nizipli and Daniel Lemire + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/packages/ios-v8/README.md b/packages/ios-v8/README.md new file mode 100644 index 00000000..79625133 --- /dev/null +++ b/packages/ios-v8/README.md @@ -0,0 +1,13 @@ +# @nativescript/ios-v8 + +NativeScript runtime package for iOS, built with the V8 JavaScript engine. + +## Build + +From the repo root: + +```sh +npm run build-ios -- --v8 +``` + +This stages the package in `packages/ios-v8/dist/package` and produces the npm artifact in `packages/ios-v8/dist/`. diff --git a/packages/ios-v8/package.json b/packages/ios-v8/package.json new file mode 100644 index 00000000..198236be --- /dev/null +++ b/packages/ios-v8/package.json @@ -0,0 +1,27 @@ +{ + "name": "@nativescript/ios-v8", + "version": "0.0.2", + "description": "NativeScript Runtime for iOS (V8 engine)", + "keywords": [ + "NativeScript", + "iOS", + "runtime", + "v8" + ], + "repository": { + "type": "git", + "url": "https://github.com/NativeScript/napi-ios", + "directory": "packages/ios-v8" + }, + "author": { + "name": "NativeScript Team", + "email": "oss@nativescript.org" + }, + "scripts": { + "build": "cd ../.. && ./scripts/build_all_ios.sh --v8" + }, + "files": [ + "framework" + ], + "license": "Apache-2.0" +} diff --git a/scripts/build_all_ios.sh b/scripts/build_all_ios.sh index 47edbfa5..062bac94 100755 --- a/scripts/build_all_ios.sh +++ b/scripts/build_all_ios.sh @@ -8,6 +8,11 @@ BUILD_SIMULATOR=$(to_bool ${BUILD_SIMULATOR:=true}) BUILD_MACOS=$(to_bool ${BUILD_MACOS:=false}) EMBED_METADATA=$(to_bool ${EMBED_METADATA:=false}) +# Optional: stage into a per-engine npm package directory (e.g. packages/ios-v8). +# Defaults to "ios" for backward compatibility with the @nativescript/ios package. +IOS_VARIANT=${IOS_VARIANT:=ios} +export IOS_VARIANT + # See build_nativescript.sh for all supported flags. This parent script is only # interested in intercepting a subset of them. for arg in $@; do @@ -29,7 +34,7 @@ rm -rf ./dist # Sync the embedded runtime version when building the iOS runtime package. if [ -z "$NO_UPDATE_VERSION" ] && [[ "$TARGET_ENGINE" != "none" ]]; then - "$SCRIPT_DIR/update_version.sh" ios + "$SCRIPT_DIR/update_version.sh" "$IOS_VARIANT" fi "$SCRIPT_DIR/build_metadata_generator.sh" diff --git a/scripts/build_npm_ios.sh b/scripts/build_npm_ios.sh index d4970c93..afe6a3a9 100755 --- a/scripts/build_npm_ios.sh +++ b/scripts/build_npm_ios.sh @@ -2,8 +2,14 @@ set -e source "$(dirname "$0")/build_utils.sh" -checkpoint "Preparing npm package for iOS..." -PACKAGE_DIR="packages/ios" +IOS_VARIANT=${IOS_VARIANT:=ios} + +checkpoint "Preparing npm package for $IOS_VARIANT..." +PACKAGE_DIR="packages/$IOS_VARIANT" +if [ ! -f "$PACKAGE_DIR/package.json" ]; then + echo "Expected package directory '$PACKAGE_DIR' (IOS_VARIANT=$IOS_VARIANT) to contain a package.json." >&2 + exit 1 +fi OUTPUT_DIR="$PACKAGE_DIR/dist" STAGING_DIR="$OUTPUT_DIR/package" diff --git a/scripts/get-next-version.js b/scripts/get-next-version.js index 17011cb1..9bdcc2e4 100644 --- a/scripts/get-next-version.js +++ b/scripts/get-next-version.js @@ -11,6 +11,10 @@ if (!currentVersion) { const target = cmdArgs[0]; const packageJsonByTarget = { ios: "../packages/ios/package.json", + "ios-v8": "../packages/ios-v8/package.json", + "ios-hermes": "../packages/ios-hermes/package.json", + "ios-jsc": "../packages/ios-jsc/package.json", + "ios-quickjs": "../packages/ios-quickjs/package.json", macos: "../packages/macos/package.json", visionos: "../packages/visionos/package.json", "ios-node-api": "../packages/ios-node-api/package.json", diff --git a/scripts/get-npm-tag.js b/scripts/get-npm-tag.js index d86ba2f1..7555e2a7 100644 --- a/scripts/get-npm-tag.js +++ b/scripts/get-npm-tag.js @@ -7,6 +7,10 @@ if (!currentVersion) { const target = cmdArgs[0]; const packageJsonByTarget = { ios: "../packages/ios/package.json", + "ios-v8": "../packages/ios-v8/package.json", + "ios-hermes": "../packages/ios-hermes/package.json", + "ios-jsc": "../packages/ios-jsc/package.json", + "ios-quickjs": "../packages/ios-quickjs/package.json", macos: "../packages/macos/package.json", visionos: "../packages/visionos/package.json", "ios-node-api": "../packages/ios-node-api/package.json", diff --git a/scripts/update_version.sh b/scripts/update_version.sh index d98865d4..30398f9e 100755 --- a/scripts/update_version.sh +++ b/scripts/update_version.sh @@ -6,7 +6,7 @@ TARGET=${1:-ios} PACKAGE_VERSION_OVERRIDE=${2:-$PACKAGE_VERSION} case "$TARGET" in - ios|macos|visionos|ios-node-api|macos-node-api|objc-node-api) + ios|ios-v8|ios-hermes|ios-jsc|ios-quickjs|macos|visionos|ios-node-api|macos-node-api|objc-node-api) PACKAGE_JSON="packages/$TARGET/package.json" ;; *)