Commit Graph

68 Commits

Author SHA1 Message Date
Andreas Jaeger f57ebca959 Retire js-generator-openstack
This repository is unused, retire it.

Change-Id: Ib6b55e118b7092a05dfe6bcbb6bcb66a8b20fdc2
Depends-On: https://review.openstack.org/597370/
2018-08-29 09:04:51 +02:00
Yujun Zhang c2cc0eac5d Update gitignore list
Change-Id: I9f49fd1926869a85179766f77213d2aaf6892bcb
2016-11-03 13:47:42 +08:00
Yujun Zhang 4b55140d6d Include `build` in gitignore template
`doc/build` is the output directory of `npm run docs`

Change-Id: I9b43a0f3cfa3726b650c8a66c06eb395b232e50b
2016-10-21 16:56:47 +08:00
Yujun Zhang e3a472cfad fix incorrect jsdoc comment section
Change-Id: I87fb4ab927110264a0c9890053df425d1fef9966
2016-07-27 14:25:35 +08:00
Jenkins bb0fe3608d Merge "add jsdoc to component/nsp" 2016-07-22 17:44:44 +00:00
Jenkins 7bb89284b7 Merge "add jsdoc to component/pkg" 2016-07-22 17:44:38 +00:00
Jenkins 292465d921 Merge "add jsdoc to component/structure" 2016-07-22 17:43:48 +00:00
Jenkins d335e609a2 Merge "add jsdoc to component/gerrit" 2016-07-22 17:39:29 +00:00
Jenkins 934e70c335 Merge "add jsdoc to component/gitignore" 2016-07-22 17:39:23 +00:00
Jenkins 8a7b536bb6 Merge "add jsdoc to component/license" 2016-07-22 17:39:17 +00:00
Jenkins 401be7650a Merge "add jsdoc to component/editorconfig" 2016-07-22 17:39:12 +00:00
Yujun Zhang c05ee31b8c add jsdoc to component/editorconfig
Change-Id: Ic96a921c574719218c073ecd3d9ee1c829ca5a6f
2016-07-22 11:21:01 +08:00
Yujun Zhang dc83664603 add jsdoc to component/license
Change-Id: Ic489aa50f806e1a14630d4948bc9b3a6b346d8b5
2016-07-22 11:19:44 +08:00
Yujun Zhang a747ec2722 add jsdoc to component/gitignore
Change-Id: I62f50ca36b411ac7fb22334e77d6a7b75c5c1ddd
2016-07-22 11:19:02 +08:00
Yujun Zhang 5f020788d6 add jsdoc to component/gerrit
Change-Id: I9e82cfa3522bd77213fc5521ce504eeed2215c79
2016-07-22 11:18:12 +08:00
Yujun Zhang 7b7f0c7bcc add jsdoc to component/eslint and normalize function names
- remove Eslint from function names since it is redudant in module
- rename `eslintrc` to `rcContent` to keep consistent with `rcFile`

Change-Id: I616e551fc5752e6d61d96f91da556825071d4316
2016-07-22 11:17:19 +08:00
Yujun Zhang f297e2cb39 add jsdoc to component/structure
Change-Id: I4ade632a1a6abc17780d885e971dbfbf14eabb64
2016-07-22 11:13:05 +08:00
Yujun Zhang cab1fcfa3e add jsdoc to component/pkg
Change-Id: Ieaa41958478e1c15e46d93d982a93cf42d4b4f78
2016-07-22 11:11:18 +08:00
Yujun Zhang e3bbe6840a add jsdoc to component/nsp
Change-Id: I339b519db3f61b0d44d83c69316ee673fa0e7c46
2016-07-22 11:08:46 +08:00
Jenkins 57029cdeb1 Merge "add jsdoc for project_builder" 2016-07-22 01:08:25 +00:00
Jenkins 125b775116 Merge "add jsdoc for global_dependencies" 2016-07-22 01:08:20 +00:00
Yujun Zhang 8a5eff7b66 add jsdoc for project_builder
inner function names are renamed to keep consistency with export names

Change-Id: I9d121b0c440a9dd1d0c0037dca9298ba1dd156c0
2016-07-21 15:34:07 +00:00
Yujun Zhang f29944ba29 add jsdoc for global_dependencies
inner function names are renamed to keep consistency with exported names

