mach: Rename `js-runtime subproject to sysjs`
This commit is contained in:
parent
05b0df052d
commit
7a0d39c274
11 changed files with 7 additions and 7 deletions
|
|
@ -5,7 +5,7 @@ const gpu_dawn = @import("gpu-dawn/build.zig");
|
||||||
pub const glfw = @import("glfw/build.zig");
|
pub const glfw = @import("glfw/build.zig");
|
||||||
pub const ecs = @import("ecs/build.zig");
|
pub const ecs = @import("ecs/build.zig");
|
||||||
const freetype = @import("freetype/build.zig");
|
const freetype = @import("freetype/build.zig");
|
||||||
const js_runtime = @import("js-runtime/build.zig");
|
const sysjs = @import("sysjs/build.zig");
|
||||||
const Pkg = std.build.Pkg;
|
const Pkg = std.build.Pkg;
|
||||||
|
|
||||||
pub fn build(b: *std.build.Builder) void {
|
pub fn build(b: *std.build.Builder) void {
|
||||||
|
|
@ -166,7 +166,7 @@ pub const App = struct {
|
||||||
deps.append(gpu.pkg) catch unreachable;
|
deps.append(gpu.pkg) catch unreachable;
|
||||||
switch (platform) {
|
switch (platform) {
|
||||||
.native => deps.append(glfw.pkg) catch unreachable,
|
.native => deps.append(glfw.pkg) catch unreachable,
|
||||||
.web => deps.append(js_runtime.pkg) catch unreachable,
|
.web => deps.append(sysjs.pkg) catch unreachable,
|
||||||
}
|
}
|
||||||
if (options.deps) |app_deps| deps.appendSlice(app_deps) catch unreachable;
|
if (options.deps) |app_deps| deps.appendSlice(app_deps) catch unreachable;
|
||||||
|
|
||||||
|
|
@ -180,7 +180,7 @@ pub const App = struct {
|
||||||
if (platform == .web) {
|
if (platform == .web) {
|
||||||
const lib = b.addSharedLibrary(options.name, thisDir() ++ "/src/platform/wasm.zig", .unversioned);
|
const lib = b.addSharedLibrary(options.name, thisDir() ++ "/src/platform/wasm.zig", .unversioned);
|
||||||
lib.addPackage(gpu.pkg);
|
lib.addPackage(gpu.pkg);
|
||||||
lib.addPackage(js_runtime.pkg);
|
lib.addPackage(sysjs.pkg);
|
||||||
|
|
||||||
break :blk lib;
|
break :blk lib;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -214,7 +214,7 @@ pub const App = struct {
|
||||||
// Set install directory to '{prefix}/www'
|
// Set install directory to '{prefix}/www'
|
||||||
app.getInstallStep().?.dest_dir = web_install_dir;
|
app.getInstallStep().?.dest_dir = web_install_dir;
|
||||||
|
|
||||||
inline for (.{ "/src/platform/mach.js", "/js-runtime/src/js-runtime.js" }) |js| {
|
inline for (.{ "/src/platform/mach.js", "/sysjs/src/mach-sysjs.js" }) |js| {
|
||||||
const install_js = app.b.addInstallFileWithDir(
|
const install_js = app.b.addInstallFileWithDir(
|
||||||
.{ .path = thisDir() ++ js },
|
.{ .path = thisDir() ++ js },
|
||||||
web_install_dir,
|
web_install_dir,
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
# mach-js-runtime
|
|
||||||
0
js-runtime/.gitignore → sysjs/.gitignore
vendored
0
js-runtime/.gitignore → sysjs/.gitignore
vendored
1
sysjs/README.md
Normal file
1
sysjs/README.md
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
# mach-sysjs
|
||||||
|
|
@ -12,7 +12,7 @@ pub fn build(b: *std.build.Builder) void {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const pkg = std.build.Pkg{
|
pub const pkg = std.build.Pkg{
|
||||||
.name = "js-runtime",
|
.name = "sysjs",
|
||||||
.source = .{ .path = thisDir() ++ "/src/main.zig" },
|
.source = .{ .path = thisDir() ++ "/src/main.zig" },
|
||||||
.dependencies = &[_]std.build.Pkg{},
|
.dependencies = &[_]std.build.Pkg{},
|
||||||
};
|
};
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
<body>
|
<body>
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import {{ mach }} from "./mach.js";
|
import {{ mach }} from "./mach.js";
|
||||||
import {{ zig }} from "./js-runtime.js";
|
import {{ zig }} from "./mach-sysjs.js";
|
||||||
|
|
||||||
let imports = {{
|
let imports = {{
|
||||||
env: {{ ...mach, ...zig }},
|
env: {{ ...mach, ...zig }},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue