Skip to content

Commit

Permalink
Move main entry to index in lib dir
Browse files Browse the repository at this point in the history
  • Loading branch information
mdtusz committed Jan 20, 2016
1 parent 38691f8 commit 72c540e
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 44 deletions.
35 changes: 35 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/**
* Copyright 2012-2016, Plotly, Inc.
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

'use strict';

/*
* This file is browserify'ed into a standalone 'Plotly' object.
*/

var Core = require('./core');

// Load all trace modules
Core.register([
require('./bar'),
require('./box'),
require('./heatmap'),
require('./histogram'),
require('./histogram2d'),
require('./histogram2dcontour'),
require('./pie'),
require('./contour'),
require('./scatter3d'),
require('./surface'),
require('./mesh3d'),
require('./scattergeo'),
require('./choropleth'),
require('./scattergl')
]);

module.exports = Core;
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "1.4.1",
"description": "The open source javascript graphing library that powers plotly",
"license": "MIT",
"main": "./src/index.js",
"webpack": "./dist/plotly.min.js",
"main": "./lib/index.js",
"webpack": "./dist/plotly.js",

This comment has been minimized.

Copy link
@etpinard

etpinard Jan 20, 2016

Contributor

Right. Let webpack users minified their own bundle.

"repository": {
"type": "git",
"url": "https://github.com/plotly/plotly.js.git"
Expand Down
35 changes: 0 additions & 35 deletions src/index.js

This file was deleted.

4 changes: 3 additions & 1 deletion tasks/util/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var pkg = require('../../package.json');

var pathToRoot = path.join(__dirname, '../../');
var pathToSrc = path.join(pathToRoot, 'src/');
var pathToLib = path.join(pathToRoot, 'lib/');
var pathToImageTest = path.join(pathToRoot, 'test/image');
var pathToDist = path.join(pathToRoot, 'dist/');
var pathToBuild = path.join(pathToRoot, 'build/');
Expand All @@ -17,8 +18,9 @@ var year = (new Date()).getFullYear();
module.exports = {
pathToRoot: pathToRoot,
pathToSrc: pathToSrc,
pathToLib: pathToLib,

pathToPlotlySrc: path.join(pathToSrc, 'index.js'),
pathToPlotlySrc: path.join(pathToLib, 'index.js'),

This comment has been minimized.

Copy link
@etpinard

etpinard Jan 20, 2016

Contributor

we should rename pathToPloltySrc -> pathToPlotlyIndex to avoid confusion later on.

pathToPlotlyCore: path.join(pathToSrc, 'core.js'),
pathToPlotlyBuild: path.join(pathToBuild, 'plotly.js'),
pathToPlotlyDist: path.join(pathToDist, 'plotly.js'),
Expand Down
1 change: 1 addition & 0 deletions tasks/util/shortcut_paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ var constants = require('./constants');

var shortcutsConfig = {
'@src': constants.pathToSrc,
'@lib': constants.pathToLib,

This comment has been minimized.

Copy link
@etpinard

etpinard Jan 20, 2016

Contributor

🎉

'@mocks': constants.pathToTestImageMocks
};

Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/tests/click_test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Plotly = require('@src/index');
var Plotly = require('@lib/index');
var Lib = require('@src/lib');

var createGraphDiv = require('../assets/create_graph_div');
Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/tests/gl_plot_interact_test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var d3 = require('d3');

var Plotly = require('@src/index');
var Plotly = require('@lib/index');

var createGraphDiv = require('../assets/create_graph_div');
var destroyGraphDiv = require('../assets/destroy_graph_div');
Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/tests/hover_label_test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var d3 = require('d3');

var Plotly = require('@src/index');
var Plotly = require('@lib/index');
var Fx = require('@src/plots/cartesian/graph_interact');
var Lib = require('@src/lib');

Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/tests/hover_pie_test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Plotly = require('@src/index');
var Plotly = require('@lib/index');
var Lib = require('@src/lib');

var createGraphDiv = require('../assets/create_graph_div');
Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/tests/plot_api_test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Plotly = require('@src');
var Plotly = require('@lib/index');
var PlotlyInternal = require('@src/plotly');
var Plots = require('@src/plots/plots');
var Lib = require('@src/lib');
Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/tests/plot_interact_test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var d3 = require('d3');

var Plotly = require('@src/index');
var Plotly = require('@lib/index');

var createGraphDiv = require('../assets/create_graph_div');
var destroyGraphDiv = require('../assets/destroy_graph_div');
Expand Down

0 comments on commit 72c540e

Please sign in to comment.