Skip to content

Commit

Permalink
move files to match new structure
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenplusplus committed Aug 2, 2016
1 parent 21acf6f commit 8cd0ac3
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 56 deletions.
2 changes: 1 addition & 1 deletion packages/google-cloud/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ var apis = {
* keyFilename: '/path/to/keyfile.json'
* });
*/
prediction: require('./prediction'),
prediction: require('@google-cloud/prediction'),

/**
* [Google Cloud Pub/Sub](https://developers.google.com/pubsub/overview) is a
Expand Down
1 change: 1 addition & 0 deletions packages/google-cloud/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ describe('gcloud', function() {
'@google-cloud/datastore': FakeDatastore,
'@google-cloud/dns': FakeDNS,
'@google-cloud/language': FakeLanguage,
'@google-cloud/logging': FakeLogging,
'@google-cloud/prediction': FakePrediction,
'@google-cloud/pubsub': FakePubSub,
'@google-cloud/resource': FakeResource,
Expand Down
76 changes: 76 additions & 0 deletions packages/language/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"name": "@google-cloud/language",
"version": "0.1.0",
"author": "Google Inc.",
"description": "Google Cloud Natural Language Client Library for Node.js",
"contributors": [
{
"name": "Burcu Dogan",
"email": "jbd@google.com"
},
{
"name": "Johan Euphrosine",
"email": "proppy@google.com"
},
{
"name": "Patrick Costello",
"email": "pcostell@google.com"
},
{
"name": "Ryan Seys",
"email": "ryan@ryanseys.com"
},
{
"name": "Silvano Luciani",
"email": "silvano@google.com"
},
{
"name": "Stephen Sawchuk",
"email": "sawchuk@gmail.com"
}
],
"main": "./src/index.js",
"files": [
"./src/*",
"AUTHORS",
"CONTRIBUTORS",
"COPYING"
],
"repository": "googlecloudplatform/gcloud-node",
"keywords": [
"google apis client",
"google api client",
"google apis",
"google api",
"google",
"google cloud platform",
"google cloud",
"cloud",
"google cloud natural language",
"google cloud language",
"natural language",
"language"
],
"dependencies": {
"@google-cloud/common": "^0.1.0",
"@google-cloud/storage": "^0.1.0",
"extend": "^3.0.0",
"google-proto-files": "^0.4.0",
"is": "^3.0.1",
"propprop": "^0.3.1",
"string-format-obj": "^1.0.0"
},
"devDependencies": {
"mocha": "^2.1.0",
"proxyquire": "^1.7.10"
},
"scripts": {
"publish": "../../scripts/publish.sh",
"test": "mocha test/*.js",
"system-test": "mocha system-test/*.js --no-timeouts --bail"
},
"license": "Apache-2.0",
"engines": {
"node": ">=0.12.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,11 @@

var arrify = require('arrify');
var extend = require('extend');
var File = require('@google-cloud/storage').File;
var format = require('string-format-obj');
var is = require('is');
var prop = require('propprop');

/**
* @type {module:storage/file}
* @private
*/
var File = require('../storage/file.js');

/*! Developer Documentation
*
* @param {module:language} language - The parent Language object.
Expand All @@ -45,7 +40,7 @@ var File = require('../storage/file.js');
* @alias module:language/document
*
* @example
* var gcloud = require('gcloud');
* var gcloud = require('google-cloud');
*
* var language = gcloud.language({
* projectId: 'grape-spaceship-123'
Expand Down
16 changes: 3 additions & 13 deletions lib/language/index.js → packages/language/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,17 @@

var extend = require('extend');
var is = require('is');
var GrpcService = require('@google-cloud/common').GrpcService;
var googleProtoFiles = require('google-proto-files');
var nodeutil = require('util');
var util = require('@google-cloud/common').util;

/**
* @type {module:language/document}
* @private
*/
var Document = require('./document.js');

/**
* @type {module:common/grpc-service}
* @private
*/
var GrpcService = require('../common/grpc-service.js');

/**
* @type {module:common/util}
* @private
*/
var util = require('../common/util.js');

