Browse Source

Merge pull request #2855 from RaananW/package-readmes

Package readmes
David Catuhe 8 năm trước cách đây
mục cha
commit
0324860e46

+ 1 - 0
dist/preview release/gui/package.json

@@ -15,6 +15,7 @@
         "babylon.gui.min.js",
         "babylon.gui.d.ts",
         "babylon.gui.module.d.ts",
+        "readme.md",
         "package.json"
     ],
     "typings": "babylon.gui.module.d.ts",

+ 41 - 0
dist/preview release/gui/readme.md

@@ -0,0 +1,41 @@
+Babylon.js GUI module
+=====================
+
+For usage documentation please visit http://doc.babylonjs.com/overviews/gui
+
+# Installation instructions
+
+## CDN
+
+Compiled js files (minified and source) are offered on our public CDN here:
+
+* https://preview.babylonjs.com/gui/babylon.gui.js
+* https://preview.babylonjs.com/gui/babylon.gui.min.js
+
+## NPM
+
+To install using npm :
+
+```
+npm install --save babylonjs babylonjs-gui
+```
+
+If using TypeScript, the typing needs to be added to tsconfig.json:
+
+```
+    ....
+    "types": [
+        "babylonjs",
+        "babylonjs-gui",
+        "angularFTW"
+    ],
+    ....
+```
+
+Afterwards it can be imported to the project using:
+
+```
+import * as GUI from 'babylonjs-gui';
+```
+
+Using webpack to package your project will use the minified js file.

+ 1 - 0
dist/preview release/loaders/package.json

@@ -14,6 +14,7 @@
         "babylonjs.loaders.js",
         "babylonjs.loaders.min.js",
         "babylonjs.loaders.module.d.ts",
+        "readme.md",
         "package.json"
     ],
     "typings": "babylonjs.loaders.module.d.ts",

+ 44 - 0
dist/preview release/loaders/readme.md

@@ -0,0 +1,44 @@
+Babylon.js Loaders module
+=====================
+
+For usage documentation please visit http://doc.babylonjs.com/extensions and choose "loaders".
+
+# Installation instructions
+
+## CDN
+
+Compiled js files (minified and source) are offered on our public CDN here:
+
+* https://preview.babylonjs.com/loaders/babylonjs.loaders.js
+* https://preview.babylonjs.com/loaders/babylonjs.loaders.min.js
+
+## NPM
+
+To install using npm :
+
+```
+npm install --save babylonjs babylonjs-loaders
+```
+
+If using TypeScript, the typing needs to be added to tsconfig.json:
+
+```
+    ....
+    "types": [
+        "babylonjs",
+        "babylonjs-loaders",
+        ""
+    ],
+    ....
+```
+
+Afterwards it can be imported to the project using:
+
+```
+import * as BABYLON from 'babylonjs';
+import from 'babylonjs-loaders';
+```
+
+This will extend Babylon's namespace with the loaders available.
+
+Using webpack to package your project will use the minified js file.

+ 1 - 0
dist/preview release/materialsLibrary/package.json

@@ -14,6 +14,7 @@
         "babylonjs.materials.js",
         "babylonjs.materials.min.js",
         "babylonjs.materials.module.d.ts",
+        "readme.md",
         "package.json"
     ],
     "typings": "babylonjs.materials.module.d.ts",

+ 51 - 0
dist/preview release/materialsLibrary/readme.md

@@ -0,0 +1,51 @@
+Babylon.js Materials Library
+=====================
+
+For usage documentation please visit http://doc.babylonjs.com/extensions and choose "materials library".
+
+# Installation instructions
+
+## CDN
+
+Compiled js files (minified and source) are offered on our public CDN here:
+
+* https://preview.babylonjs.com/materialsLibrary/babylonjs.materials.js
+* https://preview.babylonjs.com/materialsLibrary/babylonjs.materials.min.js
+
+## NPM
+
+To install using npm :
+
+```
+npm install --save babylonjs babylonjs-materials
+```
+
+If using TypeScript, the typing needs to be added to tsconfig.json:
+
+```
+    ....
+    "types": [
+        "babylonjs",
+        "babylonjs-materials",
+        "oneMoreDependencyThatIReallyNeed"
+    ],
+    ....
+```
+
+Afterwards it can be imported to the project using:
+
+```
+import * as BABYLON from 'babylonjs';
+import from 'babylonjs-materials';
+```
+
+This will extend Babylon's namespace with the materials available:
+
+```
+// Some awesome code
+let skyMaterial = new BABYLON.SkyMaterial("skyMaterial", scene);
+skyMaterial.backFaceCulling = false;
+// Some more awesome code
+```
+
+Using webpack to package your project will use the minified js file.

+ 1 - 0
dist/preview release/postProcessesLibrary/package.json

@@ -14,6 +14,7 @@
         "babylonjs.postProcess.js",
         "babylonjs.postProcess.min.js",
         "babylonjs.postProcess.module.d.ts",
+        "readme.md",
         "package.json"
     ],
     "typings": "babylonjs.postProcess.module.d.ts",

+ 51 - 0
dist/preview release/postProcessesLibrary/readme.md

