deftjs / DeftJS

Extensions for Large-Scale Sencha Touch and Ext JS Applications
http://deftjs.org/
MIT License
285 stars 56 forks source link

Sencha Cmd based Package & Build Process #91

Closed superstructor closed 11 years ago

superstructor commented 11 years ago

The root of the repository is a Sencha Cmd workspace.

The DeftJS package is in packages/deft.

The main build script is packages/deft/build.xml

The Node.js / NPM package.json remains in the root of the repository.

The Sencha Cmd package.json is packages/deft/packages.json.

Storing the entire workspace in the repository gives us the required separation of the two incompatible package.json formats.

Sources are in packages/deft/src/coffee, compiled into JavaScript during sencha package build to packages/deft/src/js, and concatenated into deft.js and deft-debug.js to packages/deft/build.

Tests are in packages/deft/test/coffee, also compiled into JavaScript during sencha package build to packages/deft/test/js. Everything else is copied as-is for tests. The existing ant task packages/deft/test/build.xml is simply included from packages/deft/build.xml.

Test are still run via cd packages/deft && ant test and not part of the sencha package build process yet but there is nothing stopping us from hooking into a Sencha Cmd extension point.

Documentation is built during sencha package build (-before-pkg) into packages/deft/docs, this means it is in the resulting package zip file build/deft/deft.pkg.

Outstanding Issues

  1. Copyright notice is not added to the head of the built deft.js and deft-debug.js. This used to be done during concatenation. Not sure how to do this.
  2. // Generated by CoffeeScript lines not stripped from compiled JavaScripts. This used to be done during concatenation. Not sure how to do this.
  3. SASS / SCSS is compiled but is not needed for DeftJS. This is just default Sencha Cmd package stuff (e.g. for a theme package) that we need to work out how to remove. Doesn't break anything just a bit untidy.
  4. package/deft/build directory needs to be committed for tests to pass on Travis CI. Trivial just left out until we decided what to do re 1, 2 ,3.
  5. creator property in packages/deft/package.json needs to be changed to match the local repository name of the person who will build deployable packages and sign with their encryption keys (i.e. John). Currently "anonymous". To setup this just run sencha repo init -name "The name of the creator", backup your encryption keys from you local repo (in Sencha Cmd install location), and change creator in package.json to "The name of the creator". Then sencha package build (inside the packages/deft directory) should sign the deft.pkg file with your encryption key, you can confirm this by looking at the console output of sencha package build.
  6. Deployment of John's local repository to http://deftjs.org, as far as I can tell basically involves copying the required files to a static HTTP server.
  7. README.md potentially needs some updates to cover the Sencha Cmd installation from the deftjs.org repository, repo structure and/or build process
superstructor commented 11 years ago

Also before making the pull request I rebased on the latest commit on master f07da0b2db. So it should be a clean merge.

brian428 commented 11 years ago

Hmm...looks like we've lost the documentation generation?

superstructor commented 11 years ago

The documentation is still generated via build.xml and at the -before-pkg Sencha Cmd extension point.

See https://github.com/superstructor/DeftJS/blob/1b834121f9cdb82a9bc03dc224993743b6419adb/packages/deft/build.xml#L55

I deleted it from being committed to the repository with the thought of keeping generated artefacts out of the source repository as much as possible. That turns out to be quite difficult for everything else anyway because we need the JS sources and builds for tests.

So I've re-added the documentation to the repository in the latest commit so it is the same as before.

superstructor commented 11 years ago

Re-added built JavaScript files i.e. deft.js, deft-debug.js, deft-dev.js TravisCI build is now passing.

superstructor commented 11 years ago

The overall package structure of having the workspace as the repository root and the package in packages/deft is basically the same as used on the Sencha example repo except they are not doing CoffeeScript, testing or documentation generation as part of the build https://github.com/senchalabs/CmdPackages

johnyanarella commented 11 years ago

@superstructor Could you migrate the remaining action items above over to #85 when you get a chance?

superstructor commented 11 years ago

@johnyanarella Sure I'll open new issues for the remaining items above. Thanks for getting this merged! :-)

johnyanarella commented 11 years ago

No problem - thanks for your hard work on this!