Skip to content

Commit 76588ae

Browse files
committed
use make-schema for writing to build as well as dist
1 parent 94a83dc commit 76588ae

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"stats": "node tasks/stats.js",
2929
"find-strings": "node tasks/find_locale_strings.js",
3030
"preprocess": "node tasks/preprocess.js",
31-
"build": "node tasks/empty_dist.js && npm run preprocess && npm run find-strings && npm run bundle && npm run extra-bundles && npm run make-schema && npm run stats",
31+
"build": "node tasks/empty_dist.js && npm run preprocess && npm run find-strings && npm run bundle && npm run extra-bundles && npm run make-schema dist && npm run stats",
3232
"cibuild": "node tasks/empty_dist.js && npm run preprocess && node tasks/cibundle.js",
3333
"watch": "node tasks/watch.js",
3434
"lint": "eslint --version && eslint .",

tasks/make_schema.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,15 @@ function makeSchema(plotlyPath, schemaPath) {
1414
console.log('ok ' + path.basename(schemaPath));
1515
}
1616

17-
var pathToSchema = constants.pathToSchema;
18-
var pathToPlotlyDistWithMeta = constants.pathToPlotlyDistWithMeta;
17+
var isDist = process.argv[2] === 'dist';
18+
19+
var pathToSchema = isDist ?
20+
constants.pathToSchemaDist :
21+
constants.pathToSchemaBuild;
22+
23+
var pathToPlotly = isDist ?
24+
constants.pathToPlotlyDistWithMeta :
25+
constants.pathToPlotlyBuild;
1926

2027
// output plot-schema JSON
21-
makeSchema(pathToPlotlyDistWithMeta, pathToSchema);
28+
makeSchema(pathToPlotly, pathToSchema);

tasks/util/constants.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ module.exports = {
183183
pathToPlotlyDistMin: path.join(pathToDist, 'plotly.min.js'),
184184
pathToPlotlyDistWithMeta: path.join(pathToDist, 'plotly-with-meta.js'),
185185

186-
pathToSchema: path.join(pathToDist, 'plot-schema.json'),
186+
pathToSchemaBuild: path.join(pathToBuild, 'plot-schema.json'),
187+
pathToSchemaDist: path.join(pathToDist, 'plot-schema.json'),
187188
pathToTranslationKeys: path.join(pathToDist, 'translation-keys.txt'),
188189

189190
partialBundleNames: partialBundleNames,

0 commit comments

Comments
 (0)