Skip to content

Commit

Permalink
fix: use tsc instead of parcel
Browse files Browse the repository at this point in the history
Fixes JSON import problem
  • Loading branch information
JulianCataldo committed Sep 1, 2022
1 parent 1c5ffc1 commit 7c9b9af
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 1,428 deletions.
6 changes: 3 additions & 3 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* See LICENSE in the project root. *
/* —————————————————————————————————————————————————————————————————————————— */

// FIXME: `assert { type: 'json' }` is stripped out by Parcel!
import abbrs from 'case-police/dict/abbreviates.json' assert { type: 'json' };
import brands from 'case-police/dict/brands.json' assert { type: 'json' };
import general from 'case-police/dict/general.json' assert { type: 'json' };
Expand All @@ -15,7 +14,7 @@ import { search } from 'nlcst-search';
import type { Root } from 'nlcst-search';
import { toString } from 'nlcst-to-string';
/* ·········································································· */
import { homepage } from './package.json' assert { type: 'json' };
import * as packageJson from './package.json' assert { type: 'json' };
/* —————————————————————————————————————————————————————————————————————————— */

export type Dict = Record<string, string>;
Expand Down Expand Up @@ -50,10 +49,11 @@ const retextCasePolice: Plugin<[Settings], Root> =
nodes[0].children[0],
`retext-case-police:${expected}`,
);
// `ruleId` and `expected` seems redundant with `origin`, should do visual tests with IDE, CLI, Monaco, etc.
msg.ruleId = 'retext-case-police';
msg.actual = actual;
msg.expected = [expected];
msg.url = homepage;
msg.url = packageJson.homepage;
}
}
});
Expand Down
14 changes: 4 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"description": "A `retext` plugin for checking popular names casing.",
"type": "module",
"source": "./index.ts",
"main": "./dist/lib.js",
"types": "./dist/lib.d.ts",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
"dev": "pnpm parcel watch",
"build": "pnpm parcel build",
"dev": "pnpm tsc -w",
"build": "pnpm tsc",
"release": "semantic-release"
},
"dependencies": {
Expand All @@ -18,11 +18,6 @@
},
"devDependencies": {
"@julian_cataldo/astro-configs": "0.16.1",
"@parcel/core": "2.7.0",
"@parcel/packager-ts": "2.7.0",
"@parcel/transformer-js": "2.7.0",
"@parcel/transformer-react-refresh-wrap": "2.7.0",
"@parcel/transformer-typescript-types": "2.7.0",
"@semantic-release/changelog": "6.0.1",
"@semantic-release/git": "10.0.1",
"@semantic-release/github": "8.0.5",
Expand All @@ -41,7 +36,6 @@
"eslint-plugin-import": "2.26.0",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-tsdoc": "0.2.16",
"parcel": "2.7.0",
"prettier": "2.7.1",
"remark": "14.0.2",
"remark-cli": "11.0.0",
Expand Down
Loading

0 comments on commit 7c9b9af

Please sign in to comment.