Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved things around #235

Merged
merged 1 commit into from
Apr 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![oc](https://raw.github.com/opentable/oc/master/logo.png)
![oc](https://raw.github.com/opentable/oc/master/docs/logo.png)
=============

OpenComponents is a framework to develop and deploy robust and distributed html components.
Expand Down
File renamed without changes
12 changes: 6 additions & 6 deletions grunt-tasks/jshint.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

module.exports = {
options: {
jshintrc: '.jshintrc',
jshintrc: 'grunt-tasks/support/.jshintrc',
ignores: [
'node_modules',
'client/src/oc-client.min.js',
'components/oc-client/src/head.load.js',
'components/oc-client/src/oc-client.min.js',
'components/oc-client/_package/**/*',
'components/base-component-handlebars/_package/**/*',
'components/base-component-jade/_package/**/*',
'src/components/oc-client/src/head.load.js',
'src/components/oc-client/src/oc-client.min.js',
'src/components/oc-client/_package/**/*',
'src/components/base-component-handlebars/_package/**/*',
'src/components/base-component-jade/_package/**/*',
'test/fixtures',
'test/front-end',
'test/configuration'
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion grunt-tasks/support/cli-commands-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

var _ = require('underscore');

var commands = require('../../cli/commands');
var commands = require('../../src/cli/commands');

module.exports = {
parse: function(){
Expand Down
6 changes: 3 additions & 3 deletions grunt-tasks/support/task-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ module.exports = function(grunt, taskObject){

var done = this.async(),
version = taskObject.pkg.version,
clientComponentDir = '../../components/oc-client/',
clientComponentDir = '../../src/components/oc-client/',
licenseRow = '/*! OpenComponents client v{0} | (c) 2015-{1} OpenTable, Inc. | {2} */',
licenseLink = 'https://github.com/opentable/oc/tree/master/components/oc-client/LICENSES',
licenseLink = 'https://github.com/opentable/oc/tree/master/src/components/oc-client/LICENSES',
license = format(licenseRow, version, new Date().getFullYear(), licenseLink),
headLoad = fs.readFileSync(path.join(__dirname, clientComponentDir, 'src/head.load.js')).toString(),
ocClient = fs.readFileSync(path.join(__dirname, clientComponentDir, 'src/oc-client.js')).toString(),
Expand All @@ -34,7 +34,7 @@ module.exports = function(grunt, taskObject){
fs.writeFileSync(path.join(__dirname, clientComponentDir, 'src/oc-client.min.map'), compressed.map);
fs.writeFileSync(path.join(__dirname, '../../client/src/oc-client.min.js'), compressedCode);

var Local = require('../../cli/domain/local'),
var Local = require('../../src/cli/domain/local'),
local = new Local({ logger: { log: grunt.log.writeln }});

local.package(path.join(__dirname, clientComponentDir), function(err, res){
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"name": "oc",
"version": "0.30.2",
"description": "A framework for developing and distributing html components",
"main": "index.js",
"main": "./src/index.js",
"bin": {
"oc": "./oc-cli.js"
"oc": "./src/oc-cli.js"
},
"scripts": {
"test": "grunt test"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module.exports = function(){
fs.mkdirSync(publishPath);

var componentPackagePath = path.join(componentPath, 'package.json'),
ocPackagePath = path.join(__dirname, '../../package.json');
ocPackagePath = path.join(__dirname, '../../../package.json');

if(!fs.existsSync(componentPackagePath)){
return callback(new Error('component does not contain package.json'));
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion cli/domain/registry.js → src/cli/domain/registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var urlParser = require('../domain/url-parser');

var getOcVersion = function(){

var ocPackagePath = path.join(__dirname, '../../package.json'),
var ocPackagePath = path.join(__dirname, '../../../package.json'),
ocInfo = fs.readJsonSync(ocPackagePath);

return ocInfo.version;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion cli/facade/version.js → src/cli/facade/version.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var packageInfo = require('../../package.json');
var packageInfo = require('../../../package.json');

module.exports = function(dependencies){
return function(){
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"base-component-handlebars","description":"","version":"1.0.0","repository":"","oc":{"files":{"template":{"type":"handlebars","hashKey":"a34cffd0625f1eb8a08569f068cd4a9768104a91","src":"template.js"},"dataProvider":{"type":"node.js","hashKey":"c9286a76c6600084f39b7cb129c97b4bddb1dd03","src":"server.js"},"static":[]},"version":"0.30.2","packaged":true,"date":1461887688441}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"use strict";module.exports.data=function(t,u){u(null,{})};

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/components/base-component-jade/_package/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"base-component-jade","description":"","version":"1.0.0","repository":"","oc":{"files":{"template":{"type":"jade","hashKey":"107f7eeca8a523c5d770539f9e51e561a2f217f3","src":"template.js"},"dataProvider":{"type":"node.js","hashKey":"c9286a76c6600084f39b7cb129c97b4bddb1dd03","src":"server.js"},"static":[]},"version":"0.30.2","packaged":true,"date":1461887688472}}
1 change: 1 addition & 0 deletions src/components/base-component-jade/_package/server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"use strict";module.exports.data=function(t,u){u(null,{})};
1 change: 1 addition & 0 deletions src/components/base-component-jade/_package/template.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"oc-client","description":"The OpenComponents client-side javascript client","version":"0.30.2","repository":"https://github.com/opentable/oc/tree/master/components/oc-client","author":"Matteo Figus <matteofigus@gmail.com>","oc":{"container":false,"renderInfo":false,"minify":false,"parameters":{},"files":{"template":{"type":"handlebars","hashKey":"bb774de6a2b7280c2b66103bd36d7e708a1b7541","src":"template.js"},"static":["src"],"dataProvider":{"type":"node.js","hashKey":"ffb0e43eaf72f55fa13dc1e7262019c14c3dfc81","src":"server.js"}},"version":"0.30.2","packaged":true,"date":1461143035821}}
{"name":"oc-client","description":"The OpenComponents client-side javascript client","version":"0.30.2","repository":"https://github.com/opentable/oc/tree/master/components/oc-client","author":"Matteo Figus <matteofigus@gmail.com>","oc":{"container":false,"renderInfo":false,"minify":false,"parameters":{},"files":{"template":{"type":"handlebars","hashKey":"bb774de6a2b7280c2b66103bd36d7e708a1b7541","src":"template.js"},"static":["src"],"dataProvider":{"type":"node.js","hashKey":"ffb0e43eaf72f55fa13dc1e7262019c14c3dfc81","src":"server.js"}},"version":"0.30.2","packaged":true,"date":1461887688497}}
File renamed without changes.
2 changes: 1 addition & 1 deletion index.js → src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict';

module.exports.Client = require('./client');
module.exports.Client = require('../client');
module.exports.Registry = require('./registry');
File renamed without changes.
2 changes: 1 addition & 1 deletion registry/app-start.js → src/registry/app-start.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var format = require('stringformat');
var path = require('path');
var _ = require('underscore');

var packageInfo = require('../package.json');
var packageInfo = require('../../package.json');

module.exports = function(repository, options, callback){

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var path = require('path');
var _ = require('underscore');

var ComponentsCache = require('./components-cache');
var packageInfo = require('../../package.json');
var packageInfo = require('../../../package.json');
var S3 = require('./s3');
var settings = require('../../resources/settings');
var strings = require('../../resources');
Expand Down Expand Up @@ -47,7 +47,7 @@ module.exports = function(conf){
},
getComponentVersions: function(componentName, callback){
if(componentName === 'oc-client'){
return callback(null, [fs.readJsonSync(path.join(__dirname, '../../package.json')).version]);
return callback(null, [fs.readJsonSync(path.join(__dirname, '../../../package.json')).version]);
}

if(!_.contains(local.getComponents(), componentName)){
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
var format = require('stringformat');
var semver = require('semver');

var packageInfo = require('../../../package.json');
var packageInfo = require('../../../../package.json');

module.exports = function(userAgent, nodeVersion) {
var result = { isValid: false};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
var format = require('stringformat');
var semver = require('semver');

var packageInfo = require('../../../package.json');
var packageInfo = require('../../../../package.json');

module.exports = function(userAgent) {
var result = { isValid: false};
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var format = require('stringformat');
var vm = require('vm');
var _ = require('underscore');

var Client = require('../../../client');
var Client = require('../../../../client');
var detective = require('../../domain/plugins-detective');
var eventsHandler = require('../../domain/events-handler');
var GetComponentRetrievingInfo = require('./get-component-retrieving-info');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var async = require('async');
var _ = require('underscore');

var dateStringified = require('../../utils/date-stringify');
var packageInfo = require('../../package.json');
var packageInfo = require('../../../package.json');
var urlBuilder = require('../domain/url-builder');

module.exports = function(repository){
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion test/acceptance/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('The node.js OC client', function(){
client,
clientOfflineRegistry,
result,
oc = require('../../index'),
oc = require('../../src/index'),
$component,
conf = {
local: true,
Expand Down
2 changes: 1 addition & 1 deletion test/acceptance/registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe('registry', function(){
var registry,
result,
error,
oc = require('../../index'),
oc = require('../../src/index'),
conf = {
local: true,
path: path.resolve('test/fixtures/components'),
Expand Down
4 changes: 2 additions & 2 deletions test/configuration/karma-common.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ module.exports = {
'test-settings.js',

// The oc-client bundle
'../../components/oc-client/src/head.load.js',
'../../components/oc-client/src/oc-client.js',
'../../src/components/oc-client/src/head.load.js',
'../../src/components/oc-client/src/oc-client.js',

// The tests
'../front-end/*.js'
Expand Down
2 changes: 1 addition & 1 deletion test/unit/cli-domain-get-components-by-dir.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var initialise = function(){
}
};

var GetComponentsByDir = injectr('../../cli/domain/get-components-by-dir.js', {
var GetComponentsByDir = injectr('../../src/cli/domain/get-components-by-dir.js', {
'fs-extra': fsMock,
path: pathMock
}, { __dirname: '' });
Expand Down
2 changes: 1 addition & 1 deletion test/unit/cli-domain-get-local-npm-modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var initialise = function(){
}
};

var GetLocalNpmModules = injectr('../../cli/domain/get-local-npm-modules.js', {
var GetLocalNpmModules = injectr('../../src/cli/domain/get-local-npm-modules.js', {
'fs-extra': fsMock,
path: pathMock
}, { __dirname: '' });
Expand Down
2 changes: 1 addition & 1 deletion test/unit/cli-domain-get-mocked-plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var initialise = function(fs){
writeFile: sinon.stub().yields(null, 'ok')
}, fs || {});

getMockedPlugins = injectr('../../cli/domain/get-mocked-plugins.js', {
getMockedPlugins = injectr('../../src/cli/domain/get-mocked-plugins.js', {
'fs-extra': fsMock,
path: {
resolve: function(){
Expand Down
2 changes: 1 addition & 1 deletion test/unit/cli-domain-mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var initialise = function(){
}
};

var Local = injectr('../../cli/domain/mock.js', {
var Local = injectr('../../src/cli/domain/mock.js', {
'fs-extra': fsMock,
path: pathMock
}, { __dirname: '' });
Expand Down
2 changes: 1 addition & 1 deletion test/unit/cli-domain-package-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var initialise = function(){
}
};

var Local = injectr('../../cli/domain/package-components.js', {
var Local = injectr('../../src/cli/domain/package-components.js', {
'fs-extra': fsMock,
'uglify-js': {
minify: function(code){
Expand Down
2 changes: 1 addition & 1 deletion test/unit/cli-domain-package-server-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var initialise = function(fs){
writeFile: sinon.stub().yields(null, 'ok')
}, fs || {});

packageServerScript = injectr('../../cli/domain/package-server-script.js', {
packageServerScript = injectr('../../src/cli/domain/package-server-script.js', {
'fs-extra': fsMock,
path: {
extname: path.extname,
Expand Down
2 changes: 1 addition & 1 deletion test/unit/cli-domain-package-static-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var packageStaticFiles,
mocks;

var initialise = function(mocks, params, cb){
packageStaticFiles = injectr('../../cli/domain/package-static-files.js', mocks, { console: console });
packageStaticFiles = injectr('../../src/cli/domain/package-static-files.js', mocks, { console: console });
packageStaticFiles(params, function(e, r){
error = e;
cb();
Expand Down
2 changes: 1 addition & 1 deletion test/unit/cli-domain-package-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var initialise = function(fs, uglifyStub){
writeFile: sinon.stub().yields(null, 'ok')
}, fs || {});

packageTemplate = injectr('../../cli/domain/package-template.js', {
packageTemplate = injectr('../../src/cli/domain/package-template.js', {
'fs-extra': fsMock,
'uglify-js': {
minify: uglifyStub || function(code){
Expand Down
2 changes: 1 addition & 1 deletion test/unit/cli-domain-registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var sinon = require('sinon');
var getRegistry = function(dependencies, opts){
dependencies.fs = dependencies.fs || {};
dependencies.fs.readJsonSync = sinon.stub().returns({ version: '1.2.3' });
var Registry = injectr('../../cli/domain/registry.js', {
var Registry = injectr('../../src/cli/domain/registry.js', {
'minimal-request': dependencies.request,
'fs-extra': dependencies.fs,
'../../utils/put': dependencies.put,
Expand Down
2 changes: 1 addition & 1 deletion test/unit/cli-domain-url-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('cli : domain : url-parser', function(){

var parsed;
var execute = function(url, returnVersion){
var urlParser = require('../../cli/domain/url-parser');
var urlParser = require('../../src/cli/domain/url-parser');

parsed = urlParser.parse({
href: url,
Expand Down
4 changes: 2 additions & 2 deletions test/unit/cli-facade-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ var sinon = require('sinon');
describe('cli : facade : dev', function(){

var logSpy = {},
DevFacade = require('../../cli/facade/dev'),
Local = require('../../cli/domain/local'),
DevFacade = require('../../src/cli/facade/dev'),
Local = require('../../src/cli/domain/local'),
local = new Local({ logger: { log: function(){} } }),
npm = require('npm'),
devFacade = new DevFacade({ local: local, logger: logSpy });
Expand Down
4 changes: 2 additions & 2 deletions test/unit/cli-facade-init.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ var sinon = require('sinon');
describe('cli : facade : init', function(){

var logSpy = {},
InitFacade = require('../../cli/facade/init'),
Local = require('../../cli/domain/local'),
InitFacade = require('../../src/cli/facade/init'),
Local = require('../../src/cli/domain/local'),
local = new Local({ logger: { log: function(){} } }),
initFacade = new InitFacade({ local: local, logger: logSpy });

Expand Down
4 changes: 2 additions & 2 deletions test/unit/cli-facade-mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ var sinon = require('sinon');
describe('cli : facade : mock', function(){

var logSpy = {},
MockFacade = require('../../cli/facade/mock'),
Local = require('../../cli/domain/local'),
MockFacade = require('../../src/cli/facade/mock'),
Local = require('../../src/cli/domain/local'),
local = new Local({ logger: { log: function(){}}}),
mockFacade = new MockFacade({ local: local, logger: logSpy });

Expand Down
2 changes: 1 addition & 1 deletion test/unit/cli-facade-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('cli : facade : preview', function(){
registryStub = { getComponentPreviewUrlByUrl: sinon.stub().yields(error, url)};
logSpy = { log: sinon.spy()};

var PreviewFacade = injectr('../../cli/facade/preview.js', { opn: opnSpy }),
var PreviewFacade = injectr('../../src/cli/facade/preview.js', { opn: opnSpy }),
previewFacade = new PreviewFacade({ logger: logSpy, registry: registryStub });

previewFacade({ componentHref: 'http://components.com/component' }, function(){});
Expand Down
6 changes: 3 additions & 3 deletions test/unit/cli-facade-publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ var _ = require('underscore');
describe('cli : facade : publish', function(){

var logSpy = {},
Registry = require('../../cli/domain/registry'),
Registry = require('../../src/cli/domain/registry'),
registry = new Registry(),
Local = require('../../cli/domain/local'),
Local = require('../../src/cli/domain/local'),
local = new Local({ logger: { log: function(){} } }),
readStub = sinon.stub().yields(null, 'test'),
PublishFacade = injectr('../../cli/facade/publish.js', { read: readStub }),
PublishFacade = injectr('../../src/cli/facade/publish.js', { read: readStub }),
publishFacade = new PublishFacade({ registry: registry, local: local, logger: logSpy });

var execute = function(cb, creds){
Expand Down
4 changes: 2 additions & 2 deletions test/unit/cli-facade-registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ var sinon = require('sinon');
describe('cli : facade : registry', function(){

var logSpy = {},
Registry = require('../../cli/domain/registry'),
Registry = require('../../src/cli/domain/registry'),
registry = new Registry(),
RegistryFacade = require('../../cli/facade/registry'),
RegistryFacade = require('../../src/cli/facade/registry'),
registryFacade = new RegistryFacade({ registry: registry, logger: logSpy });

var execute = function(command){
Expand Down
4 changes: 2 additions & 2 deletions test/unit/registry-app-start.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ var injectr = require('injectr');
var sinon = require('sinon');

var getAppStart = function(mockedRepository, options, callback){
var appStart = injectr('../../registry/app-start.js', {
'../package.json': { version: '1.2.3' }
var appStart = injectr('../../src/registry/app-start.js', {
'../../package.json': { version: '1.2.3' }
}, { console: { log: sinon.stub() }, __dirname: '.'});

return appStart(mockedRepository, options, callback);
Expand Down
2 changes: 1 addition & 1 deletion test/unit/registry-domain-components-cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('registry : domain : components-cache', function(){
clearIntervalStub = sinon.stub();
setIntervalStub = sinon.stub();
eventsHandlerStub = { fire: sinon.stub() };
var ComponentsCache = injctr('../../registry/domain/components-cache.js', {
var ComponentsCache = injctr('../../src/registry/domain/components-cache.js', {
'../../utils/get-unix-utc-timestamp': function(){
return 12345678;
},
Expand Down
Loading