Skip to content

Commit 0245b72

Browse files
authored
Merge branch 'main' into fix-derived-recompute-not-changing
2 parents a488c0a + 5ff8f63 commit 0245b72

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
"test:lint": "eslint .",
8282
"test:spec": "vitest run",
8383
"test-build:spec": "vitest run",
84-
"patch-d-ts": "node -e \"var {entries}=require('./rollup.config.js');require('shelljs').find('dist/**/*.d.ts').forEach(f=>{entries.forEach(({find,replacement})=>require('shelljs').sed('-i',new RegExp(' from \\''+find.source.slice(0,-1)+'\\';$'),' from \\''+replacement+'\\';',f));require('shelljs').sed('-i',/ from '(\\.[^']+)\\.ts';$/,' from \\'\\$1\\';',f)})\"",
84+
"patch-d-ts": "node --input-type=module -e \"import { entries } from './rollup.config.mjs'; import shelljs from 'shelljs'; const { find, sed } = shelljs; find('dist/**/*.d.ts').forEach(f => { entries.forEach(({ find, replacement }) => sed('-i', new RegExp(' from \\'' + find.source.slice(0, -1) + '\\';$'), ' from \\'' + replacement + '\\';', f)); sed('-i', / from '(\\.[^']+)\\.ts';$/, ' from \\'\\$1\\';', f); });\"",
8585
"copy": "shx cp -r dist/src/* dist/esm && shx cp -r dist/src/* dist && shx rm -rf dist/src && shx rm -rf dist/{src,tests} && downlevel-dts dist dist/ts3.8 --to=3.8 && shx cp package.json readme.md LICENSE dist && json -I -f dist/package.json -e \"this.private=false; this.devDependencies=undefined; this.optionalDependencies=undefined; this.scripts=undefined; this.prettier=undefined;\"",
8686
"patch-ts3.8": "node -e \"require('shelljs').find('dist/ts3.8/**/*.d.ts').forEach(f=>require('fs').appendFileSync(f,'declare type Awaited<T> = T extends Promise<infer V> ? V : T;'))\"",
8787
"patch-old-ts": "shx touch dist/ts_version_3.8_and_above_is_required.d.ts",

rollup.config.js renamed to rollup.config.mjs

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
/* eslint-disable no-undef */
2-
const path = require('path')
3-
const alias = require('@rollup/plugin-alias')
4-
const babelPlugin = require('@rollup/plugin-babel')
5-
const resolve = require('@rollup/plugin-node-resolve')
6-
const replace = require('@rollup/plugin-replace')
7-
const terser = require('@rollup/plugin-terser')
8-
const typescript = require('@rollup/plugin-typescript')
9-
const banner2 = require('rollup-plugin-banner2')
10-
const { default: esbuild } = require('rollup-plugin-esbuild')
11-
const createBabelConfig = require('./babel.config.js')
2+
import path from 'path'
3+
import alias from '@rollup/plugin-alias'
4+
import babelPlugin from '@rollup/plugin-babel'
5+
import resolve from '@rollup/plugin-node-resolve'
6+
import replace from '@rollup/plugin-replace'
7+
import terser from '@rollup/plugin-terser'
8+
import typescript from '@rollup/plugin-typescript'
9+
import banner2 from 'rollup-plugin-banner2'
10+
import esbuild from 'rollup-plugin-esbuild'
11+
import createBabelConfig from './babel.config.js'
1212

1313
const extensions = ['.js', '.ts', '.tsx']
1414
const { root } = path.parse(process.cwd())
15-
const entries = [
15+
export const entries = [
1616
{ find: /.*\/vanilla\/utils\.ts$/, replacement: 'jotai/vanilla/utils' },
1717
{ find: /.*\/react\/utils\.ts$/, replacement: 'jotai/react/utils' },
1818
{ find: /.*\/vanilla\.ts$/, replacement: 'jotai/vanilla' },
@@ -165,7 +165,7 @@ function createSystemConfig(input, output, env, clientOnly) {
165165
}
166166
}
167167

168-
module.exports = function (args) {
168+
export default function (args) {
169169
let c = Object.keys(args).find((key) => key.startsWith('config-'))
170170
const clientOnly = Object.keys(args).some((key) => key === 'client-only')
171171
if (c) {
@@ -193,5 +193,3 @@ module.exports = function (args) {
193193
),
194194
]
195195
}
196-
197-
module.exports.entries = entries

0 commit comments

Comments
 (0)