@@ -0,0 +1,51 @@
+Babylon.js Post Processes Library
+=====================
+
+For usage documentation please visit http://doc.babylonjs.com/extensions and choose "post process library".
+
+# Installation instructions
+
+## CDN
+
+Compiled js files (minified and source) are offered on our public CDN here:
+
+* https://preview.babylonjs.com/postProcessesLibrary/babylonjs.postProcess.js
+* https://preview.babylonjs.com/postProcessesLibrary/babylonjs.postProcess.min.js
+
+## NPM
+
+To install using npm :
+
+```
+npm install --save babylonjs babylonjs-post-process
+```
+
+If using TypeScript, the typing needs to be added to tsconfig.json:
+
+```
+    ....
+    "types": [
+        "babylonjs",
+        "babylonjs-post-process",
+        "oneMoreDependencyThatIReallyNeed"
+    ],
+    ....
+```
+
+Afterwards it can be imported to the project using:
+
+```
+import * as BABYLON from 'babylonjs';
+import from 'babylonjs-post-process';
+```
+
+This will extend Babylon's namespace with the post processes available:
+
+```
+// Some awesome code
+// Creates the post process
+let postProcess = new BABYLON.AsciiArtPostProcess("AsciiArt", camera);
+// Some more awesome code
+```
+
+Using webpack to package your project will use the minified js file.

+ 1 - 0
dist/preview release/proceduralTexturesLibrary/package.json

@@ -14,6 +14,7 @@
         "babylonjs.proceduralTextures.js",
         "babylonjs.proceduralTextures.min.js",
         "babylonjs.proceduralTextures.module.d.ts",
+        "readme.md",
         "package.json"
     ],
     "typings": "babylonjs.proceduralTextures.module.d.ts",

+ 53 - 0
dist/preview release/proceduralTexturesLibrary/readme.md

@@ -0,0 +1,53 @@
+Babylon.js Procedural Textures Library
+=====================
+
+For usage documentation please visit http://doc.babylonjs.com/extensions and choose "procedural textures library".
+
+# Installation instructions
+
+## CDN
+
+Compiled js files (minified and source) are offered on our public CDN here:
+
+* https://preview.babylonjs.com/proceduralTexturesLibrary/babylonjs.proceduralTextures.js
+* https://preview.babylonjs.com/proceduralTexturesLibrary/babylonjs.proceduralTextures.min.js
+
+## NPM
+
+To install using npm :
+
+```
+npm install --save babylonjs babylonjs-procedural-textures
+```
+
+If using TypeScript, the typing needs to be added to tsconfig.json:
+
+```
+    ....
+    "types": [
+        "babylonjs",
+        "babylonjs-procedural-textures",
+        "oneMoreDependencyThatIReallyNeed"
+    ],
+    ....
+```
+
+Afterwards it can be imported to the project using:
+
+```
+import * as BABYLON from 'babylonjs';
+import from 'babylonjs-procedural-textures';
+```
+
+This will extend Babylon's namespace with the procedural textures available:
+
+```
+// Some awesome code
+var fireMaterial = new BABYLON.StandardMaterial("fontainSculptur2", scene);
+var fireTexture = new BABYLON.FireProceduralTexture("fire", 256, scene);
+fireMaterial.diffuseTexture = fireTexture;
+fireMaterial.opacityTexture = fireTexture;
+// Some more awesome code
+```
+
+Using webpack to package your project will use the minified js file.

+ 1 - 0
dist/preview release/serializers/package.json

@@ -14,6 +14,7 @@
         "babylonjs.serializers.js",
         "babylonjs.serializers.min.js",
         "babylonjs.serializers.module.d.ts",
+        "readme.md",
         "package.json"
     ],
     "typings": "babylonjs.serializers.module.d.ts",

+ 42 - 0
dist/preview release/serializers/readme.md

@@ -0,0 +1,42 @@
+Babylon.js Serializers
+=====================
+
+# Installation instructions
+
+## CDN
+
+Compiled js files (minified and source) are offered on our public CDN here:
+
+* https://preview.babylonjs.com/serializers/babylonjs.serializers.js
+* https://preview.babylonjs.com/proceduralTexturesLibrary/babylonjs.serializers.min.js
+
+## NPM
+
+To install using npm :
+
+```
+npm install --save babylonjs babylonjs-serializers
+```
+
+If using TypeScript, the typing needs to be added to tsconfig.json:
+
+```
+    ....
+    "types": [
+        "babylonjs",
+        "babylonjs-serializers",
+        "oneMoreDependencyThatIReallyNeed"
+    ],
+    ....
+```
+
+Afterwards it can be imported to the project using:
+
+```
+import * as BABYLON from 'babylonjs';
+import from 'babylonjs-serializers';
+```
+
+This will extend Babylon's namespace with the serializers currently available.
+
+Using webpack to package your project will use the minified js file.

+ 33 - 0
readme.md

@@ -22,6 +22,39 @@ For preview release you can use the following ones:
 
 Additional references can be found on https://preview.babylonjs.com/xxx where xxx is the folder structure you can find in the /dist/preview release folder like https://preview.babylonjs.com/gui/babylon.gui.min.js
 
+## NPM
+
+BabylonJS and its modules are published on NPM with full typing support. To install use
+
+```
+npm install babylonjs --save
+```
+
+This will allow you to import BabylonJS entirely using:
+
+```
+import * as BABYLON from 'babylonjs';
+```
+
+or individual classes using:
+
+```
+import { Scene, Engine } from 'babylonjs';
+```
+
+If using TypeScript, don't forget to add 'babylonjs' to 'types' in tsconfig.json:
+
+```
+    ....
+    "types": [
+        "babylonjs",
+        "anotherAwesomeDependency"
+    ],
+    ....
+```
+
+To add a module install the respected package. A list of extra packages and their installation instructions can be found on [babylonjs' user at npm](https://www.npmjs.com/~babylonjs).
+
 ## Preview release
 
 **3.1-alpha** can be found [here](https://github.com/BabylonJS/Babylon.js/tree/master/dist/preview%20release).