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

build: Switch from CJS to ESM #1160

Merged
merged 10 commits into from
Dec 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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