Change-Id: I2f03d160f19ef57dc99d1aff9d1422ca983fb459
2016-07-20 10:19:51 +08:00
Yujun Zhang df050e8b3d rename inner function name to keep consistency with exported name
Change-Id: I59313d296758c505ed6256abe99716d6dee48258
2016-07-20 09:59:09 +08:00
Yujun Zhang df6ee674df add jsdoc comments for pkg_builder
Change-Id: I145adb7638435aa7a2c720848a3af1dd82f0b18e
2016-07-15 10:00:39 +08:00
Yujun Zhang 5c9e5bbeaf Remove IIFE in all scripts
It is not required by node.js, but introduce troubles while
generating documents with jsdoc3.

Refer to https://github.com/jsdoc3/jsdoc/issues/456

Change-Id: I6664f1be0fc3e86f3a7e3843d557786c37df1c5e
2016-07-05 16:38:35 +08:00
Yujun Zhang 601a1c21b9 Add default test harness for nodejs projects
story/2000598

Change-Id: I180f887f29bd378992c1c4678832b47e4e2e497f
Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
2016-06-15 22:21:18 +08:00
Michael Krotscheck 60a853aa3c Added copyright header.
I didn't add these headers when I initially implemented this
generator.

Change-Id: I852e4e667e3ff14e9dda2e770b30759fdcecca75
2016-06-15 05:33:31 -07:00
Michael Krotscheck 5073e1f9e0 Run `npm install` after project has been updated.
When initializing a new project, we should run `npm install` so that
the project directory starts off clean. When updating an old project,
this will update dependencies.

Change-Id: Idd7602875480b57ab96d5151773761650a94f58c
2016-06-15 05:33:31 -07:00
Michael Krotscheck f8c932ea8d Created Structure Module
The structure module is a prompt-only module that determines and
sets structural attributes which inform the rest of the project.
With these values, we can automatically generate test configuration
files, sample project layouts, as well as toggle specific tooling
options (such as gulp, karma, and others).

Change-Id: I477f427da121aeda967fadbcbe73d0a75e9d6bed
2016-06-15 05:33:31 -07:00
Michael Krotscheck 57c560e7d5 .gitignore includes files flagged as ignored.
If a file is ignored in the project builder, it is now persisted
into the .gitignore file in the project.

Change-Id: Ic8e5d08b82da5809b1dc2a8427f6563dc9acf00b
2016-06-15 05:33:31 -07:00
Michael Krotscheck 1ee651fd0e .gitignore file is now read and echoed back into the project
This patch allows the generator to read a .gitignore file and
echo it back into the project. This implementation is destructive
of the original format, and can be improved in the future.

Change-Id: I38fb29e564120464406c00586952eee0c19150e1
2016-06-15 05:33:31 -07:00
Michael Krotscheck 0cd80006fd Add nsp to prepublish hook
Nsp is a tool published by the Node Security team, which scans
a project for known and easily recognizable vulnerabilities. For
a list of advisories, please check https://nodesecurity.io/advisories

Change-Id: I554320d0c4aca86184e03aac853a5a4d9f48fcdd
2016-06-15 05:33:31 -07:00
Michael Krotscheck d53c4d6aa6 New projects now conform the the 'npm run lint' CTI spec.
This patch binds 'eslint ./' command to the npm 'lint' script.

Change-Id: I27aa8e7d8d565b5eeb70f1f0c8a58ed21036aa28
2016-06-15 05:33:31 -07:00
Michael Krotscheck b6e9361bf6 Script commands may now be added to a package.
This adds the pkgBuilder.addCommand() method, which permits adding
a command (such as 'eslint':'eslint ./') to the npm scripts list.

Change-Id: I0ebfa9cbc0a526363cd2c8d1a0b697f5748e0771
2016-06-15 05:33:31 -07:00
Michael Krotscheck 4c3e27d6b7 Eslint module now adds eslint and eslint-config-openstack dependencies
This patch ensures that eslint, and eslint-config-openstack, are added
to the project that the most recent managed version.

Change-Id: I8c90bbce96f78080c1fc2f1afc529a97894091cb
2016-06-15 05:33:31 -07:00
Michael Krotscheck 9f17711019 Package builder now adds dependencies
This adds a convenience method to the package.json builder, which
wraps various sanity checks around the process of adding a dependency
to a project.