/**
* The [Google Cloud Natural Language](https://cloud.google.com/natural-language/docs)
* API provides natural language understanding technologies to developers,
Expand All @@ -69,7 +59,7 @@ var util = require('../common/util.js');
* @param {object} options - [Configuration object](#/docs).
*
* @example
* var gcloud = require('gcloud')({
* var gcloud = require('google-cloud')({
* keyFilename: '/path/to/keyfile.json',
* projectId: 'grape-spaceship-123'
* });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@

var assert = require('assert');
var is = require('is');
var Storage = require('@google-cloud/storage');
var through = require('through2');
var uuid = require('node-uuid');

var env = require('./env.js');
var Language = require('../lib/language/index.js');
var Storage = require('../lib/storage/index.js');
var env = require('../../../system-test/env.js');
var Language = require('../');

describe.only('Language', function() {
describe('Language', function() {
var language;

var TESTS_PREFIX = 'gcloud-tests-language-';
Expand Down
20 changes: 6 additions & 14 deletions test/language/document.js → packages/language/test/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@

var assert = require('assert');
var extend = require('extend');
var mockery = require('mockery-next');
var prop = require('propprop');

var util = require('../../lib/common/util.js');
var proxyquire = require('proxyquire');
var util = require('@google-cloud/common').util;

function FakeFile() {}

Expand All @@ -36,22 +35,15 @@ describe('Document', function() {
var CONFIG = 'inline content';

before(function() {
mockery.registerMock('../../lib/storage/file.js', FakeFile);

mockery.enable({
useCleanCache: true,
warnOnUnregistered: false
Document = proxyquire('../src/document.js', {
'@google-cloud/storage': {
File: FakeFile
}
});

Document = require('../../lib/language/document.js');
DocumentCache = extend(true, {}, Document);
});

after(function() {
mockery.deregisterAll();
mockery.disable();
});

beforeEach(function() {
for (var property in DocumentCache) {
if (DocumentCache.hasOwnProperty(property)) {
Expand Down
25 changes: 8 additions & 17 deletions test/language/index.js → packages/language/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
var assert = require('assert');
var extend = require('extend');
var googleProtoFiles = require('google-proto-files');
var mockery = require('mockery-next');

var util = require('../../lib/common/util.js');
var proxyquire = require('proxyquire');
var util = require('@google-cloud/common').util;

var fakeUtil = extend(true, {}, util);

Expand All @@ -40,21 +39,13 @@ describe('Language', function() {
var OPTIONS = {};

before(function() {
mockery.registerMock('../../lib/common/grpc-service.js', FakeGrpcService);
mockery.registerMock('../../lib/common/util.js', fakeUtil);
mockery.registerMock('../../lib/language/document.js', FakeDocument);

mockery.enable({
useCleanCache: true,
warnOnUnregistered: false
Language = proxyquire('../src/index.js', {
'@google-cloud/common': {
util: fakeUtil,
GrpcService: FakeGrpcService
},
'./document.js': FakeDocument
});

Language = require('../../lib/language/index.js');
});

after(function() {
mockery.deregisterAll();
mockery.disable();
});

beforeEach(function() {
Expand Down
2 changes: 2 additions & 0 deletions scripts/link.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

# Depends on @google-cloud/common, @google-cloud/storage
(cd ./packages/bigquery; npm link @google-cloud/common; npm link @google-cloud/storage; npm link)
(cd ./packages/language; npm link @google-cloud/common; npm link @google-cloud/storage; npm link)
(cd ./packages/vision; npm link @google-cloud/common; npm link @google-cloud/storage; npm link)
(cd ./packages/prediction; npm link @google-cloud/common; npm link @google-cloud/storage; npm link)

Expand All @@ -41,6 +42,7 @@ npm link @google-cloud/bigtable
npm link @google-cloud/compute
npm link @google-cloud/datastore
npm link @google-cloud/dns
npm link @google-cloud/language
npm link @google-cloud/logging
npm link @google-cloud/prediction
npm link @google-cloud/pubsub
Expand Down

0 comments on commit 8cd0ac3

Please sign in to comment.