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

Supply JSKit runtime in SwiftPM resources #193

Merged
merged 12 commits into from
May 12, 2022
5 changes: 3 additions & 2 deletions 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 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 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 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 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 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 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