Skip to content

Commit

Permalink
Rename to angular-scaffolding
Browse files Browse the repository at this point in the history
  • Loading branch information
jameskleeh committed Apr 11, 2017
1 parent 2c6c782 commit bb7e0c8
Show file tree
Hide file tree
Showing 40 changed files with 72 additions and 73 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Grails 3 Angular 2 Scaffolding Plugin
# Grails 3 Angular Scaffolding Plugin

[![Build Status](https://travis-ci.org/grails-plugins/grails-angular2-scaffolding.svg?branch=master)](https://travis-ci.org/grails-plugins/grails-angular2-scaffolding)
[![Build Status](https://travis-ci.org/grails-plugins/grails-angular-scaffolding.svg?branch=master)](https://travis-ci.org/grails-plugins/grails-angular-scaffolding)

A plugin for generating client side assets based on domain classes

## Documentation

Latest: http://grails-plugins.github.io/grails-angular2-scaffolding/latest
Snapshot: http://grails-plugins.github.io/grails-angular2-scaffolding/snapshot
Latest: http://grails-plugins.github.io/grails-angular-scaffolding/latest
Snapshot: http://grails-plugins.github.io/grails-angular-scaffolding/snapshot


18 changes: 9 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ plugins {
id 'org.asciidoctor.convert' version '1.5.3'
}

version "1.0.0.RC1"
version "2.0.0.RC1"
group "org.grails.plugins"

apply plugin:"eclipse"
apply plugin:"idea"
apply plugin:"org.grails.grails-plugin"
apply plugin:"org.grails.grails-plugin-publish"
apply plugin: "eclipse"
apply plugin: "idea"
apply plugin: "org.grails.grails-plugin"
apply plugin: "org.grails.grails-plugin-publish"

repositories {
mavenLocal()
Expand Down Expand Up @@ -57,12 +57,12 @@ bootRepackage.enabled = false

grailsPublish {
userOrg = "grails"
githubSlug = 'grails-plugins/grails-angular2-scaffolding'
githubSlug = 'grails-plugins/grails-angular-scaffolding'
license {
name = 'Apache-2.0'
}
title = "Angular 2 Scaffolding Plugin"
desc = "Provides scaffolding for Angular 2 applications"
title = "Angular Scaffolding Plugin"
desc = "Provides scaffolding for Angular applications"
developers = [jameskleeh: "James Kleeh"]
}

Expand All @@ -88,7 +88,7 @@ task apidocs(type: Groovydoc) {

destinationDir = new File(buildDir, 'docs/api')
// Might need a classpath
docTitle = "Grails Angular 2 Scaffolding ${version}"
docTitle = "Grails Angular Scaffolding ${version}"

classpath = configurations.documentation
groovyClasspath = configurations.documentation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package angular2.scaffolding
package angular.scaffolding

import grails.codegen.model.Model
import grails.dev.commands.GrailsApplicationCommand
Expand All @@ -10,7 +10,7 @@ import org.grails.datastore.mapping.model.PersistentEntity
import org.grails.datastore.mapping.model.PersistentProperty
import org.grails.datastore.mapping.model.types.Association
import org.grails.datastore.mapping.model.types.ToMany
import org.grails.plugin.scaffolding.angular2.template.AngularModuleEditor
import org.grails.plugin.scaffolding.angular.template.AngularModuleEditor
import org.grails.scaffolding.markup.DomainMarkupRenderer
import org.grails.scaffolding.model.DomainModelService
import org.grails.scaffolding.model.property.DomainProperty
Expand Down Expand Up @@ -138,34 +138,34 @@ class NgGenerateAllCommand implements GrailsApplicationCommand {
}


render template: template(hasFileProperty ? "angular2/javascripts/service-file.ts" : "angular2/javascripts/service.ts"),
render template: template(hasFileProperty ? "angular/javascripts/service-file.ts" : "angular/javascripts/service.ts"),
destination: file("${baseDir}/${module.propertyName}/${module.propertyName}.service.ts"),
model: module.asMap() << [uri: uri],
overwrite: overwrite

render template: template("angular2/javascripts/domain.ts"),
render template: template("angular/javascripts/domain.ts"),
destination: file("${baseDir}/${module.propertyName}/${module.propertyName}.ts"),
model: module.asMap() << [domainProperties: domainProperties, domainConstructorInitializingStatements: domainConstructorInitializingStatements, domainImports: domainImports],
overwrite: overwrite

File moduleFile = file("${baseDir}/${module.propertyName}/${module.propertyName}.module.ts")
render template: template("angular2/javascripts/module.ts"),
render template: template("angular/javascripts/module.ts"),
destination: moduleFile,
model: module.asMap() << [associatedModule: false, importService: true],
overwrite: overwrite

render template: template("angular2/javascripts/routing.module.ts"),
render template: template("angular/javascripts/routing.module.ts"),
destination: file("${baseDir}/${module.propertyName}/${module.propertyName}-routing.module.ts"),
model: module,
overwrite: overwrite

['persist', 'list', 'show'].each {
render template: template("angular2/javascripts/${it}.component.ts"),
render template: template("angular/javascripts/${it}.component.ts"),
destination: file("${baseDir}/${module.propertyName}/${module.propertyName}-${it}.component.ts"),
model: module.asMap() << [initializingStatements: initializingStatements, constructorArguments: constructorArguments, componentProperties: componentProperties, componentImports: componentImports],
overwrite: overwrite

render template: template("angular2/views/${it}.component.html"),
render template: template("angular/views/${it}.component.html"),
destination: file("${baseDir}/${module.propertyName}/${module.propertyName}-${it}.component.html"),
model: module.asMap() << [template: htmlTemplates.get(it)],
overwrite: overwrite
Expand All @@ -192,18 +192,18 @@ class NgGenerateAllCommand implements GrailsApplicationCommand {
uri = getUri(associatedModel)
boolean bidirectional = ((Association)prop.persistentProperty).bidirectional
if (!bidirectional) {
render template: template("angular2/javascripts/service.ts"),
render template: template("angular/javascripts/service.ts"),
destination: file("${baseDir}/${associatedModel.propertyName}/${associatedModel.propertyName}.service.ts"),
model: associatedModel.asMap() << [uri: uri],
overwrite: overwrite
}

render template: template("angular2/javascripts/domain.ts"),
render template: template("angular/javascripts/domain.ts"),
destination: file("${baseDir}/${associatedModel.propertyName}/${associatedModel.propertyName}.ts"),
model: associatedModel.asMap() << [domainProperties: [:], domainConstructorInitializingStatements: [:], domainImports: []],
overwrite: overwrite

render template: template("angular2/javascripts/module.ts"),
render template: template("angular/javascripts/module.ts"),
destination: file("${baseDir}/${associatedModel.propertyName}/${associatedModel.propertyName}.module.ts"),
model: associatedModel.asMap() << [associatedModule: true, importService: !bidirectional],
overwrite: overwrite
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package angular2.scaffolding
package angular.scaffolding

import grails.dev.commands.GrailsApplicationCommand
import org.grails.io.support.Resource
Expand All @@ -11,7 +11,7 @@ class NgInstallTemplates implements GrailsApplicationCommand {
@Override
boolean handle() {
try {
templates("angular2/**/*").each { Resource r ->
templates("angular/**/*").each { Resource r ->
String path = r.URL.toString().replaceAll(/^.*?META-INF/, "src/main")
if (path.endsWith('/')) {
mkdir(path)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package angular2.scaffolding
package angular.scaffolding

import grails.boot.GrailsApp
import grails.boot.config.GrailsAutoConfiguration
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rootProject.name="angular2-scaffolding"
rootProject.name="angular-scaffolding"
6 changes: 3 additions & 3 deletions src/docs/asciidoc/customization/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

This plugin is an extension of link:https://github.com/grails/scaffolding[Grails Scaffolding Core]. To change how markup is rendered in the html templates, see the scaffolding core link:http://grails.github.io/scaffolding/{scaffoldingCoreVersion}/[documentation]. The following changes have been made:

. The `propertyMarkupRenderer` bean has been set to an instance of link:api/org/grails/plugin/scaffolding/angular2/markup/AngularPropertyMarkupRenderer.groovy[AngularPropertyMarkupRenderer] that only overrides the link:api/org/grails/plugin/scaffolding/angular/markup/AngularPropertyMarkupRendererImpl.html#getStandardAttributes(DomainProperty)[getStandardAttributes] method to add an `[(ngModel)]` attribute.
. The `contextMarkupRenderer` has been set to an instance of link:api/org/grails/plugin/scaffolding/angular2/markup/AngularContextMarkupRenderer.groovy[AngularContextMarkupRenderer] that overrides the list output context to use an `*ngFor`.
. The `propertyMarkupRenderer` bean has been set to an instance of link:api/org/grails/plugin/scaffolding/angular/markup/AngularPropertyMarkupRenderer.groovy[AngularPropertyMarkupRenderer] that only overrides the link:api/org/grails/plugin/scaffolding/angular/markup/AngularPropertyMarkupRendererImpl.html#getStandardAttributes(DomainProperty)[getStandardAttributes] method to add an `[(ngModel)]` attribute.
. The `contextMarkupRenderer` has been set to an instance of link:api/org/grails/plugin/scaffolding/angular/markup/AngularContextMarkupRenderer.groovy[AngularContextMarkupRenderer] that overrides the list output context to use an `*ngFor`.
. Additional input and output renderers are registered with a priority of 0. If you wish your own renderers to be used, set a priority higher than 0. See the link:http://grails.github.io/scaffolding/{scaffoldingCoreVersion}/#_how_properties_are_rendered[section on how properties are rendered] in the scaffolding core documentation for more details on how to do so.

The JavaScript templates used to create assets can be overridden by executing `grails ngInstallTemplates`. That will put a set of files in `src/main/templates/angular2`. You can modify the templates and they will be used in future angular code generation. You can safely remove any templates that you do not wish to override.
The JavaScript templates used to create assets can be overridden by executing `grails ngInstallTemplates`. That will put a set of files in `src/main/templates/angular`. You can modify the templates and they will be used in future angular code generation. You can safely remove any templates that you do not wish to override.
2 changes: 1 addition & 1 deletion src/docs/asciidoc/index.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
= Grails Angular 2 Scaffolding Plugin
= Grails Angular Scaffolding Plugin
:author: James Kleeh
:email: kleehj@ociweb.com
:source-highlighter: coderay
Expand Down
2 changes: 1 addition & 1 deletion src/docs/asciidoc/installation/index.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
== Installation

To start using this plugin, add it to your `build.gradle` like the example below. If you created your project with the angular2 profile in Grails 3.2.0 or higher, this is done automatically.
To start using this plugin, add it to your `build.gradle` like the example below. If you created your project with the angular profile in Grails 3.2.0 or higher, this is done automatically.

[source,groovy,subs="attributes",indent=1]
.build.gradle
Expand Down
2 changes: 1 addition & 1 deletion src/docs/asciidoc/introduction.adoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
== Introduction

The goal of this plugin is to provide basic CRUD abilities using Angular 2 in a single page application. It is designed to be used alongside the angular2 profile, however it can be used in applications that were not created from the angular2 profile. This guide will cover what functionality you can expect from this plugin, as well as how you can change that functionality to meet your needs.
The goal of this plugin is to provide basic CRUD abilities using Angular in a single page application. It is designed to be used alongside the angular profile, however it can be used in applications that were not created from the angular profile. This guide will cover what functionality you can expect from this plugin, as well as how you can change that functionality to meet your needs.
8 changes: 4 additions & 4 deletions src/docs/asciidoc/usage/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ You can also execute the command via Gradle.
$ ./gradlew ngGenerateAll -Pargs="com.foo.Bar"
----

The default root path where assets will be created is "../client/src/app". That is because the plugin is configured by default to work with the angular2 profile which creates a multi-project build. To change that setting and others, see the link:configuration.html[configuration] section.
The default root path where assets will be created is "../client/src/app". That is because the plugin is configured by default to work with the angular profile which creates a multi-project build. To change that setting and others, see the link:configuration.html[configuration] section.


The command will generate everything required to create, read, update, and delete instances of domain classes with Angular 2. The following will be created if they don't already exist.
The command will generate everything required to create, read, update, and delete instances of domain classes with Angular. The following will be created if they don't already exist.

. A module for the domain `../client/src/app/bar/bar.module.ts`.
. A routing module `../client/src/app/bar/bar-routing.module.ts`.
Expand Down Expand Up @@ -57,7 +57,7 @@ If it is not successful, you will be responsible for importing it.

=== Assumptions

This plugin assumes you have an environment that supports ES6 modules and typescript. It is based upon the angular2 profile which uses the Angular CLI.
This plugin assumes you have an environment that supports ES6 modules and typescript. It is based upon the angular profile which uses the Angular CLI.

=== REST API

Expand Down Expand Up @@ -92,7 +92,7 @@ grails:

=== Routing

If you are using the angular2 profile, the default index page is modified so that clicking on the link to the controller will automatically route you to the module the controller represents. If you are using this plugin in an existing application, you will have a little bit of work to do to use the generated assets.
If you are using the angular profile, the default index page is modified so that clicking on the link to the controller will automatically route you to the module the controller represents. If you are using this plugin in an existing application, you will have a little bit of work to do to use the generated assets.

The first step is to ensure the module is included in the page. If the bootstrap module is found, a dependency will automatically be created, however if the bootstrap module is not found, it is up to you to ensure the newly created module is imported.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
package org.grails.plugin.scaffolding.angular2
package org.grails.plugin.scaffolding.angular

import grails.plugins.Plugin
import org.grails.plugin.scaffolding.angular2.markup.AngularContextMarkupRenderer
import org.grails.plugin.scaffolding.angular2.markup.AngularPropertyMarkupRenderer
import org.grails.plugin.scaffolding.angular2.registry.AngularDomainRendererRegisterer
import org.grails.plugin.scaffolding.angular2.template.AngularModuleEditorImpl
import org.grails.plugin.scaffolding.angular.markup.AngularContextMarkupRenderer
import org.grails.plugin.scaffolding.angular.markup.AngularPropertyMarkupRenderer
import org.grails.plugin.scaffolding.angular.registry.AngularDomainRendererRegisterer
import org.grails.plugin.scaffolding.angular.template.AngularModuleEditorImpl
import org.grails.scaffolding.ScaffoldingBeanConfiguration

class Angular2ScaffoldingGrailsPlugin extends Plugin {
class AngularScaffoldingGrailsPlugin extends Plugin {


// the version or versions of Grails the plugin is designed for
def grailsVersion = "3.2.0 > *"

// TODO Fill in these fields
def title = "Grails Angular 2 Scaffolding" // Headline output name of the plugin
def title = "Grails Angular Scaffolding" // Headline output name of the plugin
def author = "James Kleeh"
def authorEmail = "kleehj@ociweb.com"
def description = '''\
This plugin provides the ability to generate an AngularJS CRUD interface based on a domain class
This plugin provides the ability to generate an Angular CRUD interface based on a domain class
'''
String documentation = 'http://grails-plugins.github.io/grails-angular2-scaffolding/latest'
String documentation = 'http://grails-plugins.github.io/grails-angular-scaffolding/latest'
String license = 'APACHE'
def organization = [name: 'Grails', url: 'http://www.grails.org/']
def issueManagement = [url: 'https://github.com/grails-plugins/grails-angular2-scaffolding/issues']
def scm = [url: 'https://github.com/grails-plugins/grails-angular2-scaffolding']
def issueManagement = [url: 'https://github.com/grails-plugins/grails-angular-scaffolding/issues']
def scm = [url: 'https://github.com/grails-plugins/grails-angular-scaffolding']

Closure doWithSpring() {{ ->
scaffoldingCoreConfig(ScaffoldingBeanConfiguration)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.grails.plugin.scaffolding.angular2.markup
package org.grails.plugin.scaffolding.angular.markup

import org.grails.datastore.mapping.model.PersistentEntity
import org.grails.scaffolding.markup.ContextMarkupRendererImpl
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.grails.plugin.scaffolding.angular2.markup
package org.grails.plugin.scaffolding.angular.markup

import grails.util.GrailsNameUtils
import org.grails.scaffolding.markup.PropertyMarkupRendererImpl
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.grails.plugin.scaffolding.angular2.registry
package org.grails.plugin.scaffolding.angular.registry

import org.grails.plugin.scaffolding.angular2.registry.input.AngularAssociationInputRenderer
import org.grails.plugin.scaffolding.angular2.registry.input.AngularBidirectionalToManyInputRenderer
import org.grails.plugin.scaffolding.angular2.registry.input.AngularDateInputRenderer
import org.grails.plugin.scaffolding.angular2.registry.input.AngularFileInputRenderer
import org.grails.plugin.scaffolding.angular2.registry.output.*
import org.grails.plugin.scaffolding.angular.registry.input.AngularAssociationInputRenderer
import org.grails.plugin.scaffolding.angular.registry.input.AngularBidirectionalToManyInputRenderer
import org.grails.plugin.scaffolding.angular.registry.input.AngularDateInputRenderer
import org.grails.plugin.scaffolding.angular.registry.input.AngularFileInputRenderer
import org.grails.plugin.scaffolding.angular.registry.output.*
import org.grails.scaffolding.registry.DomainInputRendererRegistry
import org.grails.scaffolding.registry.DomainOutputRendererRegistry
import org.springframework.beans.factory.annotation.Autowired
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package org.grails.plugin.scaffolding.angular2.registry.input
package org.grails.plugin.scaffolding.angular.registry.input

import grails.util.GrailsNameUtils
import org.grails.datastore.mapping.model.PersistentProperty
import org.grails.datastore.mapping.model.types.Association
import org.grails.datastore.mapping.model.types.Basic
import org.grails.datastore.mapping.model.types.ToMany
import org.grails.plugin.scaffolding.angular2.registry.output.PropertyHelper
import org.grails.plugin.scaffolding.angular.registry.output.PropertyHelper
import org.grails.scaffolding.model.property.DomainProperty
import org.grails.scaffolding.registry.DomainInputRenderer

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.grails.plugin.scaffolding.angular2.registry.input
package org.grails.plugin.scaffolding.angular.registry.input

import grails.util.GrailsNameUtils
import org.grails.datastore.mapping.model.types.Association
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.grails.plugin.scaffolding.angular2.registry.input
package org.grails.plugin.scaffolding.angular.registry.input

import org.grails.scaffolding.model.property.DomainProperty
import org.grails.scaffolding.registry.input.DateInputRenderer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.grails.plugin.scaffolding.angular2.registry.input
package org.grails.plugin.scaffolding.angular.registry.input

import grails.util.GrailsNameUtils
import org.grails.scaffolding.model.property.DomainProperty
Expand Down
Loading

0 comments on commit bb7e0c8

Please sign in to comment.