Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 4 files changed
  • 0 comments
  • 1 contributor
10 README.md
Source Rendered
@@ -2,12 +2,14 @@
2 2
3 3 you will need to do some trickery for this to work... that is until they have npm package dependencies built into meteor (it's coming! eventually...) for now, try this:
4 4
5   - npm install component component-builder
6   - cd node_modules/component && npm link && cd ../..
7   - cd node_modules/component-builder && npm link && cd ../..
  5 +I am working on a Npm dependency module for meteor... not ready yet though...
8 6
9 7 # Notes
10 8
11 9 due to a bug with multiple components depending on the same component (component-emitter for example), with the stock version of component, you might get hangs...
12 10
13   -I have [made a pull request](https://github.com/component/component/pull/276), so you will have to wait, or you can optionally check out my [repo here](https://github.com/heavyk/component)
  11 +I have [made a pull request](https://github.com/component/component/pull/276), so you will have to wait, or you can optionally check out my [repo here](https://github.com/heavyk/component)
  12 +
  13 +# Future
  14 +
  15 + * add a lock file. when more than one instance of meteor is spawned... things get pretty crazy...
7 client_tests.js
... ... @@ -0,0 +1,7 @@
  1 +
  2 +
  3 +Tinytest.add("component - presence", function(test) {
  4 + test.isTrue(typeof component === 'object');
  5 + test.isTrue(typeof component.require === 'function');
  6 +});
  7 +
7 component_tests.js
... ... @@ -1,4 +1,9 @@
  1 +
  2 +Meteor.__COMPONENT_PRESENT = require('component/package.json').version;
  3 +Meteor.__COMPONENT_BUILDER_PRESENT = require('component-builder/package.json').version;
  4 +
1 5 Tinytest.add("component - presence", function(test) {
2   - test.isTrue(Meteor.__COMPONENT_PRESENT);
  6 + test.isTrue(Meteor.__COMPONENT_PRESENT === '0.13.0');
  7 + test.isTrue(Meteor.__COMPONENT_BUILDER_PRESENT === '0.6.3');
3 8 });
4 9
42 package.js
@@ -19,11 +19,6 @@ const css_path = Path.join(odir, 'build.css');
19 19 const js_path = Path.join(odir, 'build.js');
20 20 const component_json_path = Path.join(".meteor", "component.json");
21 21
22   -Meteor.__COMPONENT_PRESENT = true;
23   -// TODO:
24   -// Meteor.__COMPONENT_PRESENT = require('component/package.json').version;
25   -// Meteor.__COMPONENT_BUILDER_PRESENT = require('component-builder/package.json').version;
26   -
27 22 try {
28 23 fs.mkdirSync(odir);
29 24 } catch(e) {}
@@ -40,8 +35,9 @@ Package.register_extension(
40 35 var conf = require(source_path);
41 36 var pkgs = conf.dependencies;
42 37 if(!pkgs) return;
  38 + var st, this_st = fs.statSync(source_path);
43 39 Fiber(function() {
44   - var st, this_st = fs.statSync(source_path);
  40 + var future = new Future;
45 41 ///*
46 42 try {
47 43 st = fs.statSync(component_json_path);
@@ -106,26 +102,29 @@ Package.register_extension(
106 102
107 103 batch = new Batch
108 104 _.each(pkgs, function(url, pkg) {
  105 +
  106 + var parts = pkg.split('@');
  107 + var name = parts.shift();
  108 + var version = parts.shift() || 'master';
  109 + var rname = pkg.replace('/', '-');
  110 + //TODO: if some time has passed, say 2-3 days, do an update instead of skipping it (for master)
  111 + //TODO: when implementing specific versions, do a version compare here and update if necessary
  112 + if(fs.existsSync(Path.join(odir, name))) return;
109 113 batch.push(function(done) {
110   - var parts = pkg.split('@');
111   - var name = parts.shift();
112   - var version = parts.shift() || 'master';
113   - var rname = pkg.replace('/', '-');
114   - //TODO: if some time has passed, say 2-3 days, do an update instead of skipping it (for master)
115   - //TODO: when implementing specific versions, do a version compare here and update if necessary
116   - if(fs.existsSync(Path.join(odir, name))) return;
117 114 install(name, version, done);
118 115 });
119 116 });
120   - var future = new Future;
  117 +
121 118 batch.end(function() {future.return()});
122   - future.wait()
  119 + future.wait();
  120 + future = void(8);
123 121 try {
124 122 fs.utimesSync(js_path, new Date, new Date);
125 123 } catch(e) {}
126 124 }
  125 + //}).run();
127 126 //*/
128   -
  127 + //Fiber(function() {
129 128 try {
130 129 st = fs.statSync(js_path);
131 130 } catch(e) {}
@@ -137,11 +136,11 @@ Package.register_extension(
137 136 builder.copyFiles();
138 137 builder.addLookup(Path.join(process.cwd(), ".meteor", "components"));
139 138 console.log();
140   - future = new Future;
  139 + if(!future) future = new Future;
141 140 builder.build(function(err, obj){
142 141 if (err) {
143 142 Component.utils.fatal(err.message);
144   - future.return(err);
  143 + return future.return(err);
145 144 }
146 145
147 146 fs.writeFileSync(css_path, obj.css);
@@ -203,10 +202,7 @@ Package.register_extension(
203 202 }
204 203 );
205 204
206   -/*
207   -//TODO: I'm not yet sure on how to write tests for this. get to it before releasing
208 205 Package.on_test(function (api) {
209   - api.add_files(['component_tests.ls', 'component_tests.js'],
210   - ['client', 'server']);
  206 + api.add_files(['component_tests.js'], 'server');
  207 + api.add_files(['client_tests.js'], 'client');
211 208 });
212   -*/

No commit comments for this range

Something went wrong with that request. Please try again.