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: support visionOS #14

Closed
Closed
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
14 changes: 13 additions & 1 deletion jest.preset.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
const nxPreset = require('@nrwl/jest/preset').default;

module.exports = { ...nxPreset };
module.exports = {
...nxPreset,
/* TODO: Update to latest Jest snapshotFormat
* By default Nx has kept the older style of Jest Snapshot formats
* to prevent breaking of any existing tests with snapshots.
* It's recommend you update to the latest format.
* You can do this by removing snapshotFormat property
* and running tests with --update-snapshot flag.
* Example: "nx affected --targets=test --update-snapshot"
* More info: https://jestjs.io/docs/upgrading-to-jest29#snapshot-format
*/
snapshotFormat: { escapeString: true, printBasicPrototype: true },
};
12 changes: 12 additions & 0 deletions migrations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"migrations": [
{
"cli": "nx",
"version": "5.1.0",
"description": "Migrate tools to 5.1.0",
"implementation": "./src/migrations/update-5-1-0/update-5-1-0",
"package": "@nativescript/plugin-tools",
"name": "update-to-5.1.0"
}
]
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@angular/router": "^15.0.0",
"@nativescript/angular": "^15.0.0",
"@nativescript/core": "~8.4.0",
"@nativescript/plugin-tools": "5.0.2",
"@nativescript/plugin-tools": "5.1.0",
"@nativescript/types": "~8.4.0",
"@nativescript/webpack": "~5.0.12",
"@ngrx/effects": "^15.1.0",
Expand All @@ -56,11 +56,11 @@
"postcss-import": "^14.0.2",
"postcss-preset-env": "^6.7.0",
"postcss-url": "^10.1.1",
"rxjs": "~7.5.0",
"rxjs": "~7.8.0",
"socketcluster-client": "^14.3.2",
"ts-node": "10.9.1",
"typescript": "~4.8.0",
"zone.js": "~0.11.5"
"zone.js": "~0.13.0"
},
"lint-staged": {
"**/*.{js,ts,scss,json,html}": [
Expand Down
15 changes: 8 additions & 7 deletions packages/nativescript-ngrx-devtools/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ export default {
displayName: 'nativescript-ngrx-devtools',
preset: '../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
},
globals: {},
coverageDirectory: '../../coverage/packages/nativescript-ngrx-devtools',
transform: {
'^.+\\.(ts|mjs|js|html)$': 'jest-preset-angular',
'^.+\\.(ts|mjs|js|html)$': [
'jest-preset-angular',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
],
},
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
snapshotSerializers: ['jest-preset-angular/build/serializers/no-ng-attributes', 'jest-preset-angular/build/serializers/ng-snapshot', 'jest-preset-angular/build/serializers/html-comment'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,12 @@
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.valor-software.NativeScriptWebSockets";
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SDKROOT = "";
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator";
SUPPORTS_MACCATALYST = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = "1,2,7";
};
name = Debug;
};
Expand All @@ -392,9 +395,12 @@
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.valor-software.NativeScriptWebSockets";
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SDKROOT = "";
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator";
SUPPORTS_MACCATALYST = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = "1,2,7";
};
name = Release;
};
Expand Down
33 changes: 32 additions & 1 deletion packages/nativescript-websockets/native-src/ios/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ xcodebuild \
-scheme $PACKAGENAME \
-sdk iphonesimulator \
-configuration Release \
-destination "generic/platform=iOS Simulator" \
clean build \
BUILD_DIR=$OUTPUTPATH \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
-quiet

echo "Build for iphoneos"
Expand All @@ -28,11 +30,37 @@ xcodebuild \
-scheme $PACKAGENAME \
-sdk iphoneos \
-configuration Release \
-destination "generic/platform=iOS" \
clean build \
BUILD_DIR=$OUTPUTPATH \
CODE_SIGN_IDENTITY="" \
CODE_SIGNING_REQUIRED=NO \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
-quiet

echo "Build for visionos device"
xcodebuild \
-project $PACKAGENAME.xcodeproj \
-scheme $PACKAGENAME \
-configuration Release \
-destination "generic/platform=visionOS" \
clean build \
BUILD_DIR=$OUTPUTPATH \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
-quiet

echo "Build for visionos simulator"
xcodebuild \
-project $PACKAGENAME.xcodeproj \
-scheme $PACKAGENAME \
-configuration Release \
-destination "generic/platform=visionOS Simulator" \
clean build \
BUILD_DIR=$OUTPUTPATH \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
-quiet

echo "Creating XCFramework"
Expand All @@ -42,9 +70,12 @@ xcodebuild \
-debug-symbols $OUTPUTPATH/Release-iphoneos/$PACKAGENAME.framework.dSYM \
-framework $OUTPUTPATH/Release-iphonesimulator/$PACKAGENAME.framework \
-debug-symbols $OUTPUTPATH/Release-iphonesimulator/$PACKAGENAME.framework.dSYM \
-framework $OUTPUTPATH/Release-xros/$PACKAGENAME.framework \
-debug-symbols $OUTPUTPATH/Release-xros/$PACKAGENAME.framework.dSYM \
-framework $OUTPUTPATH/Release-xrsimulator/$PACKAGENAME.framework \
-debug-symbols $OUTPUTPATH/Release-xrsimulator/$PACKAGENAME.framework.dSYM \
-output $OUTPUTPATH/$PACKAGENAME.xcframework


mkdir -p $COPYPATH
rm -rf $COPYPATH/$PACKAGENAME.xcframework
cp -R $OUTPUTPATH/$PACKAGENAME.xcframework $COPYPATH/
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,33 @@
<key>AvailableLibraries</key>
<array>
<dict>
<key>BinaryPath</key>
<string>NativeScriptWebSockets.framework/NativeScriptWebSockets</string>
<key>DebugSymbolsPath</key>
<string>dSYMs</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_i386_x86_64-simulator</string>
<string>xros-arm64</string>
<key>LibraryPath</key>
<string>NativeScriptWebSockets.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>xros</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>NativeScriptWebSockets.framework/NativeScriptWebSockets</string>
<key>DebugSymbolsPath</key>
<string>dSYMs</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>NativeScriptWebSockets.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>i386</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
Expand All @@ -23,20 +40,40 @@
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>NativeScriptWebSockets.framework/NativeScriptWebSockets</string>
<key>DebugSymbolsPath</key>
<string>dSYMs</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_armv7</string>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>NativeScriptWebSockets.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>armv7</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>NativeScriptWebSockets.framework/NativeScriptWebSockets</string>
<key>DebugSymbolsPath</key>
<string>dSYMs</string>
<key>LibraryIdentifier</key>
<string>xros-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>NativeScriptWebSockets.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>xros</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
<string>XFWK</string>
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
framework module NativeScriptWebSockets {
umbrella header "NativeScriptWebSockets.h"

export *

module * { export * }
}
Binary file not shown.
Binary file not shown.
Loading
Loading