INTRODUCTION

This module integrates Kalastatic with Drupal.

Kalastatic is a static site framework for prototyping, style-guiding and building out CMS-less websites. More information can be found on the Kalastatic wiki.

WHY THIS MODULE

For a prototype to be truly alive, it must co-exist with the dynamic assets generated by the CMS. When the user installs a module in Drupal, CSS and JS should be brought into the prototype context for regression testing on components and templates.

Conversely, the prototype as a canonical style guide should be pulled into the CMS. This approach ensures a portable and agnostic approach to design, and eases portability across multiple systems – avoiding re-implementation, and centralizing maintenance.

FEATURES

  • provides pretty paths at /kalastatic/styleguide and /kalastatic/prototype
  • permissions for viewing the styleguide and protoype
  • a configurable path to kalastatic resources
  • provides Drupal CSS and JS that can be shared back to the prototype

https://www.drupal.org/sandbox/sonictruth/2624634

git clone --branch 7.x-1.x http://git.drupal.org/sandbox/sonictruth/2624634.git kalastatic

Comments

sonictruth created an issue. See original summary.

PA robot’s picture

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

ItangSanjana’s picture

Automated Review

[Best practice issues identified by pareview.sh.]

http://pareview.sh/pareview/httpgitdrupalorgsandboxmoshnoi2637294git

Note that perfect adherence to Drupal Coding Standard is NOT a reason to block an application, except for total disregard of them. However, modules should follow them as closely as possible.

Manual Review

Individual user account
[Yes: Follows] the guidelines for individual user accounts.
No duplication
[Yes: Does not cause] module duplication and/or fragmentation.
Master Branch
[Yes: Follows] the guidelines for master branch.
Licensing
[Yes: Follows] the licensing requirements.
3rd party assets/code
[Yes: Follows] the guidelines for 3rd party assets/code.
README.txt/README.md
[Yes: Follows] the guidelines for in-project documentation and/or the README Template.
Code long/complex enough for review
[Yes: Follows] the guidelines for project length and complexity.
Secure code
[Yes: Meets the security requirements.]

If added, please don't remove the security tag, we keep that for statistics and to show examples of security problems.

This review uses the Project Application Review Template.

sonictruth’s picture

ItangSanjana,

As this passed the automated and manual reviews can we change this to RTBC?

Rahul Seth’s picture

Automated Review

I ran your code against auto code sniffer at 'http://pareview.sh/pareview/httpgitdrupalorgsandboxsonictruth2624634git'.

Review of the 7.x-1.x branch (commit 1e828be):

Coder Sniffer has found some issues with your code (please check the Drupal coding standards).
FILE: /var/www/drupal-7-pareview/pareview_temp/README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
88 | WARNING | Line exceeds 80 characters; contains 99 characters
----------------------------------------------------------------------

Time: 110ms; Memory: 7Mb

No automated test cases were found, did you consider writing Simpletests or PHPUnit tests? This is not a requirement but encouraged for professional software development.

Note that perfect adherence to Drupal Coding Standard is NOT a reason to block an application, except for total disregard of them. However, modules should follow them as closely as possible.

Manual Review

    Observation :
  • In hook_menu at line no. 49
     // Menu callback for styleguide. Note that this just does a drupal_goto to
      // redirect to the proper url for the styleguide. If we implemented a callback
      // for 'kalastatic/prototype/styleguide' that was of type MENU_LOCAL_TASK then
      // Drupal would assume that the local task was to appear on
      // kalastatic/prototype which of course isn't a Drupal page. This way we can
      // have the style guide link on /kalastatic and everyone nguyens.

    It would be good, if you use block comment instead of line comment.

  • There is white page of death, in this url
    kalastatic/styleguide
Rahul Seth’s picture

Status: Needs review » Needs work
klausi’s picture

@Rahul Seth: can you post the PHP error that you got on white screen of death? Please enable PHP error reporting in your dev environment, see https://www.drupal.org/node/158043

Rahul Seth’s picture

Not possible to reproduce that PHP error. But it seems that it was due to file permissions. because in watchdog it create such kind of entry while visit this url "kalastatic/prototype".

Warning: file_get_contents(themes/kalatheme/kalastatic/build/index.html): failed to open stream: No such file or directory in kalastatic_serve_ks_files() (line 232 of kalastatic\kalastatic.module).

sonictruth’s picture

Rahul,

Thanks for your input.

ItangSanjana already ran the automated test and it passed fine—Line 88 is actually a url in the readme so it can't break onto a new line.

I have replaced the inline comment with a block comment as per your suggestion.

The reason that kalastatic/styleguide white screens is because you haven't actually installed Kalastatic Library. This module is not useful without installing Kalastatic as per the readme:

REQUIREMENTS
------------

In theory, none.
In practice, this modules does nothing without 
[Kalastatic](https://github.com/kalamuna/kalastatic), 
which we recommend residing inside your subtheme. We of course recommend 
[Kalatheme](https://www.drupal.org/project/kalatheme) as a base theme.

I can add some extra checks to the page callback to try and give a better UX when the lib isn't present but it seems silly to hold up the promotion of the module due to this.

sonictruth’s picture

Status: Needs work » Reviewed & tested by the community
robloach’s picture

Status: Reviewed & tested by the community » Needs work

I can add some extra checks to the page callback to try and give a better UX when the lib isn't present but it seems silly to hold up the promotion of the module due to this.

That might improve the UX. Created an issue to track that change: https://github.com/kalamuna/kalastatic_dot_module/issues/6

PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).

I'm a robot and this is an automated message from Project Applications Scraper.

sonictruth’s picture

Status: Closed (won't fix) » Needs work

Yeah, def don't want this closed.

sonictruth’s picture

Status: Needs work » Needs review

Ok, so I changed some things and we're now handling the case where Kalastatic lib is missing. This should result in less confusion. Note that I have also moved the config page to 'admin/config/kalastatic' to be more in line with convention.

robloach’s picture

Status: Needs review » Reviewed & tested by the community

We've been using this on a number of sites. It is working well.

hawkeye.twolf’s picture

Overall code looks good! A few errors from PHP Code Sniffer Drupal coding standards / coder module (see below). @sonictruth, I recommend addressing them but they are minor and I don't consider them blockers to project status.

As @RobLoach mentioned, we have been using this module on several production sites and is effective, secure, and efficient. Confirming RTBC status!

kalastatic.module|49 col 3 error| Inline doc block comments are not allowed; use \"/* Comment */\" or \"// Comment\" instead [php/phpcs]

kalastatic.module|237 col 8 error| Use \"elseif\" in place of \"else if\" [php/phpcs]

kalastatic.module|237 col 8 error| Expected 1 space after IF keyword; 0 found [php/phpcs]

kalastatic.module|241 col 18 error| The $text argument to l() should be enclosed within t() so that it is translatable [php/phpcs]

kalastatic.module|241 col 46 warning| A comma should follow the last multiline array item. Found: ) [php/phpcs]

kalastatic.module|244 col 82 warning| Avoid backslash escaping in translatable strings when possible, use \"\" quotes instead [php/phpcs]
sonictruth’s picture

Thanks Derek,
I fixed up those minor things and it's now a clean slate on pareview.sh

mlncn’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for your contribution! Congratulations, you are now a vetted Git user. You can promote this to a full project.

When you create new projects (typically as a sandbox to start) you can then promote them to a full project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

avpaderno’s picture

Title: Kalastatic » [D7] Kalastatic