Skip to content

Commit

Permalink
Revert "Fix mismatched types between entrypoint and pure modules (#565)"
Browse files Browse the repository at this point in the history
This reverts commit 0230bbd.
  • Loading branch information
fruchtose-stripe committed Mar 14, 2024
1 parent d9f8d77 commit 93ccb2f
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 46 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ node_modules
dist
*.log
.vim
.vscode/
.vscode/
pure
1 change: 0 additions & 1 deletion lib/index.d.mts

This file was deleted.

1 change: 0 additions & 1 deletion lib/index.d.ts

This file was deleted.

2 changes: 0 additions & 2 deletions lib/index.js

This file was deleted.

1 change: 0 additions & 1 deletion lib/index.mjs

This file was deleted.

19 changes: 9 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@
"version": "3.0.9",
"description": "Stripe.js loading utility",
"repository": "github:stripe/stripe-js",
"main": "lib/index.js",
"module": "lib/index.mjs",
"jsnext:main": "lib/index.mjs",
"types": "lib/index.d.ts",
"typings": "lib/index.d.ts",
"main": "dist/stripe.js",
"module": "dist/stripe.mjs",
"jsnext:main": "dist/stripe.mjs",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"scripts": {
"test": "yarn lint && yarn test:unit && yarn test:types && yarn typecheck",
"test:unit": "jest",
"test:types": "zx ./tests/types/scripts/test.mjs",
"lint": "eslint '{src,types}/**/*.{ts,js}' && yarn prettier-check",
"typecheck": "tsc",
"copy-types": "./scripts/copy-types",
"build": "yarn clean && yarn rollup -c && yarn copy-types",
"build": "yarn clean && yarn rollup -c",
"clean": "rimraf dist",
"prepublishOnly": "echo \"\nPlease use ./scripts/publish instead\n\" && exit 1",
"prettier": "prettier './**/*.{js,ts,md,html,css}' --write",
Expand All @@ -31,9 +30,8 @@
"homepage": "https://stripe.com/docs/js",
"files": [
"dist",
"lib",
"pure",
"src"
"src",
"pure"
],
"engines": {
"node": ">=12.16"
Expand All @@ -58,6 +56,7 @@
"rimraf": "^2.6.2",
"rollup": "^1.29.0",
"rollup-plugin-babel": "^4.3.3",
"rollup-plugin-dts": "^6.1.0",
"rollup-plugin-typescript2": "^0.25.3",
"ts-jest": "^24.3.0",
"typescript": "^4.1.2",
Expand Down
1 change: 0 additions & 1 deletion pure/index.d.mts

This file was deleted.

1 change: 0 additions & 1 deletion pure/index.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion pure/index.js

This file was deleted.

1 change: 0 additions & 1 deletion pure/index.mjs

This file was deleted.

25 changes: 21 additions & 4 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import babel from 'rollup-plugin-babel';
import ts from 'rollup-plugin-typescript2';
import {dts} from 'rollup-plugin-dts';
import replace from '@rollup/plugin-replace';

import pkg from './package.json';
Expand All @@ -20,17 +21,33 @@ export default [
{
input: 'src/index.ts',
output: [
{file: 'dist/index.js', format: 'cjs'},
{file: 'dist/index.mjs', format: 'es'},
{file: pkg.main, format: 'cjs'},
{file: pkg.module, format: 'es'},
],
plugins: PLUGINS,
},
{
input: 'types/index.d.ts',
output: [
{file: './dist/index.d.ts', format: 'cjs'},
{file: './dist/index.d.mts', format: 'es'},
],
plugins: [dts()],
},
{
input: 'src/pure.ts',
output: [
{file: 'dist/pure.js', format: 'cjs'},
{file: 'dist/pure.mjs', format: 'es'},
{file: 'pure/index.js', format: 'cjs'},
{file: 'pure/index.mjs', format: 'es'},
],
plugins: PLUGINS,
},
{
input: 'types/pure.d.ts',
output: [
{file: './pure/index.d.ts', format: 'cjs'},
{file: './pure/index.d.mts', format: 'es'},
],
plugins: [dts()],
},
];
21 changes: 0 additions & 21 deletions scripts/copy-types

This file was deleted.

18 changes: 17 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1050,7 +1050,7 @@
resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72"
integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==

"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14":
"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14", "@jridgewell/sourcemap-codec@^1.4.15":
version "1.4.15"
resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32"
integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==
Expand Down Expand Up @@ -3774,6 +3774,13 @@ magic-string@^0.25.5:
dependencies:
sourcemap-codec "^1.4.4"

magic-string@^0.30.4:
version "0.30.7"
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.7.tgz#0cecd0527d473298679da95a2d7aeb8c64048505"
integrity sha512-8vBuFF/I/+OSLRmdf2wwFCJCz+nSn0m6DPvGH1fS/KiQoSaR+sETbov0eIk9KhEKy8CYqIkIAnbohxT/4H0kuA==
dependencies:
"@jridgewell/sourcemap-codec" "^1.4.15"

make-dir@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5"
Expand Down Expand Up @@ -4661,6 +4668,15 @@ rollup-plugin-babel@^4.3.3:
"@babel/helper-module-imports" "^7.0.0"
rollup-pluginutils "^2.8.1"

rollup-plugin-dts@^6.1.0:
version "6.1.0"
resolved "https://registry.yarnpkg.com/rollup-plugin-dts/-/rollup-plugin-dts-6.1.0.tgz#56e9c5548dac717213c6a4aa9df523faf04f75ae"
integrity sha512-ijSCPICkRMDKDLBK9torss07+8dl9UpY9z1N/zTeA1cIqdzMlpkV3MOOC7zukyvQfDyxa1s3Dl2+DeiP/G6DOw==
dependencies:
magic-string "^0.30.4"
optionalDependencies:
"@babel/code-frame" "^7.22.13"

rollup-plugin-typescript2@^0.25.3:
version "0.25.3"
resolved "https://registry.yarnpkg.com/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.25.3.tgz#a5fb2f0f85488789334ce540abe6c7011cbdf40f"
Expand Down

0 comments on commit 93ccb2f

Please sign in to comment.