Skip to content

Commit 77e63d5

Browse files
authored
feat!: Refactor as TypeScript, export ES module build only (#41)
* Replace Rollup with Rolldown * Update make-plural and mark it as a runtime dependency
1 parent 8cfebf7 commit 77e63d5

23 files changed

Lines changed: 587 additions & 2637 deletions

.github/vitest.browserstack.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export default defineConfig({
5656
})
5757
}
5858
]
59-
}
59+
},
60+
exclude: ['test262/']
6061
}
6162
})

babel.config.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

examples/README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ git clone https://github.com/eemeli/intl-pluralrules.git
55

66
cd intl-pluralrules
77
npm install # The examples use make-plural from the root
8-
npm run build # The examples use ../.. paths
98

109
cd examples
1110
npm run build
@@ -14,7 +13,7 @@ open index.html
1413

1514
gzip -k dist/*js
1615
stat -f "%z %N" dist/*gz
17-
# 1339 dist/factory.js.gz
18-
# 5221 dist/polyfill.js.gz
19-
# 5091 dist/ponyfill.js.gz
16+
# 1473 dist/factory.js.gz
17+
# 7289 dist/polyfill.js.gz
18+
# 7165 dist/ponyfill.js.gz
2019
```

examples/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
"author": "Eemeli Aro <eemeli@gmail.com>",
55
"license": "ISC",
66
"private": true,
7+
"type": "module",
78
"scripts": {
8-
"build": "../node_modules/.bin/rollup -c",
9+
"build": "rolldown -c",
910
"test": "sh test.sh"
1011
}
1112
}

examples/rolldown.config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/** @type {import('rolldown').RolldownOptions[]} */
2+
export default [
3+
{
4+
input: 'src/factory.js',
5+
output: { file: 'dist/factory.js', format: 'iife', minify: true }
6+
},
7+
{
8+
input: 'src/polyfill.js',
9+
output: { file: 'dist/polyfill.js', format: 'iife', minify: true }
10+
},
11+
{
12+
input: 'src/ponyfill.js',
13+
output: { file: 'dist/ponyfill.js', format: 'iife', minify: true }
14+
}
15+
]

examples/rollup.config.js

Lines changed: 0 additions & 21 deletions
This file was deleted.

examples/src/factory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import { en, fr } from 'make-plural/cardinals'
77
import { en as enCat, fr as frCat } from 'make-plural/pluralCategories'
88
import { en as enRange, fr as frRange } from 'make-plural/ranges'
9-
import getPluralRules from '../../factory'
9+
import getPluralRules from '../../src/factory.ts'
1010

1111
const sel = { en, fr }
1212
const getSelector = lc => sel[lc]

examples/src/polyfill.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// The simplest usage pattern. The right thing in most cases.
22

3-
import '../../polyfill'
3+
import '../../src/polyfill.ts'
44

55
const one = new Intl.PluralRules('en').select(1)
66
const other = new Intl.PluralRules('en', {

examples/src/ponyfill.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// About as simple as the polyfill, but without the global namespace pollution.
22

3-
import PluralRules from '../../plural-rules'
3+
import PluralRules from '../../src/plural-rules.ts'
44

55
const one = new PluralRules('en').select(1)
66
const other = new PluralRules('en', { minimumSignificantDigits: 3 }).select(1)

factory.d.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)