Skip to content

Commit

Permalink
chore: esm only boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
YvesRijckaert committed Oct 27, 2023
1 parent ad55bf2 commit 1e6cdb6
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 26 deletions.
File renamed without changes.
10 changes: 4 additions & 6 deletions packages/boolean/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
/* eslint-disable */
import baseConfig from '../../baseESMJestConfig.js';
import packageJSON from './package.json' assert { type: 'json' };

const baseConfig = require('../../baseJestConfig');
const packageName = packageJSON.name.split('@contentful/')[1];

const package = require('./package.json');
const packageName = package.name.split('@contentful/')[1];

module.exports = {
export default {
...baseConfig(packageName),
};
18 changes: 4 additions & 14 deletions packages/boolean/package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
{
"name": "@contentful/field-editor-boolean",
"version": "1.4.2",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"type": "module",
"main": "dist/index.js",
"types": "dist/types/index.d.ts",
"exports": {
".": {
"types": "./dist/types/index.d.ts",
"require": "./dist/cjs/index.js",
"default": "./dist/cjs/index.js"
},
"./package.json": "./package.json"
},
"files": [
"dist"
],
Expand All @@ -23,15 +15,13 @@
},
"scripts": {
"watch": "yarn concurrently \"yarn:watch:*\"",
"watch:cjs": "yarn build:cjs -w",
"watch:esm": "yarn build:esm -w",
"watch:types": "yarn build:types --watch",
"build": "yarn build:types && yarn build:cjs && yarn build:esm",
"build": "yarn build:types && yarn build:esm",
"build:types": "tsc --outDir dist/types --emitDeclarationOnly",
"build:cjs": "swc src --config-file ../../.swcrc -d dist/cjs -C module.type=commonjs",
"build:esm": "swc src --config-file ../../.swcrc -d dist/esm",
"test": "jest --watch",
"test:ci": "jest --ci",
"test:ci": "yarn node --experimental-vm-modules $(yarn bin jest --ci)",
"tsc": "tsc -p ./ --noEmit"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/boolean/src/Boolean.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { createFakeFieldAPI } from '@contentful/field-editor-test-utils';
import '@testing-library/jest-dom/extend-expect';
import { cleanup, configure, fireEvent, render } from '@testing-library/react';

import { BooleanEditor } from './BooleanEditor';
import { BooleanEditor } from './BooleanEditor.js';

configure({
testIdAttribute: 'data-test-id',
Expand Down
2 changes: 1 addition & 1 deletion packages/boolean/src/BooleanEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';

import { TextLink, Flex, Radio } from '@contentful/f36-components';
import { FieldAPI, ParametersAPI, FieldConnector } from '@contentful/field-editor-shared';
import get from 'lodash/get';
import get from 'lodash-es/get.js';
import { nanoid } from 'nanoid';

export interface BooleanEditorProps {
Expand Down
2 changes: 1 addition & 1 deletion packages/boolean/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { BooleanEditor } from './BooleanEditor';
export { BooleanEditor } from './BooleanEditor.js';
5 changes: 2 additions & 3 deletions packages/boolean/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
"extends": "../../tsconfig.json",
"include": ["src", "types"],
"compilerOptions": {
"module": "esnext",
"moduleResolution": "bundler",
"moduleResolution": "bundler",
"module": "Node16",
"moduleResolution": "Node16",
"lib": ["dom", "esnext"],
"rootDir": "./src",
"baseUrl": "./",
Expand Down

0 comments on commit 1e6cdb6

Please sign in to comment.