@@ -232,23 +232,73 @@ under `sphinx`, etc.
232
232
233
233
That's it. You are ready to rock!
234
234
235
- ## Configuration
235
+ ## Features
236
+
237
+ ### Language features
238
+
239
+ * Classes
240
+ * Inheritance
241
+ * Constructors
242
+ * Methods
243
+ * Properties
244
+ * Abstract Members
245
+ * Virtual Overrides
246
+ * Async Methods
247
+ * Variadic Arguments
248
+ * Static Methods and Properties
249
+ * Static Constants
250
+ * Abstract Classes
251
+ * Interfaces
252
+ * Enums
253
+ * Primitive Types: string, number, boolean, date, json, any
254
+ * Collection Types: arrays, maps
255
+ * Union Types (limited support)
256
+ * Module Dependencies
257
+ * Data Interfaces
258
+
259
+ ### Source Languages
236
260
237
- jsii configuration is read from the module's ` package.json ` and includes the following options:
261
+ * TypeScript
262
+
263
+ ### Target Languages
264
+
265
+ * __ Java__ - generates a ready-to-publish Maven package.
266
+ * __ .NET__ - generates a ready-to-publish NuGet package.
267
+ * __ Sphinx__ - generates a Sphinx reStructuredText document for the module with README and reference docs.
268
+ * __ Python__ (work in progress) - generates a ready-to-publish PyPI package.
269
+ * __ Ruby__ (work in progress) - generates a ready-to-publish RubyGem.
270
+
271
+
272
+ ## Targets
273
+
274
+ jsii configuration is read from the ` jsii ` section in the module's
275
+ ` package.json ` and includes the following options:
238
276
239
277
* ` targets ` - the list of target languages this module will be packaged for. For each
240
278
target, you would need to specify some naming information such as namespaces, package manager
241
279
coordinates, etc. See [ supported targets] ( #targets ) for details.
242
280
* ` outdir ` - the default output directory (relative to package root) for
243
- __ jsii-pacmak__ . This is where target artifacts are emitted during packaging. Each artifact
244
- will be emitted under ` <outdir>/<target> ` (e.g. ` dist/java ` , ` dist/js ` , etc).
281
+ __ jsii-pacmak__ . This is where target artifacts are emitted during packaging.
282
+ Each artifact will be emitted under ` <outdir>/<target> ` (e.g. ` dist/java ` ,
283
+ ` dist/js ` , etc). Conventionally we use ` "dist" ` for outdir.
245
284
246
- ### Targets
285
+ ### Java
247
286
248
- The following targets are currently supported:
287
+ The ` java ` target will produce a ready-to-deploy Maven package for your jsii module.
249
288
250
- * ` js ` - implicit - every module will always have a "js" target (dah!).
251
- * ` java ` - packages the module as in Java/Maven package. Requires the following config:
289
+ The ` $outdir/java ` directory will include the contents of a staged offline Maven
290
+ repository. javadocs and sources are included automatically in the Maven package
291
+
292
+ This repository can be published to [ Maven Central] ( https://search.maven.org/ )
293
+ via the ` deploy-staged-repository ` command of the
294
+ [ nexus-staging-maven-plugin] ( https://mvnrepository.com/artifact/org.sonatype.plugins/nexus-staging-maven-plugin ) .
295
+ See [ Sonatype
296
+ documentation] ( https://mvnrepository.com/artifact/org.sonatype.plugins/nexus-staging-maven-plugin )
297
+ and [ this gist] ( https://gist.github.com/eladb/9caa04253b268e8a8f3d658184202806 )
298
+ as a reference.
299
+
300
+ To package your jsii module for Java, add the following configuration to the ` jsii `
301
+ section in ` package.json ` :
252
302
253
303
``` json
254
304
{
@@ -262,77 +312,70 @@ The following targets are currently supported:
262
312
}
263
313
```
264
314
265
- * ` dotnet ` - packages the module as a .NET/NuGet package. Requires the following config:
315
+ ### .NET
316
+
317
+ The ` dotnet ` target will produce a ready-to-publish NuGet package for your module.
318
+
319
+ The ` $outdir/dotnet ` directory will include ` .nupkg ` files, which can
320
+ be [ published to NuGet] ( https://docs.microsoft.com/en-us/nuget/create-packages/publish-a-package ) .
321
+
322
+ To package your jsii module as for .NET, add this configuration to the ` jsii `
323
+ section in ` package.json ` :
266
324
267
325
``` js
268
326
{
269
327
" dotnet" : {
270
- /* Required. */
271
- " namespace" : " Acme.HelloNamespace" ,
328
+ " namespace" : " Acme.HelloNamespace" , // required
329
+ " packageId" : " Acme.HelloPackage" , // required
330
+ " title" : " ACME Hello" , // optional (default: packageId)
331
+ " iconUrl" : " path/to/icon.svg" , // optional (default: no icon)
332
+
333
+ // strong-name signing
334
+ " signAssembly" : true , // optional (default: false)
335
+ " assemblyOriginatorKeyFile" : " path/to/key.snk" // optional
336
+ }
337
+ }
338
+ ```
272
339
273
- /* Required. */
274
- " packageId" : " Acme.HelloPackage" ,
340
+ ### Sphinx
275
341
276
- /* Optional. Default: Value of packageId. */
277
- " title" : " ACME Hello" ,
342
+ The sphinx target emits a [ Sphinx] ( http://www.sphinx-doc.org/en/master/ )
343
+ documentation topic for the module, that can be used to build a Sphinx
344
+ documentation website. It's not a complete website.
278
345
279
- /* Optional. Default: null (no icon). */
280
- " iconUrl" : " path/to/icon.svg" ,
281
346
282
- /* Optional. Used in conjunction with assemblyOriginatorKeyFile. Default: false. */
283
- " signAssembly" : true ,
347
+ The ` $outdir/sphinx ` directory will include two files:
284
348
285
- /* Optional. Used in conjunction with signAssembly. Default: null. */
286
- " assemblyOriginatorKeyFile" : " path/to/key.snk"
287
- }
288
- }
289
- ```
349
+ * ` <module-name>.rst ` - the Sphinx topic entry point
350
+ * ` <module-name>.README.md ` (optional) - the module's README.md file (if exists)
290
351
291
- * ` sphinx ` - produces sphinx documentation for the module. No config is required, but an empty
292
- entry will be needed in order to package this target:
352
+ The ` .rst ` file will use [ m2r] ( https://github.com/miyakogi/m2r ) to
353
+ [ ` mdinclude ` ] ( https://miyakogi.github.io/m2r/example.html#include-markdown-file )
354
+ the README.md file into the topic.
355
+
356
+ NOTE: if the first line of your ` README.md ` file starts with ` # ` (an H1
357
+ header), the contents of this line will be used as the first header of the
358
+ topic. Otherwise, the module's name will be used.
359
+
360
+ You will need to build a Sphinx documentation website with this ` .rst ` included.
361
+
362
+ To package your jsii module as a Sphinx topic, add an empty object to the
363
+ ` jsii ` section in ` package.json ` under the ` sphinx ` key:
293
364
294
365
``` json
295
366
{
296
367
"sphinx" : { }
297
368
}
298
369
```
299
370
371
+ ### JavaScript
300
372
301
- ## Features
302
-
303
- ### Language features
304
-
305
- * Classes
306
- * Inheritance
307
- * Constructors
308
- * Methods
309
- * Properties
310
- * Abstract Members
311
- * Virtual Overrides
312
- * Async Methods
313
- * Variadic Arguments
314
- * Static Methods and Properties
315
- * Static Constants
316
- * Abstract Classes
317
- * Interfaces
318
- * Enums
319
- * Primitive Types: string, number, boolean, date, json, any
320
- * Collection Types: arrays, maps
321
- * Union Types (limited support)
322
- * Module Dependencies
323
- * Data Interfaces
324
-
325
- ### Source Languages
326
-
327
- * TypeScript
373
+ An implicit JavaScript target will always be created. No configuration is needed.
328
374
329
- ### Target Languages
375
+ The ` $outdir/js ` directory will include that npm tarball of the module (created
376
+ with [ ` npm pack ` ] ( https://docs.npmjs.com/cli/pack ) ).
330
377
331
- * __ Java__ - generates a ready-to-publish Maven package.
332
- * __ .NET__ - generates a ready-to-publish NuGet package.
333
- * __ Sphinx__ - generates a Sphinx reStructuredText document for the module with README and reference docs.
334
- * __ Python__ (work in progress) - generates a ready-to-publish PyPI package.
335
- * __ Ruby__ (work in progress) - generates a ready-to-publish RubyGem.
378
+ Tarballs can be published to npmjs.org using [ ` npm publish ` ] ( https://docs.npmjs.com/cli/publish )
336
379
337
380
## What kind of sorcery is this?
338
381
0 commit comments