Skip to content

Commit

Permalink
build: Switch from CJS to ESM (#1160)
Browse files Browse the repository at this point in the history
  • Loading branch information
samestep committed Dec 8, 2022
1 parent 9e8439e commit 3ae696e
Show file tree
Hide file tree
Showing 54 changed files with 518 additions and 487 deletions.
4 changes: 3 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
{}
{
"organizeImportsSkipDestructiveCodeActions": true
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
"markdown-toc": "^1.2.0",
"nx": "^15.0.13",
"prettier": "2.2.1",
"prettier-plugin-organize-imports": "^2.3.4",
"prettier-plugin-organize-imports": "^3.2.1",
"pretty-quick": "^3.1.0",
"rimraf": "^3.0.2",
"typescript": "^4.1.3"
"typescript": "^4.9.4"
},
"workspaces": {
"packages": [
Expand Down
2 changes: 1 addition & 1 deletion packages/automator/artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as fs from "fs";
import _ from "lodash";
import pug from "pug";
import { InstanceData } from "./types";
import vis from "./vis";
import * as vis from "./vis";

const PAGELEN = 5;
const gridLink = "grid.html";
Expand Down
5 changes: 3 additions & 2 deletions packages/automator/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require("global-jsdom/register");
import "global-jsdom/register"; // must be first

import {
compileTrio,
evalEnergy,
Expand All @@ -18,7 +19,7 @@ import * as fs from "fs";
import neodoc from "neodoc";
import fetch from "node-fetch";
import { dirname, join, parse, resolve } from "path";
import * as prettier from "prettier";
import prettier from "prettier";
import uniqid from "uniqid";
import { printTextChart, renderArtifacts } from "./artifacts";
import { AggregateData, InstanceData } from "./types";
Expand Down
6 changes: 3 additions & 3 deletions packages/automator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
"name": "@penrose/automator",
"version": "1.3.0",
"description": "",
"type": "module",
"main": "index.tsx",
"scripts": {
"build": ":",
"build-decls": ":",
"start": "ts-node ./index.tsx",
"start": "ts-node --esm --experimentalSpecifierResolution=node ./index.tsx",
"generate-site": "yarn clean && yarn start batch registry.json artifacts --render=browser --src-prefix=progs --folders --cross-energy",
"clean": "rimraf artifacts browser",
"typecheck": "tsc --noEmit"
Expand Down Expand Up @@ -45,7 +46,6 @@
},
"devDependencies": {
"@types/node": "^12.12.68",
"ts-node": "^9.0.0",
"typescript": "^4.1.3"
"ts-node": "^10.9.1"
}
}
4 changes: 2 additions & 2 deletions packages/automator/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"compilerOptions": {
"module": "CommonJS",
"module": "es2022",
"allowJs": true,
"esModuleInterop": true,
"target": "es6",
"target": "es2017",
"moduleResolution": "Node",
"sourceMap": true,
"outDir": "dist",
Expand Down
Loading

0 comments on commit 3ae696e

Please sign in to comment.