Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
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 1 .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Sources/JavaScriptKit/Runtime/** linguist-generated
5 changes: 5 additions & 0 deletions 5 .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ jobs:
SWIFT_VERSION=${{ matrix.entry.toolchain }} make bootstrap
echo ${{ matrix.entry.toolchain }} > .swift-version
make test
- name: Check if SwiftPM resources are stale
run: |
make regenerate_swiftpm_resources
git diff --exit-code Sources/JavaScriptKit/Runtime
Comment thread
MaxDesiatov marked this conversation as resolved.

native-build:
# Check native build to make it easy to develop applications by Xcode
name: Build for native target
Expand Down
5 changes: 5 additions & 0 deletions 5 Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,8 @@ run_benchmark:
.PHONY: perf-tester
perf-tester:
cd ci/perf-tester && npm ci

.PHONY: regenerate_swiftpm_resources
regenerate_swiftpm_resources:
npm run build
cp Runtime/lib/index.js Runtime/lib/index.mjs Sources/JavaScriptKit/Runtime
5 changes: 3 additions & 2 deletions 5 Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.2
// swift-tools-version:5.3

import PackageDescription

Expand All @@ -12,7 +12,8 @@ let package = Package(
targets: [
.target(
name: "JavaScriptKit",
dependencies: ["_CJavaScriptKit"]
dependencies: ["_CJavaScriptKit"],
resources: [.copy("Runtime")]
),
.target(name: "_CJavaScriptKit"),
.target(
Expand Down
2 changes: 1 addition & 1 deletion 2 Runtime/src/closure-heap.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ExportedFunctions } from "./types";
import { ExportedFunctions } from "./types.js";

/// Memory lifetime of closures in Swift are managed by Swift side
export class SwiftClosureDeallocator {
Expand Down
8 changes: 4 additions & 4 deletions 8 Runtime/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { SwiftClosureDeallocator } from "./closure-heap";
import { SwiftClosureDeallocator } from "./closure-heap.js";
import {
LibraryFeatures,
ExportedFunctions,
ref,
pointer,
TypedArray,
ImportedFunctions,
} from "./types";
import * as JSValue from "./js-value";
import { Memory } from "./memory";
} from "./types.js";
import * as JSValue from "./js-value.js";
import { Memory } from "./memory.js";

export class SwiftRuntime {
private _instance: WebAssembly.Instance | null;
Expand Down
4 changes: 2 additions & 2 deletions 4 Runtime/src/js-value.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Memory } from "./memory";
import { assertNever, pointer } from "./types";
import { Memory } from "./memory.js";
import { assertNever, pointer } from "./types.js";

export const enum Kind {
Boolean = 0,
Expand Down
4 changes: 2 additions & 2 deletions 4 Runtime/src/memory.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SwiftRuntimeHeap } from "./object-heap";
import { pointer } from "./types";
import { SwiftRuntimeHeap } from "./object-heap.js";
import { pointer } from "./types.js";

export class Memory {
readonly rawMemory: WebAssembly.Memory;
Expand Down
4 changes: 2 additions & 2 deletions 4 Runtime/src/object-heap.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { globalVariable } from "./find-global";
import { ref } from "./types";
import { globalVariable } from "./find-global.js";
import { ref } from "./types.js";

type SwiftRuntimeHeapEntry = {
id: number;
Expand Down
2 changes: 1 addition & 1 deletion 2 Runtime/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as JSValue from "./js-value";
import * as JSValue from "./js-value.js";

export type ref = number;
export type pointer = number;
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.