├── ToyKit ├── ToyKit │ ├── main.png │ ├── main.css │ └── main.js ├── LICENSE.md ├── lib │ └── main.js ├── server │ └── main.js ├── client │ ├── main.css │ ├── main.html │ └── main.js ├── README.md └── package.js ├── LICENSE.md ├── GUIDELINES.md └── README.md /ToyKit/ToyKit/main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MeteorToys/ToyKit/HEAD/ToyKit/ToyKit/main.png -------------------------------------------------------------------------------- /ToyKit/LICENSE.md: -------------------------------------------------------------------------------- 1 | LICENSE 2 | ======= 3 | 4 | For licensing information, go to: 5 | https://github.com/MeteorToys/allthings/blob/master/LICENSE.md -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | LICENSE 2 | ======= 3 | 4 | For package publishing guidelines, go to: 5 | https://github.com/MeteorToys/ToyKit/blob/master/GUIDELINES.md 6 | 7 | For licensing information, go to: 8 | https://github.com/MeteorToys/allthings/blob/master/LICENSE.md -------------------------------------------------------------------------------- /ToyKit/lib/main.js: -------------------------------------------------------------------------------- 1 | // If your toy requires a collection, 2 | // please use the suggested name pattern 3 | // so your collections do not show up in 4 | // Meteor Toys or Kadira Debug, and to 5 | // avoid interference with other Meteor Toys 6 | // 7 | // CollectionName = new Mongo.Collection("MeteorToys/authorName/packageName"); -------------------------------------------------------------------------------- /ToyKit/server/main.js: -------------------------------------------------------------------------------- 1 | // If your toy requires a collection, 2 | // please use the suggested name pattern 3 | // so your collections do not show up in 4 | // Meteor Toys or Kadira Debug, and to 5 | // avoid interference with other Meteor Toys 6 | // 7 | // Meteor.methods({ 8 | // 'meteortoys/authorName/methodName': function (parameter) { 9 | // return parameter; 10 | // } 11 | // }) -------------------------------------------------------------------------------- /ToyKit/ToyKit/main.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | # Step 6 4 | You can modify the size of the window in ./ToyKit/main.css 5 | You can modify the the icon in ./ToyKit/main.png 6 | 7 | After this, you can run `meteor add meteortoys:yourpackage` 8 | to install it. 9 | 10 | To set up collections, you will find instructions in ./lib/main.js 11 | To set up Methods, you will find instructions in ./server/main.js 12 | To modify the icon, use ./ToyKit/main.png as the starter 13 | - Recommended 2px solid #fff stroke 14 | 15 | Good luck building the package :) 16 | 17 | */ 18 | 19 | #MeteorToys_SDK { 20 | height: 359px; /* maximum 600px */ 21 | width: 320px; /* maximum 600px */ 22 | } 23 | 24 | #MeteorToys_SDK .MeteorToys_icon { 25 | background-image: url('./main.png'); 26 | } 27 | -------------------------------------------------------------------------------- /ToyKit/client/main.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | # Step 4: 4 | Replace the word SDK with the name of your package. 5 | 6 | Then, open ./ToyKit/main.js 7 | 8 | */ 9 | 10 | .MeteorToys_SDK_header, .MeteorToys_SDK_content { 11 | min-width: 304px; /* box width minus 8px from each side */ 12 | } 13 | 14 | .MeteorToys_SDK_header { 15 | line-height: 28px; 16 | background: rgba(0,0,0,.36); 17 | text-indent: 8px; 18 | overflow: hidden; 19 | } 20 | 21 | .MeteorToys_SDK_content { 22 | height: calc(100% - 28px); 23 | padding: 4px 8px; 24 | } 25 | 26 | .MeteorToys_SDK_button { 27 | float: right; 28 | border-left: 1px solid rgba(0,0,0,.3); 29 | padding: 0 8px; 30 | text-indent: 0px; 31 | } 32 | .MeteorToys_SDK_button:hover { 33 | cursor: pointer; 34 | color: rgba(131, 202, 237, 1); 35 | } -------------------------------------------------------------------------------- /ToyKit/client/main.html: -------------------------------------------------------------------------------- 1 | 8 | 9 | 17 | 18 | 26 | 27 | -------------------------------------------------------------------------------- /ToyKit/ToyKit/main.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | # Step 5 4 | Replace the word SDK with the name of your package. 5 | 6 | Then, open ./ToyKit/main.css 7 | 8 | */ 9 | 10 | ToyKit = { 11 | name: "SDK", 12 | template: "MeteorToys_SDK", 13 | type: "orb", 14 | onOpen: function () { 15 | console.log("You open me"); 16 | }, 17 | onClose: function () { 18 | console.log("Coffee is for closers!"); 19 | } 20 | }; 21 | 22 | 23 | // Do not modify the code below here 24 | 25 | if (Meteor.isClient) { 26 | if (Package["meteortoys:toykit"]) { 27 | // If ToyKit is present, 28 | // Import Meteor Toys API 29 | MeteorToys = Package["meteortoys:toykit"].MeteorToys; 30 | } else { 31 | // Otherwise, warn the user 32 | MeteorToys = {}; 33 | console.log("For the " + ToyKit.name + " toy to work, you must install Mongol or"); 34 | console.log("the Meteor Toys package. Grab the free edition at http://Meteor.Toys/"); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /ToyKit/client/main.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | # Step 3 4 | Replace the word SDK with the name of your package. 5 | 6 | Then, open ./client/main.css 7 | 8 | */ 9 | 10 | Meteor.startup(function() { 11 | // If there is no count, set it to 0 12 | MeteorToys.setDefault("SDK/counter", 0); 13 | }); 14 | 15 | Template.MeteorToys_SDK_header.events({ 16 | 'click .MeteorToys_SDK_header': function () { 17 | // From ToyKit API 18 | MeteorToys.closeToy(); 19 | 20 | // From Package itself 21 | ToyKit.onClose(); 22 | }, 23 | 'click .MeteorToys_SDK_button': function (e,t) { 24 | // Stop the previous click event from propagating, 25 | // otherwise clicking the button would close the toy 26 | e.stopPropagation(); 27 | 28 | // Increment the count of the counter 29 | // Notice that Meteor Toys do not use Session 30 | count = MeteorToys.get("SDK/counter"); 31 | MeteorToys.set("SDK/counter", count + 1); 32 | } 33 | }); 34 | 35 | Template.MeteorToys_SDK_content.helpers({ 36 | 'count': function () { 37 | return MeteorToys.get("SDK/counter"); 38 | } 39 | }); -------------------------------------------------------------------------------- /GUIDELINES.md: -------------------------------------------------------------------------------- 1 | ToyKit Acceptance Guidelines 2 | ============================ 3 | 4 | ## How does approval work? 5 | It's pretty simple: just send the package code and details to toykit@meteor.toys and I will look over it and let get back to you. Approval will be up to Meteor Toys, and any package may be declined or accepted outside these guidelines. 6 | 7 | ## What kind of packages get approved? 8 | The intention here is to allow other's to create development tools and debug packages for other popular packages. My main request is that you do not replicate core functionality. Otherwise, the rest should be fine. 9 | 10 | ## Why is there an approval system? 11 | This is the best way to ensure that packages work for everyone. If there are breaking changes in a future release, I can improvise and make sure the third-party packages continue working. Additionally, I can feature approved packages on the website for everyone to see. 12 | 13 | ## Misc 14 | Please note that any toy may be rejected for any reason outside of what is specified here. If you are worried that your idea may be rejected, please contact me first and I will be happy to help. Also, think of me as collaborator for your package. I can help you out with the icon design and etc. -------------------------------------------------------------------------------- /ToyKit/README.md: -------------------------------------------------------------------------------- 1 | Package Name - Read Me Template 2 | =============================== 3 | Describe your package here. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo. 4 | 5 | Please note this is only a suggested template and license, and feel free to modify it as you'd like. For the SDK license and guidelines, check out the main repository. 6 | 7 | How to Install 8 | -------------- 9 | To install, simply run these commands in terminal: 10 | 1. If not present, install Meteor Toys with `meteor add meteortoys:allthings` 11 | 2. Install this extension with `meteor add author:name` 12 | 3. Open your application and press Control + M to activate 13 | 14 | For Support 15 | ----------- 16 | This package was authored by GitHubUsername. For support relating to this package, please contact the author. 17 | 18 | Additional Information 19 | ---------------------- 20 | - To learn more about Meteor Toys, go to the official website. 21 | - This package is licensed under MT-License. -------------------------------------------------------------------------------- /ToyKit/package.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | # Step 1: 4 | In Package.describe(), modify the package name (but not the organization) 5 | with the name of your package. 6 | 7 | Please note package name must be lowercase in the 8 | Package.describe() function. 9 | 10 | Then, open ./client/main.html 11 | 12 | */ 13 | 14 | Package.describe({ 15 | name: "meteortoys:sdk", 16 | summary: "Because you can never have enough toys", 17 | version: "1.0.0", 18 | git: "https://github.com/MeteorToys/sdk.git", 19 | documentation: "README.md", 20 | debugOnly: true 21 | }); 22 | 23 | Package.onUse(function(api) { 24 | 25 | var clientFiles = [ 26 | "client/main.html", 27 | "client/main.js", 28 | "client/main.css", 29 | ]; 30 | 31 | var mutualFiles = [ 32 | "lib/main.js" 33 | ]; 34 | 35 | var serverFiles = [ 36 | "server/main.js" 37 | ]; 38 | 39 | /***********************************************************************/ 40 | /** Meteor Toys - ToyKit 2.0.0 **/ 41 | /**/ api.add_files("ToyKit/main.js", ["client","server"]); /**/ 42 | /**/ api.add_files("ToyKit/main.css", ["client"]); /**/ 43 | /**/ api.addAssets("ToyKit/main.png", ["client"]); /**/ 44 | /**/ api.export('ToyKit', ["client","server"]); /**/ 45 | /** These files should always load first **/ 46 | /***********************************************************************/ 47 | 48 | api.versionsFrom("METEOR@1.2"); 49 | api.use(["templating","mongo","tracker"], "client"); 50 | 51 | api.add_files(clientFiles, ["client"]); 52 | api.add_files(serverFiles, ["server"]); 53 | api.add_files(mutualFiles, ["client","server"]); 54 | 55 | }); -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ToyKit™ - Build Your Own Meteor Toys™ 2 | ===================================== 3 | 4 | Meteor Toys packages are used by thousands of Meteor developers [estimate], with over 100,000 package downloads. Starting today, you can tap into the workflow of these developers with ToyKit. 5 | 6 | With ToyKit, you can forget about writing boilerplate code and then explaining to developers how to use your development tool. Everything is designed to help you integrate with what they already know. 7 | 8 | 9 | 10 | ## ToyKit API 11 | 12 | The SDK contains a starter header and content template, which you can fill or replace with whatever you want. Additionally, Meteor Toys provide several utilites to help you be more productive and avoid causing intrusion into the application code. 13 | 14 | ```javascript 15 | // Use in place of Session variables 16 | MeteorToys.set("packageName/isAwesome", true); 17 | MeteorToys.get("packageName/isAwesome"); // you can bet it won't be false 18 | 19 | // UI functionality 20 | MeteorToys.closeToy(); // closes your toy 21 | MeteorToys.openToy(templateName) // opens another toy 22 | MeteorToys.colorize(json) // returns colorized JSON 23 | 24 | // Toy Configuration (found in package/ToyKit/main.js) 25 | ToyKit = { 26 | name: "SDK", 27 | template: "MeteorToys_SDK", 28 | type: "orb", 29 | onOpen: function () { 30 | console.log("You open me!"); 31 | }, 32 | onClose: function () { 33 | console.log("Coffee is for closers!"); 34 | } 35 | }; 36 | ``` 37 | 38 | ## How to Get Started 39 | 40 | 1. Clone the `ToyKit` folder to your `./packages` folder 41 | 2. Open `package.js`, and follow the instructions in the comments 42 | 3. Add your code, use as you wish, and/or submit to Meteor Toys 43 | 44 | ## Distribution 45 | 46 | For the Toy to work, it must be published under the Meteor Toys organization. I believe this is the best starting point in figuring out a way to give everyone the experience when using the Toys. However, if you choose not to publish the package, it will still work on your local machine. 47 | 48 | By centralizing the distribution, it becomes easier for everyone to discover the packages in one place, rather than have them scattered across Atmosphere. Additionally, if there are breaking changes in Meteor Toys, or a package becomes outdated, I would have to ability to push a patch or note the breaking point. 49 | 50 | ## Compatibility 51 | 52 | For the Toy to work, the developer using it must have Mongol, JetSetter, or Meteor Toys installed. The Toy will alert the user if they are not present. The Toy itself does not depend on any Meteor Toys packages to prevent versioning conflicts. 53 | 54 | Since Meteor 1.2 is the future of Meteor, and it introduces breaking changes to the build system, ToyKit is designed to be compatible with Meteor 1.2 and up and Meteor Toys 2.1 and up. 55 | 56 | ## License 57 | 58 | You may distribute your package as closed source or open source, and as free or paid, under any license you wish. In case you do not specify a license, the package will default to the Meteor Toys license. ToyKit, which orchestrates the Toys, is bound by the Meteor Toys license. 59 | 60 | Meteor Toys, the design, look and feel are a copyright of FaverSocial, LLC. --------------------------------------------------------------------------------