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

Merge source app.js methods into target app.js #14

Open
KenEucker opened this issue Jun 12, 2021 · 1 comment
Open

Merge source app.js methods into target app.js #14

KenEucker opened this issue Jun 12, 2021 · 1 comment

Comments

@KenEucker
Copy link
Owner

Now that we are forming a structure for the app.js model, including lifecycle methods, we can implement polymorphism to load the downloaded sourcefiles app.js methods in a chain operation.

IE:
The BikeTag Website project has source files from the BikeTag App project. The final deployed solution, biketag-infra, which uses the BikeTag Website as it's source, would end up with the files:

app.js
biketag-website.app.js
biketag-app.app.js

app.js pseudocode:

import sexpress
import biketag-website as biketagWebsite
import biketag-app as biketagApp

class sexpressApplication {

  onConfigurationLoad: (siteConfig) => {

     let finalSiteConfiguration = siteConfig
     finalSiteConfiguration = { ...finalSiteConfiguration, ...biketagWebsite.onConfigurationLoad(finalSiteConfiguration) }
     finalSiteConfiguration = { ...finalSiteConfiguration, ...biketagApp.onConfigurationLoad(finalSiteConfiguration) }

     return finalSiteConfiguration
  }

  onPageDataRequest: (siteConfig) => {

     let finalPageData = siteConfig
     finalPageData = { ...finalPageData, ...biketagWebsite.onPageDataRequest(finalPageData) }
     finalPageData = { ...finalPageData, ...biketagApp.onPageDataRequest(finalPageData) }

     return finalPageData

  }

  onAppStart: () => {
    biketagWebsite.onAppStart()
    biketagApp.onAppStart()
  }

  run: () => {
    const app = sexpress(this)
    app.run(this.onAppStart)

    return this
  }

}

const applicationInstance = new sexpressApplication().run()

This feature should change the existing "generate" config from the following fields:

...
  "source": "https://github.com/biketagorg/biketag-app/archive/production.zip",
  "templatesSource": "https://github.com/biketagorg/biketag-website/archive/production.zip"
...

to:

  "applicationChain": [
    "https://github.com/biketagorg/biketag-website",
    "https://github.com/biketagorg/biketag-app"
  ]

The feature outlined above will aid the deployment of mode-based seXpress application subsets and combinations.

@KenEucker
Copy link
Owner Author

In fact, all of these options should change to suit the new application chaining feature:

		"enabled": true,
		"copyServerFile": true,
		"copyControllers": true,
		"copyLib": true,
		"copySrc": true,
		"copyConfigJs": true,
		"copySourceConfig": false,
		"copyTemplateConfig": true,
		"importDependencies": true,
		"keepExistingDepdencyVersions": true,
		"copyPrivateConfig": true,

And instead should become single application environment variables, configured like so:

  "applicationChain": {
    "https://github.com/biketagorg/biketag-website": {
      "copyConfigJs": true,
      "copyLib": false,
      "copySrc": false,
      "keepExistingDepdencyVersions": true,
    },
    "https://github.com/biketagorg/biketag-app": {
      "copyConfigJs": false,
      "copyLib": true,
      "copySrc": true,
      "keepExistingDepdencyVersions": false
    }
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant