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

Revert "chore: configure for esm (#29)" #149

Merged
merged 1 commit into from
May 22, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
presets: [
"@babel/preset-react",
"@babel/preset-typescript",
[
"@babel/preset-env",
{
targets: {
browsers: [">0.25%", "not dead"],
},
},
],
],
plugins: [["transform-react-remove-prop-types", { removeImport: true }]],
};
15 changes: 0 additions & 15 deletions babel.config.json

This file was deleted.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"author": "freeCodeCamp <[email protected]>",
"license": "BSD-3-Clause",
"description": "The freeCodeCamp.org open-source UI components",
"type": "module",
"main": "dist/bundle.js",
"module": "dist/bundle.es.js",
"style": "dist/base.css",
Expand Down Expand Up @@ -42,7 +41,7 @@
"storybook": "storybook dev -p 6006 --no-open",
"storybook:theming": "pnpm run storybook --no-manager-cache",
"clean": "rm -rf dist/*",
"gen-component": "tsx ./utils/gen-component-script",
"gen-component": "ts-node ./utils/gen-component-script",
"test": "jest",
"prepare": "husky",
"typecheck": "tsc"
Expand Down
7 changes: 3 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
{
"compilerOptions": {
"module": "ES2022",
"module": "ES6",
"target": "ES6",
"sourceMap": true,
"jsx": "react",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"moduleResolution": "Bundler",
"moduleResolution": "node",
"strict": true,
"noEmit": true,
"skipLibCheck": true
},
"ts-node": {
"compilerOptions": {
"module": "commonjs",
"moduleResolution": "Node10" // Unfortunately we're stuck with this until Jest stops using ts-node
"module": "commonjs"
},
"transpileOnly": true
}
Expand Down
2 changes: 1 addition & 1 deletion utils/gen-component-script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const toKebabCase = (pascalCasedName: string) =>

const kebabCasedName = toKebabCase(name);

const dir = path.join(import.meta.dirname, `../src/${kebabCasedName}`);
const dir = path.join(__dirname, `../src/${kebabCasedName}`);

// Throw an error if the component's folder already exists
if (fs.existsSync(dir)) {
Expand Down