Skip to content

Commit

Permalink
Update deps + switch to opam on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
alex35mil committed Feb 28, 2024
1 parent 8b31e42 commit d00db85
Show file tree
Hide file tree
Showing 58 changed files with 332 additions and 2,990 deletions.
281 changes: 202 additions & 79 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

41 changes: 20 additions & 21 deletions .github/workflows/scripts/postinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,44 +8,43 @@ let arch = process.arch;
let platform = process.platform;

if (arch === "ia32") {
arch = "x86";
arch = "x86";
}

if (platform === "win32") {
platform = "win";
platform = "win";
}

const filename = `bin/${PPX}-${platform}-${arch}.exe`;

const supported = fs.existsSync(filename);

if (!supported) {
console.error(`${PPX} does not support this platform :(`);
console.error("");
console.error(`${PPX} comes prepacked as built binaries to avoid large`);
console.error("dependencies at build-time.");
console.error("");
console.error(`If you want ${PPX} to support this platform natively,`);
console.error("please open an issue at our repository, linked above. Please");
console.error(`specify that you are on the ${platform} platform,`);
console.error(`on the ${arch} architecture.`);

console.error(`${PPX} does not support this platform :(`);
console.error("");
console.error(`${PPX} comes prepacked as built binaries to avoid large`);
console.error("dependencies at build-time.");
console.error("");
console.error(`If you want ${PPX} to support this platform natively,`);
console.error("please open an issue at our repository, linked above. Please");
console.error(`specify that you are on the ${platform} platform,`);
console.error(`on the ${arch} architecture.`);
}

if (!fs.existsSync("ppx.exe")) {
copyFileSync(filename, "ppx.exe");
fs.chmodSync("ppx.exe", 0755);
copyFileSync(filename, "ppx.exe");
fs.chmodSync("ppx.exe", 0755);
}

if (!fs.existsSync("ppx")) {
copyFileSync(filename, "ppx");
fs.chmodSync("ppx", 0755);
copyFileSync(filename, "ppx");
fs.chmodSync("ppx", 0755);
}

function copyFileSync(source, dest) {
if (typeof fs.copyFileSync === "function") {
fs.copyFileSync(source, dest);
} else {
fs.writeFileSync(dest, fs.readFileSync(source));
}
if (typeof fs.copyFileSync === "function") {
fs.copyFileSync(source, dest);
} else {
fs.writeFileSync(dest, fs.readFileSync(source));
}
}
15 changes: 0 additions & 15 deletions .github/workflows/scripts/print-esy-cache.js

This file was deleted.

53 changes: 18 additions & 35 deletions .github/workflows/scripts/write-package-json.js
Original file line number Diff line number Diff line change
@@ -1,43 +1,26 @@
const fs = require("fs");
const path = require("path");

const {
name,
version,
description,
author,
license,
repository,
keywords
} = require("../../../package.json");
const { name, version, description, author, license, repository, keywords } = require("../../../package.json");
const { dependencies } = require("../../../lib/package.json");

const packageJson = JSON.stringify(
{
name,
version,
description,
author,
license,
repository,
keywords,
dependencies,
files: [
"src",
"bin",
"bsconfig.json",
"postinstall.js",
],
scripts: {
postinstall: "node ./postinstall.js"
}
},
null,
2
{
name,
version,
description,
author,
license,
repository,
keywords,
dependencies,
files: ["src", "bin", "rescript.json", "postinstall.js"],
scripts: {
postinstall: "node ./postinstall.js",
},
},
null,
2,
);

