Skip to content

Commit

Permalink
fix: move CJS and ESM files to root of package
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards1211 committed Mar 19, 2024
1 parent a68193f commit 250d569
Show file tree
Hide file tree
Showing 31 changed files with 19,040 additions and 26,916 deletions.
7 changes: 7 additions & 0 deletions .babelrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* eslint-env node, es2018 */
module.exports = function (api) {
const base = require('@jcoreio/toolchain-esnext/.babelrc.cjs')(api)
return {
...base,
}
}
48 changes: 0 additions & 48 deletions .babelrc.js

This file was deleted.

46 changes: 23 additions & 23 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
version: 2
# created by @jcoreio/toolchain-circle

version: 2.1
jobs:
build:
branches:
ignore:
- gh-pages
docker:
- image: cimg/node:16.14.0
- image: cimg/node:20.3.0

steps:
- checkout

- run:
name: Setup NPM Token
command: |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
echo "registry=https://registry.npmjs.org/" >> ~/.npmrc
echo "strict-peer-dependencies=false" >> ~/.npmrc
# https://github.com/atlassian/react-beautiful-dnd/issues/1007#issuecomment-446415426
npm config set \
"//registry.npmjs.org/:_authToken=$NPM_TOKEN" \
"registry=https://registry.npmjs.org/"
- run:
name: Workaround for Flow crashing
command: echo "server.max_workers=1" >> .flowconfig
- run:
name: Install pnpm
command: sudo npm install --global pnpm
name: Corepack enable
command: sudo corepack enable
- run:
name: Install Dependencies
command: pnpm install --frozen-lockfile
- run:
name: build
command: pnpm prepublishOnly
- run:
name: upload test coverage
command: pnpm codecov
name: Prepublish
command: |
[[ $(netstat -tnlp | grep -F 'circleci-agent') ]] || pnpm run tc prepublish
- run:
name: release
command: pnpm semantic-release
name: Release
command: |
[[ $(netstat -tnlp | grep -F 'circleci-agent') ]] || pnpm run tc release
workflows:
build:
jobs:
- build:
context:
- npm-release
- github-release
37 changes: 0 additions & 37 deletions .eslintrc

This file was deleted.

8 changes: 8 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* eslint-env node, es2018 */
module.exports = {
extends: [require.resolve('@jcoreio/toolchain/eslint.config.cjs')],
env: {
'shared-node-browser': true,
es2017: true,
},
}
2 changes: 2 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
<PROJECT_ROOT>/node_modules/fbjs/.*
<PROJECT_ROOT>/node_modules/.*/config-chain/.*
<PROJECT_ROOT>/node_modules/.*/resolve/.*
<PROJECT_ROOT>/dist/.*
.*/malformed_package_json/.*

[include]
./src
Expand Down
23 changes: 4 additions & 19 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
/coverage
/.nyc_output
/node_modules
/lib
/es
.eslintcache
*.js
*.flow
*.ts
!/scripts/**/*.ts
!/src/**/*.ts
!/src/**/*.tsx
!/src/**/*.flow
!/test/**/*.js
!/test/**/*.ts
!/test/**/*.tsx
!/demo/**/*.js
!/.babelrc.js
/dist
/demo-dist
.idea
.nyc_output
node_modules
/coverage
5 changes: 5 additions & 0 deletions .mocharc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* eslint-env node, es2018 */
const base = require('@jcoreio/toolchain-mocha/.mocharc.cjs')
module.exports = {
...base,
}
15 changes: 0 additions & 15 deletions .npmignore

This file was deleted.

5 changes: 0 additions & 5 deletions .prettierrc

This file was deleted.

13 changes: 13 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "test:debug <file>",
"port": 9229,
"request": "attach",
"skipFiles": ["<node_internals>/**"],
"type": "node",
"preLaunchTask": "test:debug <file>"
}
]
}
59 changes: 59 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"options": {
"shell": {
"executable": "bash",
"args": ["-c", "-l"]
}
},
"command": "pnpm",
"isBackground": false,
"group": "test",
"presentation": {
"panel": "dedicated",
"clear": true
},
"label": "test <file>",
"args": ["tc", "test", "${file}"]
},
{
"type": "shell",
"options": {
"shell": {
"executable": "bash",
"args": ["-c", "-l"]
}
},
"command": "pnpm",
"isBackground": false,
"group": "test",
"presentation": {
"panel": "dedicated",
"clear": true
},
"label": "test:watch <file>",
"args": ["tc", "test", "--watch", "${file}"]
},
{
"type": "shell",
"options": {
"shell": {
"executable": "bash",
"args": ["-c", "-l"]
}
},
"command": "pnpm",
"isBackground": false,
"group": "test",
"presentation": {
"panel": "dedicated",
"clear": true
},
"label": "test:debug <file>",
"args": ["tc", "test", "-n", "inspect-brk", "${file}"]
}
]
}
45 changes: 24 additions & 21 deletions demo/index.html
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
<!doctype html>
<!DOCTYPE html>

<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>material-ui-popup-state</title>
<style type="text/css">
body {
background-color: #fafafa;
}
.loading {
position: absolute;
text-align: center;
width: 100%;
top: 10%;
}
</style>
</head>
<body>
<div id="root"><h1 class="loading">Loading...</h1></div>
<script src="bundle.js"></script>
</body>
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
/>
<title>material-ui-popup-state</title>
<style type="text/css">
body {
background-color: #fafafa;
}
.loading {
position: absolute;
text-align: center;
width: 100%;
top: 10%;
}
</style>
</head>
<body>
<div id="root"><h1 class="loading">Loading...</h1></div>
<script src="bundle.js"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion demo/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const prod = 'production' === process.env.NODE_ENV

module.exports = {
mode: prod ? 'production' : 'development',
entry: ['@babel/polyfill', path.resolve(__dirname, 'index.js')],
entry: ['core-js/stable', path.resolve(__dirname, 'index.js')],
output: {
path: path.resolve(__dirname, '..', 'demo-dist'),
filename: 'bundle.js',
Expand Down
3 changes: 2 additions & 1 deletion flow-typed/npm/@babel/polyfill_v7.x.x.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// flow-typed signature: 70ae65c95b3420e3469c9c30171c1835
// flow-typed version: c6154227d1/@babel/polyfill_v7.x.x/flow_>=v0.104.x

declare module '@babel/polyfill' {}
declare module '@babel/polyfill' {
}
Loading

0 comments on commit 250d569

Please sign in to comment.