Organize files into directories: client, common, server, test

This commit is contained in:
Sashko Stubailo
2017-11-08 08:49:14 -08:00
parent 2f099b476e
commit 5bc54cabce
20 changed files with 34 additions and 33 deletions

View File

@@ -1,8 +1,7 @@
import { DDP, LivedataTest } from './namespace';
import { DDP, LivedataTest } from '../common/namespace';
import './stream_client_sockjs';
import './livedata_connection';
import '../common/livedata_connection';
import './client_convenience';

View File

@@ -1,4 +1,4 @@
import { DDP } from "./namespace.js";
import { DDP } from "../common/namespace.js";
// Meteor.refresh can be called on the client (if you're in common code) but it
// only has an effect on the server.

View File

@@ -1,12 +1,12 @@
import { DDP, LivedataTest } from "./namespace.js";
import { _ } from 'meteor/underscore';
import { Meteor } from 'meteor/meteor';
import { toSockjsUrl } from './urlHelpers';
// This populates a global variable
import './sockjs-0.3.4';
import { addCommonMethodsToPrototype } from './stream_client_common';
import { DDP, LivedataTest } from "../common/namespace.js";
import { toSockjsUrl } from '../common/urlHelpers';
import { addCommonMethodsToPrototype } from '../common/stream_client_common';
// @param url {String} URL to Meteor app
// "http://subdomain.meteor.com/" or "/" or

View File

@@ -1,5 +1,3 @@
import { DDP, LivedataTest } from "./namespace.js";
import { MongoIDMap } from "./id_map.js";
import { Meteor } from 'meteor/meteor';
import { _ } from 'meteor/underscore';
import { DDPCommon } from 'meteor/ddp-common';
@@ -13,6 +11,9 @@ if (Meteor.isServer) {
var Future = Npm.require('fibers/future');
}
import { DDP, LivedataTest } from "./namespace.js";
import { MongoIDMap } from "./id_map.js";
// @param url {String|Object} URL to Meteor app,
// or an object as a test hook (see code)
// Options:

View File

@@ -1,10 +1,11 @@
import { DDP, LivedataTest } from "./namespace.js";
import { Random } from 'meteor/random';
import { Meteor } from 'meteor/meteor';
import { _ } from 'meteor/underscore';
import { Tracker } from 'meteor/tracker';
import { Retry } from 'meteor/retry';
import { DDP, LivedataTest } from "./namespace.js";
export function addCommonMethodsToPrototype(proto) {
_.extend(proto, {
// Register for callbacks.

View File

@@ -29,8 +29,8 @@ Package.onUse(function (api) {
// For backcompat where things use Package.ddp.DDP, etc
api.export('DDP');
api.mainModule("client.js", "client");
api.mainModule("server.js", "server");
api.mainModule("client/client.js", "client");
api.mainModule("server/server.js", "server");
});
Package.onTest(function (api) {
@@ -49,14 +49,14 @@ Package.onTest(function (api) {
'ejson'
]);
api.addFiles('stub_stream.js');
api.addFiles('livedata_connection_tests.js', ['client', 'server']);
api.addFiles('livedata_tests.js', ['client', 'server']);
api.addFiles('livedata_test_service.js', ['client', 'server']);
api.addFiles('random_stream_tests.js', ['client', 'server']);
api.addFiles('test/stub_stream.js');
api.addFiles('test/livedata_connection_tests.js', ['client', 'server']);
api.addFiles('test/livedata_tests.js', ['client', 'server']);
api.addFiles('test/livedata_test_service.js', ['client', 'server']);
api.addFiles('test/random_stream_tests.js', ['client', 'server']);
api.use('http', 'client');
api.addFiles(['stream_tests.js'], 'client');
api.addFiles('stream_client_tests.js', 'server');
api.addFiles('test/stream_tests.js', 'client');
api.addFiles('test/stream_client_tests.js', 'server');
api.use('check', ['client', 'server']);
});

View File

@@ -1,7 +0,0 @@
import { DDP, LivedataTest } from './namespace';
import './stream_client_nodejs';
import './livedata_connection';
export { DDP, LivedataTest };

View File

@@ -0,0 +1,7 @@
import { DDP, LivedataTest } from '../common/namespace';
import './stream_client_nodejs';
import '../common/livedata_connection';
export { DDP, LivedataTest };

View File

@@ -1,9 +1,9 @@
import { DDP, LivedataTest } from "./namespace";
import { _ } from 'meteor/underscore';
import { toWebsocketUrl } from './urlHelpers';
import { Meteor } from 'meteor/meteor';
import { addCommonMethodsToPrototype } from './stream_client_common';
import { DDP, LivedataTest } from "../common/namespace";
import { toWebsocketUrl } from '../common/urlHelpers';
import { addCommonMethodsToPrototype } from '../common/stream_client_common';
// @param endpoint {String} URL to Meteor app
// "http://subdomain.meteor.com/" or "/" or

View File

@@ -1,5 +1,5 @@
import lolex from 'lolex';
import { DDP, LivedataTest } from "./namespace.js";
import { DDP, LivedataTest } from "../common/namespace.js";
var newConnection = function (stream, options) {
// Some of these tests leave outstanding methods with no result yet

View File

@@ -1,4 +1,4 @@
import { DDP, LivedataTest } from "./namespace.js";
import { DDP, LivedataTest } from "../common/namespace.js";
// XXX should check error codes
var failure = function (test, code, reason) {

View File

@@ -1,4 +1,4 @@
import { LivedataTest } from "./namespace.js";
import { LivedataTest } from "../common/namespace.js";
var Fiber = Npm.require('fibers');

View File

@@ -1,4 +1,4 @@
import { LivedataTest } from "./namespace.js";
import { LivedataTest } from "../common/namespace.js";
Tinytest.add("stream - status", function (test) {
// Very basic test. Just see that it runs and returns something. Not a