@stanlemon/webdev 0.1.40 → 0.1.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/jest.config.js CHANGED
@@ -8,6 +8,16 @@ const babelOptions = JSON.parse(
8
8
 
9
9
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
10
10
 
11
+ // These are packages we know ship with esmodules and need to be transformed
12
+ const esModules = [
13
+ "uuid",
14
+ "lowdb",
15
+ "steno",
16
+ "lodash-es",
17
+ "@stanlemon/server",
18
+ "@stanlemon/server-with-auth",
19
+ ].join("|");
20
+
11
21
  export default {
12
22
  verbose: true,
13
23
  setupFilesAfterEnv: [path.resolve(__dirname, "./jest.setup.js")],
@@ -15,8 +25,8 @@ export default {
15
25
  transform: {
16
26
  "^.+\\.(js|jsx|ts|tsx)?$": ["babel-jest", babelOptions],
17
27
  },
18
- // Some packages do not need to be transformed, we'll compile those as we go.
19
- transformIgnorePatterns: ["node_modules/((?!uuid))"],
28
+ // Ignore transforms for node_modules, except...
29
+ transformIgnorePatterns: [`/node_modules/(?!${esModules})`],
20
30
  moduleFileExtensions: ["js", "jsx", "ts", "tsx"],
21
31
  moduleNameMapper: {
22
32
  "\\.(css|less|sass|scss)$": "identity-obj-proxy",
package/jest.setup.js CHANGED
@@ -4,7 +4,7 @@ const { Crypto } = require("@peculiar/webcrypto");
4
4
 
5
5
  global.crypto = new Crypto();
6
6
 
7
- if (!window.setImmediate) {
7
+ if (!global.setImmediate) {
8
8
  // This is as gross as it looks. It's a workaround for using PouchDB in tests.
9
- window.setImmediate = window.setTimeout; // ts: as unknown as typeof setImmediate;
9
+ global.setImmediate = global.setTimeout; // ts: as unknown as typeof setImmediate;
10
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stanlemon/webdev",
3
- "version": "0.1.40",
3
+ "version": "0.1.42",
4
4
  "description": "My typical web development setup, but without all the copy and paste.",
5
5
  "keywords": [
6
6
  "webpack",