You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
⚠️ BREAKING CHANGES (if using lint rules):
- Transition from deprecated `@babel/plugin-syntax-import-assertions`
to the new `@babel/plugin-syntax-import-attributes` and enable option
`deprecatedAssertSyntax` for backward compatibility with import
assertions. Since this is a peer dependency, consumers must switch
plugins to match.
🌎 External changes:
- Export JavaScript configuration as `configuration/javascript`.
- Export TypeScript configuration as `configuration/typescript` now that
microsoft/TypeScript#48665 has been fixed.
- Update README with instructions on how to consume Babel, ESLint,
JavaScript, rollup.js, and TypeScript configurations.
🏠 Internal changes:
- Clean up `package.json` scripts and remove `engines` field.
🧹 Chores:
- Upgrade dependencies.
`configure()` returns a configuration object which:
65
+
- Reads entry points from `package.json`'s `exports` field (no conditionals, null targets, or patterns).
66
+
- Writes distributable output to `DIST_PATH`, mirroring the directory structure of `BUILD_PATH`.
67
+
- Writes CommonJS modules to `.cjs` files and ES modules to `.js` files.
68
+
- Excludes Jest directories `__mocks__`, `__tests__` from the output.
69
+
- Copies Sass stylesheets (`.scss`) from `SRC_PATH` to `DIST_PATH`.
70
+
- Copies TypeScript type declarations (`.d.ts`) from `BUILD_PATH` to `DIST_PATH`, giving them a `.d.ts` extension for ECMAScript and a `.d.cts` extension for CommonJS.
71
+
72
+
The following environment variables must be set at runtime:
73
+
74
+
-`BUILD_PATH`: Where Babel and `tsc` write their `.js` and `.d.ts` files.
75
+
-`DIST_PATH`: Where rollup.js is to write its distributable output.
76
+
-`FORMAT`: Type of modules to output; either _'es'_ (ES) or _'cjs'_ (CommonJS).
77
+
-`SRC_PATH`: Where the original source code is located.
78
+
79
+
### TypeScript
80
+
81
+
📍 `jsconfig.json`
82
+
83
+
```json
84
+
{
85
+
"extends": "bitumen/configuration/javascript"
86
+
}
87
+
```
88
+
89
+
📍 `tsconfig.json`
90
+
91
+
```json
92
+
{
93
+
"extends": "bitumen/configuration/typescript",
94
+
// `exclude`, `files`, and `include` paths must be set locally;
95
+
// see https://github.com/microsoft/TypeScript/issues/45050
96
+
"include": ["./src/"]
97
+
}
98
+
```
99
+
100
+
## Library
19
101
20
102
`bitumen` exposes named exports from the following entry points:
21
103
22
104
-`collections`
23
-
-`configuration`
24
105
-`mixins`
25
106
-`types`
26
107
-`utils`
27
108
28
-
For example, to implement the `SortedSet`class from the `collections` entry point:
109
+
For example, to implement `SortedSet` from `collections`:
29
110
```js
30
111
import {SortedSet} from'bitumen/collections';
31
112
@@ -34,12 +115,9 @@ const set = new SortedSet();
34
115
35
116
# Type Declarations
36
117
37
-
TypeScript type declarations are included to aid in writing type-safe code—even in JavaScript projects. 🚀
118
+
For proper module and type resolution, use the following project settings:
38
119
39
-
## Importing in Visual Studio Code
40
-
41
-
### JavaScript Projects
42
-
📍 `jsconfig.json` (create as needed)
120
+
📍 `jsconfig.json`
43
121
```jsonc
44
122
{
45
123
"compilerOptions": {
@@ -50,7 +128,6 @@ TypeScript type declarations are included to aid in writing type-safe code—eve
50
128
}
51
129
```
52
130
53
-
### TypeScript Projects
54
131
📍 `tsconfig.json`
55
132
```jsonc
56
133
{
@@ -59,3 +136,5 @@ TypeScript type declarations are included to aid in writing type-safe code—eve
59
136
}
60
137
}
61
138
```
139
+
140
+
💡 `bitumen`'s [JavaScript and TypeScript configurations](#typescript) are already set up this way.
0 commit comments