Skip to content

Commit d8ef821

Browse files
author
sanscontext
committed
swap over to papi, rename old catalog to _capi, add new Make command
1 parent 6854a92 commit d8ef821

14 files changed

+25666
-25643
lines changed

Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,17 @@ package: build
4949
serve: package
5050
@docker run -p 4000:80 segment-docs:latest
5151

52+
# gives us user-transparent way to swap between two different systems
5253
.PHONY: catalog
54+
catalog: catalog-papi
55+
56+
.PHONY: catalog-capi
5357
catalog: vendor/bundle
54-
@node scripts/catalog.js
58+
@node scripts/catalog-capi.js
5559

56-
.PHONY: papi
60+
.PHONY: catalog-papi
5761
papi: vendor/bundle
58-
@node scripts/papi.js
62+
@node scripts/catalog_papi.js
5963

6064
.PHONY: changelog
6165
changelog: vendor/bundle

scripts/catalog.js renamed to scripts/catalog_capi.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,14 +304,14 @@ const updateSources = async () => {
304304
output = "# AUTOGENERATED FROM PLATFORM API. DO NOT EDIT\n"
305305
output += "# sources last updated " + todayDate + " \n";
306306
output += yaml.safeDump({ items: sourcesUpdated }, options);
307-
fs.writeFileSync(path.resolve(__dirname, `../src/_data/catalog/sources.yml`), output);
307+
fs.writeFileSync(path.resolve(__dirname, `../src/_data/catalog/sources_capi.yml`), output);
308308

309309
// Create source-category mapping yaml file
310310
var todayDate = new Date().toISOString().slice(0,10);
311311
output = "# AUTOGENERATED FROM PLATFORM API. DO NOT EDIT\n"
312312
output += "# source cateogries last updated " + todayDate + " \n";
313313
output += yaml.safeDump({ items: sourceCategories }, options);
314-
fs.writeFileSync(path.resolve(__dirname, `../src/_data/catalog/source_categories.yml`), output);
314+
fs.writeFileSync(path.resolve(__dirname, `../src/_data/catalog/source_categories_capi.yml`), output);
315315
}
316316

317317
const updateDestinations = async () => {
@@ -414,14 +414,14 @@ const updateDestinations = async () => {
414414
var todayDate = new Date().toISOString().slice(0,10);
415415
output += "# destination data last updated " + todayDate + " \n";
416416
output += yaml.safeDump({ items: destinationsUpdated }, options);
417-
fs.writeFileSync(path.resolve(__dirname, `../src/_data/catalog/destinations.yml`), output);
417+
fs.writeFileSync(path.resolve(__dirname, `../src/_data/catalog/destinations_capi.yml`), output);
418418

419419
// Create destination-category mapping yaml file
420420
output = "# AUTOGENERATED FROM PLATFORM API. DO NOT EDIT\n"
421421
var todayDate = new Date().toISOString().slice(0,10);
422422
output += "# destination categories last updated " + todayDate + " \n";
423423
output += yaml.safeDump({ items: destinationCategories }, options);
424-
fs.writeFileSync(path.resolve(__dirname, `../src/_data/catalog/destination_categories.yml`), output);
424+
fs.writeFileSync(path.resolve(__dirname, `../src/_data/catalog/destination_categories_capi.yml`), output);
425425
}
426426

427427
updateSources()

scripts/papi.js renamed to scripts/catalog_papi.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -330,14 +330,14 @@ const updateSources = async () => {
330330
output = "# AUTOGENERATED FROM PUBLIC API. DO NOT EDIT\n"
331331
output += "# sources last updated " + todayDate + " \n";
332332
output += yaml.safeDump({ items: sourcesUpdated }, options);
333-
fs.writeFileSync(path.resolve(__dirname, `../src/_data/catalog/sources_papi.yml`), output);
333+
fs.writeFileSync(path.resolve(__dirname, `../src/_data/catalog/sources.yml`), output);
334334

335335
// Create source-category mapping yaml file
336336
var todayDate = new Date().toISOString().slice(0,10);
337337
output = "# AUTOGENERATED FROM PUBLIC API. DO NOT EDIT\n"
338338
output += "# source cateogries last updated " + todayDate + " \n";
339339
output += yaml.safeDump({ items: sourceCategories }, options);
340-
fs.writeFileSync(path.resolve(__dirname, `../src/_data/catalog/source_categories_papi.yml`), output);
340+
fs.writeFileSync(path.resolve(__dirname, `../src/_data/catalog/source_categories.yml`), output);
341341

342342

343343

@@ -437,14 +437,14 @@ const updateDestinations = async () => {
437437
var todayDate = new Date().toISOString().slice(0,10);
438438
output += "# destination data last updated " + todayDate + " \n";
439439
output += yaml.safeDump({ items: destinationsUpdated }, options);
440-
fs.writeFileSync(path.resolve(__dirname, `../src/_data/catalog/destinations_papi.yml`), output);
440+
fs.writeFileSync(path.resolve(__dirname, `../src/_data/catalog/destinations.yml`), output);
441441

442442
// Create destination-category mapping yaml file
443443
output = "# AUTOGENERATED FROM PUBLIC API. DO NOT EDIT\n"
444444
var todayDate = new Date().toISOString().slice(0,10);
445445
output += "# destination categories last updated " + todayDate + " \n";
446446
output += yaml.safeDump({ items: destinationCategories }, options);
447-
fs.writeFileSync(path.resolve(__dirname, `../src/_data/catalog/destination_categories_papi.yml`), output);
447+
fs.writeFileSync(path.resolve(__dirname, `../src/_data/catalog/destination_categories.yml`), output);
448448
}
449449

450450
const updateWarehouses = async () => {
@@ -497,7 +497,7 @@ const updateWarehouses = async () => {
497497
var todayDate = new Date().toISOString().slice(0,10);
498498
output += "# warehouse data last updated " + todayDate + " \n";
499499
output += yaml.safeDump({ items: warehousesUpdated }, options);
500-
fs.writeFileSync(path.resolve(__dirname, `../src/_data/catalog/warehouses_papi.yml`), output);
500+
fs.writeFileSync(path.resolve(__dirname, `../src/_data/catalog/warehouses.yml`), output);
501501

502502
}
503503

src/_data/catalog/destination_categories.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# AUTOGENERATED FROM PLATFORM API. DO NOT EDIT
1+
# AUTOGENERATED FROM PUBLIC API. DO NOT EDIT
22
# destination categories last updated 2021-06-30
33
items:
44
- display_name: A/B Testing

src/_data/catalog/destination_categories_papi.yml renamed to src/_data/catalog/destination_categories_capi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# AUTOGENERATED FROM PUBLIC API. DO NOT EDIT
1+
# AUTOGENERATED FROM PLATFORM API. DO NOT EDIT
22
# destination categories last updated 2021-06-30
33
items:
44
- display_name: A/B Testing

0 commit comments

Comments
 (0)