File tree Expand file tree Collapse file tree 12 files changed +854
-14
lines changed
Sources/JavaScriptKit/Runtime Expand file tree Collapse file tree 12 files changed +854
-14
lines changed Original file line number Diff line number Diff line change 1+ Sources /JavaScriptKit /Runtime /** linguist-generated
Original file line number Diff line number Diff line change 3838 SWIFT_VERSION=${{ matrix.entry.toolchain }} make bootstrap
3939 echo ${{ matrix.entry.toolchain }} > .swift-version
4040 make test
41+ - name : Check if SwiftPM resources are stale
42+ run : |
43+ make regenerate_swiftpm_resources
44+ git diff --exit-code Sources/JavaScriptKit/Runtime
45+
4146 native-build :
4247 # Check native build to make it easy to develop applications by Xcode
4348 name : Build for native target
Original file line number Diff line number Diff line change @@ -29,3 +29,8 @@ run_benchmark:
2929.PHONY : perf-tester
3030perf-tester :
3131 cd ci/perf-tester && npm ci
32+
33+ .PHONY : regenerate_swiftpm_resources
34+ regenerate_swiftpm_resources :
35+ npm run build
36+ cp Runtime/lib/index.js Runtime/lib/index.mjs Sources/JavaScriptKit/Runtime
Original file line number Diff line number Diff line change 1- // swift-tools-version:5.2
1+ // swift-tools-version:5.3
22
33import PackageDescription
44
@@ -12,7 +12,8 @@ let package = Package(
1212 targets: [
1313 . target(
1414 name: " JavaScriptKit " ,
15- dependencies: [ " _CJavaScriptKit " ]
15+ dependencies: [ " _CJavaScriptKit " ] ,
16+ resources: [ . copy( " Runtime " ) ]
1617 ) ,
1718 . target( name: " _CJavaScriptKit " ) ,
1819 . target(
Original file line number Diff line number Diff line change 1- import { ExportedFunctions } from "./types" ;
1+ import { ExportedFunctions } from "./types.js " ;
22
33/// Memory lifetime of closures in Swift are managed by Swift side
44export class SwiftClosureDeallocator {
Original file line number Diff line number Diff line change 1- import { SwiftClosureDeallocator } from "./closure-heap" ;
1+ import { SwiftClosureDeallocator } from "./closure-heap.js " ;
22import {
33 LibraryFeatures ,
44 ExportedFunctions ,
55 ref ,
66 pointer ,
77 TypedArray ,
88 ImportedFunctions ,
9- } from "./types" ;
10- import * as JSValue from "./js-value" ;
11- import { Memory } from "./memory" ;
9+ } from "./types.js " ;
10+ import * as JSValue from "./js-value.js " ;
11+ import { Memory } from "./memory.js " ;
1212
1313export class SwiftRuntime {
1414 private _instance : WebAssembly . Instance | null ;
Original file line number Diff line number Diff line change 1- import { Memory } from "./memory" ;
2- import { assertNever , pointer } from "./types" ;
1+ import { Memory } from "./memory.js " ;
2+ import { assertNever , pointer } from "./types.js " ;
33
44export const enum Kind {
55 Boolean = 0 ,
Original file line number Diff line number Diff line change 1- import { SwiftRuntimeHeap } from "./object-heap" ;
2- import { pointer } from "./types" ;
1+ import { SwiftRuntimeHeap } from "./object-heap.js " ;
2+ import { pointer } from "./types.js " ;
33
44export class Memory {
55 readonly rawMemory : WebAssembly . Memory ;
Original file line number Diff line number Diff line change 1- import { globalVariable } from "./find-global" ;
2- import { ref } from "./types" ;
1+ import { globalVariable } from "./find-global.js " ;
2+ import { ref } from "./types.js " ;
33
44type SwiftRuntimeHeapEntry = {
55 id : number ;
Original file line number Diff line number Diff line change 1- import * as JSValue from "./js-value" ;
1+ import * as JSValue from "./js-value.js " ;
22
33export type ref = number ;
44export type pointer = number ;
You can’t perform that action at this time.
0 commit comments