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

Blueprints #747

Merged
merged 2 commits into from
Jun 9, 2014
Merged

Blueprints #747

merged 2 commits into from
Jun 9, 2014

Conversation

jgwhite
Copy link
Contributor

@jgwhite jgwhite commented May 16, 2014

Must have:

  • Make Blueprint a subclass of CoreObject
  • Blueprint.lookup + configurable load paths
  • Each blueprint/foo/index.js should export a subclass of Blueprint
  • Ensure type is not passed to model generator when generating resources
  • Acceptance test for project-specific blueprints
  • Add service blueprint
  • Add blueprint blueprint (yup)
  • Add api-stub blueprint
  • Fix intermittent timing failure in blueprint overwrite unit test
  • Ensure resource blueprint generates the right route declaration in router
  • ember generate route foo/index should not change router.js
  • Use multi-line POJOs in blueprinted constructors
  • Allow --blueprint options to accept explicit paths and names
  • Tighten up .jshintrc
  • Ensure .DS_Store files are ignored
  • Documentation

@jgwhite jgwhite changed the title Blueprints (WIP) [WIP] Blueprints May 18, 2014
@stefanpenner
Copy link
Contributor

wow this is amazing :) keep up the good work.

@jgwhite
Copy link
Contributor Author

jgwhite commented May 18, 2014

thanks! :)

@stefanpenner
Copy link
Contributor

i'll do a thorough read + provide feedback later tonight

var server;

try {
server = project.require('./server')(middleware);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would rather not have the try/catch. We should implement project.resolve like we have https://github.com/stefanpenner/ember-cli/blob/master/bin/ember#L7-L11

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Shall we add it here or ask @xtian to modify #715 and merge that?

@stefanpenner
Copy link
Contributor

Yes

@stefanpenner
Copy link
Contributor

this is looking great

"module": true,
"moduleFor": true,
"moduleForComponent": true,
"moduleForModel": true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some of these predef's are test specific predef's and should be kept in the tests dir

Typically my goal is to keep these (by default) as tight as possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 added to the todo list

@stefanpenner
Copy link
Contributor

left some feedback. I should be free parts of this weekend if you need :)

@jgwhite
Copy link
Contributor Author

jgwhite commented May 30, 2014

@stefanpenner thanks for the feedback. Really psyched that you think it’s headed in the right direction. Gonna respond to comments individually.

@jgwhite
Copy link
Contributor Author

jgwhite commented May 30, 2014

Gonna have to rebase. Have added comments to the todo list.

@jgwhite
Copy link
Contributor Author

jgwhite commented Jun 5, 2014

Note: 4a6d727 is a stopgap to address #900.

@stefanpenner
Copy link
Contributor

remember to remove "loom" from package.json

@jgwhite
Copy link
Contributor Author

jgwhite commented Jun 8, 2014

@stefanpenner thanks for the reminder.

Currently preparing to experiment with AST manipulation/assertion as per your recommendation.

@stefanpenner
Copy link
Contributor

@jgwhite should we ship what you have early? Then add the AST work as a subsequent PR?

I think this will already provide much needed value

@jgwhite
Copy link
Contributor Author

jgwhite commented Jun 8, 2014

If you think it’s ready then 👍

Allow me one last commit to add documentation then the rest of the stuff in the todo list can go in the wish list.

@jgwhite
Copy link
Contributor Author

jgwhite commented Jun 8, 2014

@stefanpenner also adding import Ember from 'ember'; to blueprints where appropriate.

@rwjblue
Copy link
Member

rwjblue commented Jun 8, 2014

I would love to see this land. It is clearly better than what we have now, and it'll be easier to iterate once folks can provide feedback (as they use it)....

@jgwhite
Copy link
Contributor Author

jgwhite commented Jun 8, 2014

Gonna wrap this up tonight if it kills me.

@stefanpenner
Copy link
Contributor

@jgwhite nice!