fs.writeFileSync(
path.join(__dirname, "..", "..", "..", "_release", "package.json"),
packageJson,
{ encoding: "utf8" }
);
fs.writeFileSync(path.join(__dirname, "..", "..", "..", "_release", "package.json"), packageJson, { encoding: "utf8" });
21 changes: 9 additions & 12 deletions devbox.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
{
"packages": [
"path:./nix/ocaml#ocaml",
"path:./nix/ocaml#dune",
"path:./nix/ocaml#result",
"path:./nix/ocaml#findlib",
"path:./nix/ocaml#ppxlib",
"path:./nix/ocaml#alcotest",
"path:./nix/ocaml#merlin",
"path:./nix/ocaml#lsp",
"path:./nix/ocaml#ocamlformat",
"path:./nix/ocaml#ocamlformat_rpc",
"ocamlPackages.ocaml",
"ocamlPackages.dune_3",
"ocamlPackages.findlib",
"ocamlPackages.ppxlib",
"ocamlPackages.alcotest",
"ocamlPackages.ocaml-lsp",
"ocamlPackages.ocamlformat",
"ocamlPackages.ocamlformat-rpc-lib",
"nodejs",
"yarn",
"awscli2"
"yarn"
],
"shell": {
"init_hook": [
Expand Down
44 changes: 32 additions & 12 deletions devbox.lock
Original file line number Diff line number Diff line change
@@ -1,22 +1,42 @@
{
"lockfile_version": "1",
"packages": {
"awscli2": {
"resolved": "github:NixOS/nixpkgs/f80ac848e3d6f0c12c52758c0f25c10c97ca3b62#awscli2",
"source": "nixpkg"
},
"nodejs": {
"resolved": "github:NixOS/nixpkgs/f80ac848e3d6f0c12c52758c0f25c10c97ca3b62#nodejs",
"source": "nixpkg"
},
"path:./nix/ocaml#alcotest": {},
"path:./nix/ocaml#dune": {},
"path:./nix/ocaml#findlib": {},
"path:./nix/ocaml#lsp": {},
"path:./nix/ocaml#merlin": {},
"path:./nix/ocaml#ocaml": {},
"path:./nix/ocaml#ppxlib": {},
"path:./nix/ocaml#result": {},
"ocamlPackages.alcotest": {
"resolved": "github:NixOS/nixpkgs/75a52265bda7fd25e06e3a67dee3f0354e73243c#ocamlPackages.alcotest",
"source": "nixpkg"
},
"ocamlPackages.dune_3": {
"resolved": "github:NixOS/nixpkgs/75a52265bda7fd25e06e3a67dee3f0354e73243c#ocamlPackages.dune_3",
"source": "nixpkg"
},
"ocamlPackages.findlib": {
"resolved": "github:NixOS/nixpkgs/75a52265bda7fd25e06e3a67dee3f0354e73243c#ocamlPackages.findlib",
"source": "nixpkg"
},
"ocamlPackages.ocaml": {
"resolved": "github:NixOS/nixpkgs/75a52265bda7fd25e06e3a67dee3f0354e73243c#ocamlPackages.ocaml",
"source": "nixpkg"
},
"ocamlPackages.ocaml-lsp": {
"resolved": "github:NixOS/nixpkgs/75a52265bda7fd25e06e3a67dee3f0354e73243c#ocamlPackages.ocaml-lsp",
"source": "nixpkg"
},
"ocamlPackages.ocamlformat": {
"resolved": "github:NixOS/nixpkgs/75a52265bda7fd25e06e3a67dee3f0354e73243c#ocamlPackages.ocamlformat",
"source": "nixpkg"
},
"ocamlPackages.ocamlformat-rpc-lib": {
"resolved": "github:NixOS/nixpkgs/75a52265bda7fd25e06e3a67dee3f0354e73243c#ocamlPackages.ocamlformat-rpc-lib",
"source": "nixpkg"
},
"ocamlPackages.ppxlib": {
"resolved": "github:NixOS/nixpkgs/75a52265bda7fd25e06e3a67dee3f0354e73243c#ocamlPackages.ppxlib",
"source": "nixpkg"
},
"yarn": {
"resolved": "github:NixOS/nixpkgs/f80ac848e3d6f0c12c52758c0f25c10c97ca3b62#yarn",
"source": "nixpkg"
Expand Down
2 changes: 1 addition & 1 deletion dune-project
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
(lang dune 2.6)
(name re-formality-ppx)
(name re-formality-ppx)
1 change: 1 addition & 0 deletions dune-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(lang dune 2.6)
10 changes: 4 additions & 6 deletions esy.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@
"buildsInSource": "_build"
},
"dependencies": {
"ocaml": "4.12.0",
"@opam/dune": "3.7.0",
"@opam/ppxlib": "0.28.0",
"@opam/ocamlfind": "1.9.6"
"ocaml": "4.14.1000",
"@opam/dune": "3.11.1",
"@opam/ppxlib": "O.30.0"
},
"devDependencies": {
"@opam/merlin": "*",
"@opam/alcotest": "1.4.0"
"@opam/alcotest": "1.7.0"
}
}
3 changes: 0 additions & 3 deletions esy.lock/.gitattributes

This file was deleted.

3 changes: 0 additions & 3 deletions esy.lock/.gitignore

This file was deleted.

Loading

0 comments on commit d00db85

Please sign in to comment.