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

add more templates for nodejs #23

Merged
merged 5 commits into from
Aug 1, 2018
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions synthtool/gcp/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ def __init__(self):
def py_library(self) -> Path:
raise NotImplemented()

def node_library(self, package_name) -> Path:
def node_library(self, package_name, repo_name) -> Path:
t = templates.TemplateGroup(_TEMPLATES_DIR / "node_library")
result = t.render(package_name=package_name)
result = t.render(package_name=package_name, repo_name=repo_name)
_tracked_paths.add(result)
return result

Expand Down
20 changes: 20 additions & 0 deletions synthtool/gcp/templates/node_library/.appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
environment:
matrix:
- nodejs_version: 8

install:
- ps: Install-Product node $env:nodejs_version
- npm install -g npm # Force using the latest npm to get dedupe during install
- set PATH=%APPDATA%\npm;%PATH%
- npm install --force --ignore-scripts

test_script:
- node --version
- npm --version
- npm rebuild
- npm test

build: off

matrix:
fast_finish: true
3 changes: 3 additions & 0 deletions synthtool/gcp/templates/node_library/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/*
samples/node_modules/*
src/**/doc/*
13 changes: 13 additions & 0 deletions synthtool/gcp/templates/node_library/.eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
extends:
- 'eslint:recommended'
- 'plugin:node/recommended'
- prettier
plugins:
- node
- prettier
rules:
prettier/prettier: error
block-scoped-var: error
eqeqeq: error
no-warning-comments: warn
53 changes: 53 additions & 0 deletions synthtool/gcp/templates/node_library/.github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# How to become a contributor and submit your own code

**Table of contents**

* [Contributor License Agreements](#contributor-license-agreements)
* [Contributing a patch](#contributing-a-patch)
* [Running the tests](#running-the-tests)
* [Releasing the library](#releasing-the-library)

## Contributor License Agreements

We'd love to accept your sample apps and patches! Before we can take them, we
have to jump a couple of legal hurdles.

Please fill out either the individual or corporate Contributor License Agreement
(CLA).

* If you are an individual writing original source code and you're sure you
own the intellectual property, then you'll need to sign an [individual CLA]
(https://developers.google.com/open-source/cla/individual).
* If you work for a company that wants to allow you to contribute your work,
then you'll need to sign a [corporate CLA]
(https://developers.google.com/open-source/cla/corporate).

Follow either of the two links above to access the appropriate CLA and
instructions for how to sign and return it. Once we receive it, we'll be able to
accept your pull requests.

## Contributing A Patch

1. Submit an issue describing your proposed change to the repo in question.
1. The repo owner will respond to your issue promptly.
1. If your proposed change is accepted, and you haven't already done so, sign a
Contributor License Agreement (see details above).
1. Fork the desired repo, develop and test your code changes.
1. Ensure that your code adheres to the existing style in the code to which
you are contributing.
1. Ensure that your code has an appropriate set of tests which all pass.
1. Submit a pull request.

## Running the tests

1. [Prepare your environment for Node.js setup][setup].

1. Install dependencies:

npm install

1. Run the tests:

npm test

[setup]: https://cloud.google.com/nodejs/docs/setup
27 changes: 27 additions & 0 deletions synthtool/gcp/templates/node_library/.github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Thanks for stopping by to let us know something could be better!

Please run down the following list and make sure you've tried the usual "quick
fixes":

- Search the issues already opened: https://github.com/{{repo_name}}/issues
- Search the issues on our "catch-all" repository: https://github.com/GoogleCloudPlatform/google-cloud-node
- Search StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform+node.js

If you are still having issues, please be sure to include as much information as
possible:

#### Environment details

- OS:
- Node.js version:
- npm version:
- `{{ package_name }}` version:

#### Steps to reproduce

1. ???
2. ???

Following these steps will guarantee the quickest resolution possible.

Thanks!
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Fixes #<issue_number_goes_here> (it's a good idea to open an issue first for discussion)

- [ ] Tests and linter pass

This comment was marked as spam.

This comment was marked as spam.

- [ ] Code coverage does not decrease (if any source code was changed)
- [ ] Appropriate docs were updated (if necessary)
45 changes: 45 additions & 0 deletions synthtool/gcp/templates/node_library/.jsdoc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*!
* Copyright 2017 Google LLC. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

module.exports = {
opts: {
readme: './README.md',
package: './package.json',
template: './node_modules/ink-docstrap/template',
recurse: true,
verbose: true,
destination: './docs/'
},
plugins: [
'plugins/markdown'
],
source: {
excludePattern: '(^|\\/|\\\\)[._]',
include: [
'src'
],
includePattern: '\\.js$'
},
templates: {
copyright: 'Copyright 2017 Google, LLC.',
includeDate: false,
sourceFiles: false,
systemName: '{{ package_name }}',
theme: 'lumen'
}
};
26 changes: 26 additions & 0 deletions synthtool/gcp/templates/node_library/.nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"report-dir": "./.coverage",
"exclude": [
"src/*{/*,/**/*}.js",
"src/*/v*/*.js",
"test/**/*.js"
],
"watermarks": {
"branches": [
95,
100
],
"functions": [
95,
100
],
"lines": [
95,
100
],
"statements": [
95,
100
]
}
}
43 changes: 43 additions & 0 deletions synthtool/gcp/templates/node_library/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Contributor Code of Conduct

As contributors and maintainers of this project,
and in the interest of fostering an open and welcoming community,
we pledge to respect all people who contribute through reporting issues,
posting feature requests, updating documentation,
submitting pull requests or patches, and other activities.

We are committed to making participation in this project
a harassment-free experience for everyone,
regardless of level of experience, gender, gender identity and expression,
sexual orientation, disability, personal appearance,
body size, race, ethnicity, age, religion, or nationality.

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery
* Personal attacks
* Trolling or insulting/derogatory comments
* Public or private harassment
* Publishing other's private information,
such as physical or electronic
addresses, without explicit permission
* Other unethical or unprofessional conduct.

Project maintainers have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct.
By adopting this Code of Conduct,
project maintainers commit themselves to fairly and consistently
applying these principles to every aspect of managing this project.
Project maintainers who do not follow or enforce the Code of Conduct
may be permanently removed from the project team.

This code of conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community.

Instances of abusive, harassing, or otherwise unacceptable behavior
may be reported by opening an issue
or contacting one or more of the project maintainers.

This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0,
available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/)