@girs/grlnet-0.3 0.3.0-3.2.4 → 0.3.0-3.2.6

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/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  ![downloads/week](https://img.shields.io/npm/dw/@girs/grlnet-0.3)
6
6
 
7
7
 
8
- GJS TypeScript type definitions for GrlNet-0.3, generated from library version 0.3.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v3.2.4.
8
+ GJS TypeScript type definitions for GrlNet-0.3, generated from library version 0.3.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v3.2.6.
9
9
 
10
10
  Network classes for Grilo
11
11
 
@@ -82,6 +82,19 @@ Now you have also type support for this, too:
82
82
  const GrlNet = imports.gi.GrlNet;
83
83
  ```
84
84
 
85
+
86
+ ### ESM vs. CommonJS
87
+
88
+ GJS supports two different import syntaxes. The new modern ESM syntax and the old global imports syntax.
89
+
90
+ In TypeScript projects for GJS and GNOME Shell extensions, you have the flexibility to use `ESM` syntax and then decide the import syntax for your bundled file. If your bundler is configured to use `CommonJS`, it will convert to the GJS-specific global imports syntax, like `const moduleName = imports.gi[moduleName]`. This is different from the traditional `require` syntax seen in Node.js. The global imports syntax is chosen because it aligns with the CommonJS format supported by NPM, which is used for the generated type definitions and this package.
91
+
92
+ On the other hand, if you configure your bundler to use ESM, it will retain the ESM import syntax. It's crucial to ensure that your bundler is set up to correctly translate and bundle these imports into either CommonJS or ESM format, depending on your project's requirements.
93
+
94
+ This approach is particularly important due to the `@girs` types, which include both `*.cjs `files, using the GJS global imports syntax, and `*.js` files, which utilize the ESM syntax. By appropriately setting up your bundler, you can control which syntax—CommonJS or ESM—is used in your project. The choice of CommonJS in this context is also due to the similarity between the GJS-specific global imports and CommonJS syntax, allowing for easier management and bundling in these specific types of projects.
95
+
96
+ Since GNOME Shell 45, you should only use ESM, even for GNOME Shell extensions. Before that, extensions had to use the global import syntax, unlike normal GJS applications, where ESM has been available for some time.
97
+
85
98
  ### Bundle
86
99
 
87
100
  Depending on your project configuration, it is recommended to use a bundler like [esbuild](https://esbuild.github.io/). You can find examples using different bundlers [here](https://github.com/gjsify/ts-for-gir/tree/main/examples).
@@ -1,9 +1,12 @@
1
1
 
2
-
3
2
  declare module 'gi://GrlNet?version=0.3' {
4
3
  import GrlNet03 from '@girs/grlnet-0.3';
5
4
  export default GrlNet03;
6
5
  }
7
6
 
7
+ declare module 'gi://GrlNet' {
8
+ import GrlNet03 from '@girs/grlnet-0.3';
9
+ export default GrlNet03;
10
+ }
8
11
 
9
12
 
@@ -1,5 +1,4 @@
1
1
 
2
-
3
2
  import GrlNet03 from '@girs/grlnet-0.3';
4
3
 
5
4
  declare global {
package/grlnet-0.3.d.cts CHANGED
@@ -76,6 +76,8 @@ export module Wc {
76
76
  loglevel?: number | null
77
77
  throttling?: number | null
78
78
  user_agent?: string | null
79
+ cacheSize?: number | null
80
+ userAgent?: string | null
79
81
  }
80
82
 
81
83
  }
@@ -86,9 +88,11 @@ export interface Wc {
86
88
 
87
89
  cache: boolean
88
90
  cache_size: number
91
+ cacheSize: number
89
92
  loglevel: number
90
93
  throttling: number
91
94
  user_agent: string | null
95
+ userAgent: string | null
92
96
 
93
97
  // Owm methods of GrlNet-0.3.GrlNet.Wc
94
98
 
package/grlnet-0.3.d.ts CHANGED
@@ -78,6 +78,8 @@ module Wc {
78
78
  loglevel?: number | null
79
79
  throttling?: number | null
80
80
  user_agent?: string | null
81
+ cacheSize?: number | null
82
+ userAgent?: string | null
81
83
  }
82
84
 
83
85
  }
@@ -88,9 +90,11 @@ interface Wc {
88
90
 
89
91
  cache: boolean
90
92
  cache_size: number
93
+ cacheSize: number
91
94
  loglevel: number
92
95
  throttling: number
93
96
  user_agent: string | null
97
+ userAgent: string | null
94
98
 
95
99
  // Owm methods of GrlNet-0.3.GrlNet.Wc
96
100
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@girs/grlnet-0.3",
3
- "version": "0.3.0-3.2.4",
3
+ "version": "0.3.0-3.2.6",
4
4
  "description": "GJS TypeScript type definitions for GrlNet-0.3, generated from library version 0.3.0",
5
5
  "type": "module",
6
6
  "module": "grlnet-0.3.js",
@@ -25,11 +25,11 @@
25
25
  "test:cjs": "NODE_OPTIONS=--max_old_space_size=9216 tsc --noEmit grlnet-0.3.d.cts"
26
26
  },
27
27
  "dependencies": {
28
- "@girs/gio-2.0": "^2.78.0-3.2.4",
29
- "@girs/gjs": "^3.2.4",
30
- "@girs/glib-2.0": "^2.78.0-3.2.4",
31
- "@girs/gobject-2.0": "^2.78.0-3.2.4",
32
- "@girs/soup-3.0": "^3.4.4-3.2.4"
28
+ "@girs/gio-2.0": "^2.78.0-3.2.6",
29
+ "@girs/gjs": "^3.2.6",
30
+ "@girs/glib-2.0": "^2.78.0-3.2.6",
31
+ "@girs/gobject-2.0": "^2.78.0-3.2.6",
32
+ "@girs/soup-3.0": "^3.4.4-3.2.6"
33
33
  },
34
34
  "devDependencies": {
35
35
  "typescript": "*"