Skip to content

Commit

Permalink
fix(esm): switched to type module while CJS + Bundle can still be dir…
Browse files Browse the repository at this point in the history
…ectly accessed via dist folder
  • Loading branch information
KaiSchwarz-cnic committed Mar 10, 2023
1 parent 55d2db5 commit c3e1064
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 7 deletions.
59 changes: 58 additions & 1 deletion package-lock.json

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

13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"description": "A UTS #46 processing algorithm for IDNA2008 strings",
"version": "5.0.4",
"private": false,
"main": "dist/index.cjs",
"type": "module",
"main": "dist/index.mjs",
"typings": "dist/index.d.ts",
"license": "MIT",
"sideEffects": false,
Expand Down Expand Up @@ -39,9 +40,9 @@
"test:coverage": "cross-env NODE_ENV=development nyc npm run test --silent",
"lint": "eslint .",
"prepare": "npm run build && npx lint-staged",
"build:unicode-upgrade": "esr scripts/unicode-upgrade.ts",
"build:unicode-checkversion": "esr scripts/unicode-checkversion.ts",
"build:unicode-tables": "esr scripts/build-unicode-tables.ts 15.0.0",
"build:unicode-upgrade": "tsx scripts/unicode-upgrade.ts",
"build:unicode-checkversion": "tsx scripts/unicode-checkversion.ts",
"build:unicode-tables": "tsx scripts/build-unicode-tables.ts 15.0.0",
"build:rollup": "rollup -c rollup-esm.config.mjs"
},
"dependencies": {
Expand All @@ -56,7 +57,6 @@
"axios": "^1.3.4",
"cross-env": "^7.0.3",
"esbuild": "^0.17.11",
"esbuild-runner": "^2.2.1",
"eslint": "^8.35.0",
"eslint-plugin-mocha": "^10.1.0",
"lint-staged": "^13.0.0",
Expand All @@ -66,7 +66,8 @@
"rollup": "^3.18.0",
"rollup-plugin-bundle-size": "^1.0.3",
"semantic-release": "^20.1.1",
"ts-node": "^10.8.1"
"ts-node": "^10.8.1",
"tsx": "^3.12.3"
},
"lint-staged": {
"*": "prettier -u --write"
Expand Down
4 changes: 4 additions & 0 deletions scripts/build-unicode-tables.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import axios from 'axios';
import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
import {
compressblockIndexes,
stringifyBlocks,
} from './stringify-compress-array';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const IDNA_MAP_OUTPUT_PATH = path.join(__dirname, '..', 'src', 'idna-map.js');
async function downloadUnicode(version: string) {
console.log('Resource Files from www.unicode.org ...');
Expand Down

0 comments on commit c3e1064

Please sign in to comment.