Change-Id: I111b3d5ead31979933993916d091277c94290d25
2016-06-15 05:33:30 -07:00
Michael Krotscheck f645ce2a9c Dependencies are updated from global deps.
This patch will update any project dependencies with the global
version, if available.

Change-Id: I9ca73951a67bc7d3e6c161a42b42ce7823ace56b
2016-06-15 05:33:25 -07:00
Michael Krotscheck 5c4ae1b51a Package file ignores common node runtime files.
This patch adds common files used by a node runtime environment
to the eslint ignore list.

Change-Id: Idc8dcce68947d3965ddd128180a5260dc5d6e36f
2016-06-14 09:13:53 -07:00
Michael Krotscheck 976c53299c .eslintignore generation includes ignored files from projectBuilder
Any file paths registered as ignored with the project builder are
now also included/appended to the .eslintignore file. Duplicates
are not repeated.

Change-Id: I23aa82f5f94f726862ff5235039a90948755b4f2
2016-06-14 09:13:03 -07:00
Michael Krotscheck aaccbb2d0e Project builder can now ignore files.
This patch adds the ignoreFiles option to the package builder, which
permits us to build a list of paths that should be ignored by our
tools. For example, this can be used to build a .gitignore or an
.eslintignore list.

Change-Id: I5ba67a9dbac1b90b72fb0a7ab1994fd2229e39d0
2016-06-10 06:02:37 -07:00
Yujun Zhang ea2b60a6c8 Fix bug in project name
gerrit project name shall come from

1. user answer if given
2. .gitreview if no answer is given
3. create from package name if .gitreview does not exist

Change-Id: I02eb9e86fd97fc67093e16a4264c24625f7f2e47
Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
2016-06-06 23:27:07 +08:00
Michael Krotscheck d6918c50a4
Added global-dependencies library
This library permits reading, validating, and accessing a set of
globally accepted dependency criteria. It will eventually be used
to synchronize dependencies across multiple javascript projects.

Change-Id: I2ec7a218311cfcfc7d33c4a1e29e73ed8e2f7b42
2016-05-20 11:35:59 -07:00
Michael Krotscheck 1292783504
Updated gerrit module
This makes two significant changes to the gerrit module. The first
is that the enableGerrit flag is no longer kept in .yo-rc.json, and
instead is inferred from the existence of a .gitreview file. Secondly,
this patch establishes a default fallback mechanism for project
naming:

1- Check if gitreview already exists.
2- Construct one from the package.json project name.
3- Use the yeoman app name.

Change-Id: I3d559b6655de9621e522429bf2bfac5da9762d07
2016-05-20 11:34:35 -07:00
Michael Krotscheck fd162efb91
Using the --non-interactive flag now force-overwrites files.
If a user applies this flag, no tty input should be required. This
ensures that it works as expected.

Change-Id: I20d00295f7164eec2442f45c91e9f1150bc605a0
2016-05-20 11:33:25 -07:00
Michael Krotscheck e0cd8e4f86
Updated prompts to match common format.
This updates the prompt in the gerrit module to use a
"[Category]- [Setting]:" style format.

Change-Id: I3e0e80069622397c4df04c9f498dbcb0a25307a6
2016-05-20 11:31:23 -07:00
Michael Krotscheck 8f01e2447d
Added project detail prompts.
These prompts include things like project name, description,
authors, and homepage, all set with sane defaults.

Change-Id: Ia0f16b517c64953af77dd82829361ab5305f95d8
2016-05-20 11:31:19 -07:00
Michael Krotscheck bc11aa0cb9
Added default value retrieval to pkgBuilder.getValue
This will assist in building generator prompts that return either
the existing value, or a sane default.

Change-Id: I66f47c70ebc529d0a1832677a925083c663adc8c
2016-05-20 11:28:16 -07:00
Michael Krotscheck 43b2171ce4
Consistent function spacing.
This patch applies spaces after anonymous function expressions.
This is consistent with how we lint function declarations.

Change-Id: I9b330673daa632e8d22f0a506e41c9643bb821c7
2016-05-20 10:48:59 -07:00
Michael Krotscheck e8db0834b8
Added value retrieval to package builder.
This patch adds getValues and getValue to the package builder
library, to allow retrieval of package-level variables from an
authoritative source during the various project configuraiton
stages.
2016-05-11 08:24:10 -07:00