skir 1.0.21 β†’ 1.0.22

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
@@ -1,11 +1,30 @@
1
- [![npm](https://img.shields.io/npm/v/skir)](https://www.npmjs.com/package/skir)
2
- [![build](https://github.com/gepheum/skir/workflows/Build/badge.svg)](https://github.com/gepheum/skir/actions)
1
+ <div align="center">
2
+ <h1>Skir</h1>
3
+ <p><strong>Like Protocol Buffer, but better.</strong></p>
3
4
 
4
- # Skir
5
+ [![npm](https://img.shields.io/npm/v/skir?style=flat-square)](https://www.npmjs.com/package/skir)
6
+ [![build](https://github.com/gepheum/skir/workflows/Build/badge.svg?style=flat-square)](https://github.com/gepheum/skir/actions)
5
7
 
6
- *Like Protocol Buffer, but better.*
8
+ ![quick-example](https://github.com/user-attachments/assets/1bfb84d1-11cd-48d2-92c5-3f27344d954e)
9
+ </div>
7
10
 
8
- Skir is a universal language for representing data types, constants and RPC interfaces.
11
+ <br />
12
+
13
+ **Skir** is a universal language for representing data types, constants, and RPC interfaces. Define your schema once in a `.skir` file and generate idiomatic, type-safe code in TypeScript, Python, Java, C++, and more.
14
+
15
+ ## ✨ Features
16
+
17
+ - πŸ’Ž **Single source of truth** - Define your data types once and share them between your backend, frontend, and microservices.
18
+ - 🌍 **Multi-language** - First-class support for TypeScript, Python, C++, Java, Kotlin, and Dart.
19
+ - ✍️ **Idiomatic code gen** - Generates code that feels native to each language.
20
+ - πŸƒ **Effortless serialization** - Skir generates functions to serialize your data to JSON or binary, so you never have to write parsing code manually.
21
+ - πŸ¦‹ **Schema evolution** - Simple guidelines and built-in checks to evolve your schema without breaking backward compatibility.
22
+ - 🀝 **RPC interfaces** - Define the interface between your frontend and your backend or your microservices, enjoy end-to-end type safety.
23
+ - πŸ› οΈ **Climactic developer experience** - Automatic recompilation in watch mode, built-in code formatter, official VSCode extension.
24
+ - πŸ“¦ **Built-in package manager** - Import types from other GitHub repositories to easily share common data structures across projects.
25
+ - πŸƒ **Easy setup** - Get started with `npx skir init`, manage your entire project configuration from a single YAML file.
26
+
27
+ ## ⚑ Syntax example
9
28
 
10
29
  ```d
11
30
  // shapes.skir
@@ -32,36 +51,39 @@ const TOP_RIGHT_CORNER: Point = {
32
51
  method IsConvex(Shape): bool = 12345;
33
52
  ```
34
53
 
35
- The Skir compiler translates definitions from `.skir` files into idiomatic source code in supported languages such as TypeScript, Python, Java, Kotlin, C++, Dart. This generated code provides typesafe definitions and built-in logic for serializing and deserializing data into either JSON or a more compact binary format.
54
+ Skir compiles these definitions into native, type-safe code you can use in your project:
36
55
 
37
56
  ```python
38
57
  # my_project.py
39
58
 
40
- from skirout.shapes_skir import Point # source file generated by the Skir compiler
59
+ from skirout.shapes_skir import Point # Python module generated by Skir
41
60
 
42
61
  point = Point(x=3, y=4, label="P")
43
- point_json = Point.serializer.to_json(point)
44
- assert(Point.serializer.from_json(json) == point)
45
- ```
46
-
47
- ## Documentation
48
-
49
- 1. [Why Skir?](docs/introduction.md)
50
- 2. [Getting started: setup & workflow](docs/setup.md)
51
- 3. [Language reference](docs/language-reference.md)
52
- 4. [Serialization formats](docs/serialization.md)
53
- 5. [Schema evolution & compatibility](docs/compatibility.md)
54
- 6. [Typesafe RPC interfaces](docs/services.md)
55
- 7. [External dependencies](docs/dependencies.md)
56
- 8. [Comparisons](docs/comparisons.md)
57
62
 
58
- ## Supported languages
63
+ # Round–trip serialization to JSON
64
+ point_json = Point.serializer.to_json(point)
65
+ restored = Point.serializer.from_json(point_json)
59
66
 
60
- * JavaScript/TypeScript: [documentation](https://github.com/gepheum/skir-typescript-gen), [example](https://github.com/gepheum/skir-typescript-example)
61
- * Python: [documentation](https://github.com/gepheum/skir-python-gen), [example](https://github.com/gepheum/skir-python-example)
62
- * C++: [documentation](https://github.com/gepheum/skir-cc-gen), [example](https://github.com/gepheum/skir-cc-example)
63
- * Java: [documentation](https://github.com/gepheum/skir-java-gen), [example](https://github.com/gepheum/skir-java-example)
64
- * Kotlin: [documentation](https://github.com/gepheum/skir-kotlin-gen), [example](https://github.com/gepheum/skir-kotlin-example)
65
- * Dart: [documentation](https://github.com/gepheum/skir-dart-gen), [example](https://github.com/gepheum/skir-dart-example)
67
+ assert(restored == point)
68
+ ```
66
69
 
67
- Other official and unofficial code generators will come.
70
+ ## πŸ“š Documentation
71
+
72
+ - [Getting started: setup & workflow](docs/setup.md)
73
+ - [Language reference](docs/language-reference.md)
74
+ - [Serialization formats](docs/serialization.md)
75
+ - [Schema evolution & compatibility](docs/compatibility.md)
76
+ - [Typesafe RPC interfaces](docs/services.md)
77
+ - [External dependencies](docs/dependencies.md)
78
+ - [Coming from Protocol Buffer](docs/coming_from_protobuf.md)
79
+
80
+ ## 🌍 Supported languages
81
+
82
+ | Language | Documentation | Example |
83
+ | :--- | :--- | :--- |
84
+ | 🟦 **TypeScript** | [Documentation](https://github.com/gepheum/skir-typescript-gen) | [Example](https://github.com/gepheum/skir-typescript-example) |
85
+ | 🐍 **Python** | [Documentation](https://github.com/gepheum/skir-python-gen) | [Example](https://github.com/gepheum/skir-python-example) |
86
+ | ⚑ **C++** | [Documentation](https://github.com/gepheum/skir-cc-gen) | [Example](https://github.com/gepheum/skir-cc-example) |
87
+ | β˜• **Java** | [Documentation](https://github.com/gepheum/skir-java-gen) | [Example](https://github.com/gepheum/skir-java-example) |
88
+ | πŸ’œ **Kotlin** | [Documentation](https://github.com/gepheum/skir-kotlin-gen) | [Example](https://github.com/gepheum/skir-kotlin-example) |
89
+ | 🎯 **Dart** | [Documentation](https://github.com/gepheum/skir-dart-gen) | [Example](https://github.com/gepheum/skir-dart-example) |
@@ -118,26 +118,26 @@ generators:
118
118
  # # To install runtime dependencies: npm i skir-client
119
119
  # # --------------------------------------------------------------------------
120
120
  # - mod: skir-typescript-gen
121
- # outDir: ./src/skirout
121
+ # outDir: ./skirout
122
122
  # config:
123
123
  # # Use ".js" for ES modules, "" for CommonJS
124
124
  # importPathExtension: ".js"
125
125
 
126
- # --------------------------------------------------------------------------
127
- # External Skir dependencies hosted on GitHub
128
- # To use an external repository, specify the GitHub repository identifier
129
- # in the format "@owner/repository-name" and the release tag version.
130
- # --------------------------------------------------------------------------
126
+ # # --------------------------------------------------------------------------
127
+ # # External Skir dependencies hosted on GitHub
128
+ # # To use an external repository, specify the GitHub repository identifier
129
+ # # in the format "@owner/repository-name" and the release tag version.
130
+ # # --------------------------------------------------------------------------
131
131
  # dependencies:
132
132
  # # Add a dependency to:
133
133
  # # https://github.com/gepheum/fantasy-game-skir-example/tree/v1.0.0
134
134
  # "@gepheum/fantasy-game-skir-example": v1.0.0
135
135
 
136
- # --------------------------------------------------------------------------
137
- # GitHub Personal Access Token (required for private dependencies)
138
- # Set this to the name of an environment variable containing your GitHub
139
- # token. The token is used to authenticate when downloading dependencies.
140
- # --------------------------------------------------------------------------
136
+ # # --------------------------------------------------------------------------
137
+ # # GitHub Personal Access Token (required for private dependencies)
138
+ # # Set this to the name of an environment variable containing your GitHub
139
+ # # token. The token is used to authenticate when downloading dependencies.
140
+ # # --------------------------------------------------------------------------
141
141
  # githubTokenEnvVar: GITHUB_TOKEN
142
142
  `;
143
143
  const HELLO_WORLD_SKIR_CONTENT = `/// A point in 2D space.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skir",
3
- "version": "1.0.21",
3
+ "version": "1.0.22",
4
4
  "description": "",
5
5
  "homepage": "https://github.com/gepheum/skir#readme",
6
6
  "bugs": {
@@ -132,26 +132,26 @@ generators:
132
132
  # # To install runtime dependencies: npm i skir-client
133
133
  # # --------------------------------------------------------------------------
134
134
  # - mod: skir-typescript-gen
135
- # outDir: ./src/skirout
135
+ # outDir: ./skirout
136
136
  # config:
137
137
  # # Use ".js" for ES modules, "" for CommonJS
138
138
  # importPathExtension: ".js"
139
139
 
140
- # --------------------------------------------------------------------------
141
- # External Skir dependencies hosted on GitHub
142
- # To use an external repository, specify the GitHub repository identifier
143
- # in the format "@owner/repository-name" and the release tag version.
144
- # --------------------------------------------------------------------------
140
+ # # --------------------------------------------------------------------------
141
+ # # External Skir dependencies hosted on GitHub
142
+ # # To use an external repository, specify the GitHub repository identifier
143
+ # # in the format "@owner/repository-name" and the release tag version.
144
+ # # --------------------------------------------------------------------------
145
145
  # dependencies:
146
146
  # # Add a dependency to:
147
147
  # # https://github.com/gepheum/fantasy-game-skir-example/tree/v1.0.0
148
148
  # "@gepheum/fantasy-game-skir-example": v1.0.0
149
149
 
150
- # --------------------------------------------------------------------------
151
- # GitHub Personal Access Token (required for private dependencies)
152
- # Set this to the name of an environment variable containing your GitHub
153
- # token. The token is used to authenticate when downloading dependencies.
154
- # --------------------------------------------------------------------------
150
+ # # --------------------------------------------------------------------------
151
+ # # GitHub Personal Access Token (required for private dependencies)
152
+ # # Set this to the name of an environment variable containing your GitHub
153
+ # # token. The token is used to authenticate when downloading dependencies.
154
+ # # --------------------------------------------------------------------------
155
155
  # githubTokenEnvVar: GITHUB_TOKEN
156
156
  `;
157
157