Skip to content
This repository has been archived by the owner on Mar 13, 2021. It is now read-only.

Commit

Permalink
Merge pull request #124 from ShipEngine/PLAT-1587-generated-files-cha…
Browse files Browse the repository at this point in the history
…nges-only

don't copy files that are unnecessary for order apps
  • Loading branch information
anthonyshull committed Jan 20, 2021
2 parents 56b84d7 + e47ab7a commit 02ef103
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 28 deletions.
27 changes: 6 additions & 21 deletions src/core/generators/apps-new.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,13 +258,6 @@ class AppsNew extends Generator {
);
}


this.fs.copyTpl(
this.templatePath("connect.config.js"),
this.destinationPath("connect.config.js"),
this,
);

if (this.fs.exists(this.destinationPath("./package.json"))) {
fixpack(
this.destinationPath("./package.json"),
Expand All @@ -277,12 +270,6 @@ class AppsNew extends Generator {
sortPjson(this.pjson),
);

this.fs.copyTpl(
this.templatePath("connect.config.js"),
this.destinationPath("connect.config.js"),
this,
);

this.fs.copyTpl(
this.templatePath("README.md.ejs"),
this.destinationPath("README.md"),
Expand All @@ -308,6 +295,12 @@ class AppsNew extends Generator {

switch (this.type) {
case AppType.Carrier:
this.fs.copyTpl(
this.templatePath("connect.config.js"),
this.destinationPath("connect.config.js"),
this,
);

if (!fs.existsSync("src")) {
this.fs.copyTpl(
this.templatePath(`carrier/index.${this._definitionExt}`),
Expand Down Expand Up @@ -468,14 +461,6 @@ class AppsNew extends Generator {
this,
);

this.fs.copyTpl(
this.templatePath(
`order-source/forms/settings.${this._definitionExt}`,
),
this.destinationPath(`src/forms/settings.${this._definitionExt}`),
this,
);

this.fs.copyTpl(
this.templatePath(
`order-source/methods/get-sales-order-by-date.${this._codeExt}`,
Expand Down
1 change: 0 additions & 1 deletion templates/order-source/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ websiteURL: https://www.order-source.com
logo: ./logo.svg
icon: ./logo.svg
connectionForm: ./forms/connect.yaml
settingsForm": ./forms/settings.yaml

getSalesOrdersByDate: ./methods/get-sales-order-by-date.<%- _codeExt %>
shipmentCreated: ./methods/shipment-created.<%- _codeExt %>
Expand Down
6 changes: 0 additions & 6 deletions test/specs/core/generators/apps-new.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,6 @@ describe("new generator", () => {
"src/methods/shipment-created.js",
"src/methods/acknowledge-orders.js",
"src/forms/connect.yaml",
"src/forms/settings.yaml",
"README.md",
".npmignore",
"package.json",
Expand Down Expand Up @@ -389,7 +388,6 @@ describe("new generator", () => {
"src/methods/shipment-created.ts",
"src/methods/acknowledge-orders.ts",
"src/forms/connect.ts",
"src/forms/settings.ts",
"README.md",
".npmignore",
"package.json",
Expand Down Expand Up @@ -434,7 +432,6 @@ describe("new generator", () => {
"src/methods/shipment-created.ts",
"src/methods/acknowledge-orders.ts",
"src/forms/connect.json",
"src/forms/settings.json",
"README.md",
"package.json",
".npmignore",
Expand Down Expand Up @@ -478,7 +475,6 @@ describe("new generator", () => {
"src/methods/shipment-created.ts",
"src/methods/acknowledge-orders.ts",
"src/forms/connect.yaml",
"src/forms/settings.yaml",
"README.md",
"package.json",
".npmignore",
Expand Down Expand Up @@ -523,7 +519,6 @@ describe("new generator", () => {
"src/methods/shipment-created.js",
"src/methods/acknowledge-orders.js",
"src/forms/connect.json",
"src/forms/settings.json",
"README.md",
".npmignore",
"package.json",
Expand Down Expand Up @@ -565,7 +560,6 @@ describe("new generator", () => {
"src/methods/shipment-created.js",
"src/methods/acknowledge-orders.js",
"src/forms/connect.yaml",
"src/forms/settings.yaml",
"README.md",
".npmignore",
"package.json",
Expand Down

0 comments on commit 02ef103

Please sign in to comment.