- Add lib/tasks/generate-from-blueprint
- Rework tests/acceptance/generate-test
- Rework lib/commands/generate command
- Rework tests/unit/commands/generate
- Tweak tests/acceptance/init-test

Drop loom-generators-ember-appkit from package.json template

Add literate test helpers

Add support for type on controller blueprint

Add component blueprint

Add helper test

Update test to kebab-case helper

Add simple model generator test

Add model generator and test

Add route generator and test

Add docs-in-comments to blueprints

Add route to router

Add ember-qunit imports to test blueprints

Fix model blueprint export

Add adapter blueprint

Add template and view blueprints

Also enhance assertFile

Add resource generator

Move server blueprint

Add initializer blueprint

Add mixin blueprint

Add serializer blueprint

Fix test naming for mixin and serializer blueprints

Add transform blueprint

Fix test imports in mixin blueprint

Add generate test packageName todo

Add util blueprint

Tweak generate TODOs

Move adapter test alongside serializer and transform

Improve util generator test

Still need to figure out testing helpers with ember-qunit

Fix initializer blueprint to pass jshint

Fix mixin test blueprint

Add appropriate needs to test for model with relationships

Extra todo around resourceful routing

Remove nonsense semicolon from util blueprint

Add service todo

Tweak TODOs

Adopt new blueprint dir structure

Update TODOs

Move blueprint into models

Convert new --blueprint test to use blueprint/files

blueprints/init -> blueprints/app

Add Blueprint.lookup

Also annotate blueprint.js to aid refactoring

Refactor Blueprint

Move specific logic into respective blueprint index files.

Fix typo in require promise

Shrink afterInstall call

Remove TODOs now they’re in the PR

Stop resource blueprint passing `type` to model

Also document `assertFile`.

Add tests and support for custom blueprints

Blueprint.lookup micro-tweak

Fix transform blueprint

Add service blueprint

Add index.js to servie blueprint

Init app with specific name in generate tests

Uses tmp-sync to generate project-under-test in a
truly unique temporary directory.

Adjust initializer blueprint

Catch-22: If we include an `initialize` function with `container` and
`app` arguments then jshint will complain about the unused vars. If we
comment out the initialize function altogether we get an assertion
failure when the app boots.

Compromise: Comment just the arguments.

Add blueprint blueprint

malkovich malkovich

Sync with upstream blueprint

Add api-stub blueprint

Back off timings in blueprint unit test

The prompt/response simulation is causing errors on CI.
This isn’t a proper fix, but hopefully it won’t make
matters worse.

Ensure resource generates correct route definiton

Also lose the blank object in empty class definitions

Ignore tmp*

Prevent route blueprint adding definitions to router

Unify blueprint class definitions with blank pojos

Move blueprint test into unit/models

Add test for absolute blueprint paths

Simplify app blueprint

Sync with latest app blueprint

Add Blueprint.ignoredFiles

Add more descriptive failure message for < 20 file check in smoke test

Add try..catch around template processing in file-info

Remove loom from package.json

Put tmpdir for generate tests in tmp & ensure cleanup

Add import statements to blueprints where needed

Add blueprint documentation

Remove uneeded comment in adapter blueprint

Update Brocfile template to specify ember-data exports
@jgwhite jgwhite changed the title [WIP] Blueprints Blueprints Jun 8, 2014
@rwjblue
Copy link
Member

rwjblue commented Jun 8, 2014

Looks like this is squashed, and green.

@stefanpenner - Any final thoughts?

@jgwhite
Copy link
Contributor Author

jgwhite commented Jun 8, 2014

For reference, I’ve captured what remained of the wishlist here.

stefanpenner added a commit that referenced this pull request Jun 9, 2014
@stefanpenner stefanpenner merged commit 45ab166 into ember-cli:master Jun 9, 2014
@stefanpenner
Copy link
Contributor

<3

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

Successfully merging this pull request may close these issues.

3 participants