Skip to content

Commit

Permalink
chore: fake ESMを純粋なESMに置き換え、commonjsとesmodule用にエクスポートするように (aiscript-…
Browse files Browse the repository at this point in the history
…dev#310)

* fake ESMからESMに置き換え

* 置き換え

* テストで純粋なesmoduleを読めるように

* autobindの代替を書いた

* package-lock.jsonを更新

* viteを更新
  • Loading branch information
ikasoba authored Aug 30, 2023
1 parent b6ca5fc commit 01f41a4
Show file tree
Hide file tree
Showing 25 changed files with 766 additions and 200 deletions.
2 changes: 1 addition & 1 deletion api-extractor.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",

"mainEntryPointFilePath": "<projectFolder>/built/index.d.ts",
"mainEntryPointFilePath": "<projectFolder>/built/dts/index.d.ts",

"bundledPackages": [],

Expand Down
4 changes: 2 additions & 2 deletions jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ module.exports = {
// resetModules: false,

// A path to a custom resolver
// resolver: undefined,
resolver: "ts-jest-resolver",

// Automatically restore mock state between every test
// restoreMocks: false,
Expand Down Expand Up @@ -208,5 +208,5 @@ module.exports = {
// watchPathIgnorePatterns: [],

// Whether to use watchman for file crawling
// watchman: true,
// watchman: true
};
31 changes: 19 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 15 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
{
"type": "module",
"name": "@syuilo/aiscript",
"version": "0.15.0",
"description": "AiScript implementation",
"author": "syuilo <[email protected]>",
"license": "MIT",
"repository": "https://github.com/syuilo/aiscript.git",
"bugs": "https://github.com/syuilo/aiscript/issues",
"main": "./built/index.js",
"types": "./built/index.d.ts",
"exports": {
".": {
"import": "./built/esm/index.js",
"require": "./built/cjs/index.js",
"types": "./built/dts/index.ts"
},
"./*": {
"import": "./built/esm/*",
"require": "./built/cjs/*",
"types": "./built/dts/*"
}
},
"scripts": {
"start": "node ./run",
"parse": "node ./parse",
"peg": "peggy --format es --cache -o src/parser/parser.js --allowed-start-rules Preprocess,Main src/parser/parser.peggy && npm run peg-copy",
"peg-debug": "peggy --trace --format es --cache -o src/parser/parser.js --allowed-start-rules Preprocess,Main src/parser/parser.peggy && npm run peg-copy",
"peg-copy": "copyfiles -f src/parser/parser.js built/parser/",
"build": "npm run peg && tsc",
"build": "npm run peg && tsc --outDir built/esm && tsc --module commonjs --outDir built/cjs && tsc --outDir built/dts --declaration true --emitDeclarationOnly true --declarationMap true",
"build-debug": "npm run peg-debug && tsc",
"api": "npx api-extractor run --local --verbose",
"api-prod": "npx api-extractor run --verbose",
Expand All @@ -38,12 +49,12 @@
"jest": "29.6.1",
"peggy": "3.0.2",
"ts-jest": "29.1.1",
"ts-jest-resolver": "2.0.1",
"ts-node": "10.9.1",
"tsd": "0.28.1",
"typescript": "5.1.6"
},
"dependencies": {
"autobind-decorator": "2.4.0",
"seedrandom": "3.0.5",
"stringz": "2.1.0",
"uuid": "9.0.0"
Expand Down
Loading

0 comments on commit 01f41a4

Please sign in to comment.