Skip to content

Commit

Permalink
feat!: initial generation of library (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoe authored Jan 4, 2020
1 parent 41116c1 commit 2311ea1
Show file tree
Hide file tree
Showing 44 changed files with 30,310 additions and 30 deletions.
5 changes: 5 additions & 0 deletions packages/google-monitoring-dashboard/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
**/node_modules
src/**/doc/*
build/
docs/
protos/
15 changes: 15 additions & 0 deletions packages/google-monitoring-dashboard/.eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
extends:
- 'eslint:recommended'
- 'plugin:node/recommended'
- prettier
plugins:
- node
- prettier
rules:
prettier/prettier: error
block-scoped-var: error
eqeqeq: error
no-warning-comments: warn
no-var: error
prefer-const: error
15 changes: 15 additions & 0 deletions packages/google-monitoring-dashboard/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
**/*.log
**/node_modules
.coverage
coverage
.nyc_output
docs/
out/
build/
system-test/secrets.js
system-test/*key.json
*.lock
.DS_Store
package-lock.json
__pycache__

48 changes: 48 additions & 0 deletions packages/google-monitoring-dashboard/.jsdoc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// Copyright 2019 Google LLC
//
// 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
//
// https://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/jsdoc-fresh',
recurse: true,
verbose: true,
destination: './docs/'
},
plugins: [
'plugins/markdown',
'jsdoc-region-tag'
],
source: {
excludePattern: '(^|\\/|\\\\)[._]',
include: [
'build/src'
],
includePattern: '\\.js$'
},
templates: {
copyright: 'Copyright 2018 Google, LLC.',
includeDate: false,
sourceFiles: false,
systemName: '@google-cloud/monitoring-dashboards',
theme: 'lumen'
},
markdown: {
idInHeadings: true
}
};
24 changes: 24 additions & 0 deletions packages/google-monitoring-dashboard/.nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"report-dir": "./.coverage",
"reporter": ["text", "lcov"],
"exclude": [
"**/*-test",
"**/.coverage",
"**/apis",
"**/benchmark",
"**/conformance",
"**/docs",
"**/samples",
"**/scripts",
"**/protos",
"**/test",
"**/*.d.ts",
".jsdoc.js",
"**/.jsdoc.js",
"karma.conf.js",
"webpack-tests.config.js",
"webpack.config.js"
],
"exclude-after-remap": false,
"all": true
}
3 changes: 3 additions & 0 deletions packages/google-monitoring-dashboard/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/*
samples/node_modules/*
src/**/doc/*
8 changes: 8 additions & 0 deletions packages/google-monitoring-dashboard/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
bracketSpacing: false
printWidth: 80
semi: true
singleQuote: true
tabWidth: 2
trailingComma: es5
useTabs: false
13 changes: 13 additions & 0 deletions packages/google-monitoring-dashboard/.repo-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "monitoring-dashboards",
"name_pretty": "Monitoring Dashboards",
"product_documentation": "https://cloud.google.com/monitoring/docs",
"client_documentation": "https://googleapis.dev/nodejs/monitoring-dashboards/latest",
"issue_tracker": "https://issuetracker.google.com/savedsearches/559785",
"release_level": "beta",
"language": "nodejs",
"repo": "googleapis/nodejs-monitoring-dashboards",
"distribution_name": "@google-cloud/monitoring-dashboards",
"api_id": "monitoring.googleapis.com",
"requires_billing": true
}
48 changes: 42 additions & 6 deletions packages/google-monitoring-dashboard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
# [Monitoring Dashboards: Node.js Client](https://github.com/googleapis/nodejs-monitoring-dashboards)

[![release level](https://img.shields.io/badge/release%20level-beta-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages)
[![npm version](https://img.shields.io/npm/v/dashboard.svg)](https://www.npmjs.org/package/dashboard)
[![npm version](https://img.shields.io/npm/v/@google-cloud/monitoring-dashboards.svg)](https://www.npmjs.org/package/@google-cloud/monitoring-dashboards)
[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-monitoring-dashboards/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-monitoring-dashboards)




Dashboard client for Node.js
interact with dashboards for viewing and analyzing metric data


* [Monitoring Dashboards Node.js Client API Reference][client-docs]
Expand All @@ -29,8 +29,8 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained].
* [Quickstart](#quickstart)
* [Before you begin](#before-you-begin)
* [Installing the client library](#installing-the-client-library)


* [Using the client library](#using-the-client-library)
* [Samples](#samples)
* [Versioning](#versioning)
* [Contributing](#contributing)
* [License](#license)
Expand All @@ -48,10 +48,46 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained].
### Installing the client library

```bash
npm install dashboard
npm install @google-cloud/monitoring-dashboards
```


### Using the client library

```javascript
// Imports the Google Cloud client library
const {
DashboardsServiceClient,
} = require('@google-cloud/monitoring-dashboards');

// Creates a client
const ds = new DashboardsServiceClient();

// parent = 'projects/my-project', // Project to list dashboards for.

async function listDashboards() {
const [dashboards] = await ds.listDashboards({
parent,
});
console.info('Listing Dashboards:');
for (const dashboard of dashboards) {
console.info(`\t${dashboard.displayName}`);
}
}
listDashboards();

```



## Samples

Samples are in the [`samples/`](https://github.com/googleapis/nodejs-monitoring-dashboards/tree/master/samples) directory. The samples' `README.md`
has instructions for running the samples.

| Sample | Source Code | Try it |
| --------------------------- | --------------------------------- | ------ |
| Quickstart | [source code](https://github.com/googleapis/nodejs-monitoring-dashboards/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-monitoring-dashboards&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) |



Expand Down Expand Up @@ -86,7 +122,7 @@ Apache Version 2.0

See [LICENSE](https://github.com/googleapis/nodejs-monitoring-dashboards/blob/master/LICENSE)

[client-docs]: https://googleapis.dev/nodejs/dashboard/latest
[client-docs]: https://googleapis.dev/nodejs/monitoring-dashboards/latest
[product-docs]: https://cloud.google.com/monitoring/docs
[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png
[projects]: https://console.cloud.google.com/project
Expand Down
4 changes: 4 additions & 0 deletions packages/google-monitoring-dashboard/codecov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
codecov:
ci:
- source.cloud.google.com
11 changes: 11 additions & 0 deletions packages/google-monitoring-dashboard/linkinator.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"recurse": true,
"skip": [
"https://codecov.io/gh/googleapis/",
"www.googleapis.com",
"https://www.npmjs.org/package/@google-cloud/monitoring-dashboards",
"https://googleapis.dev/nodejs/monitoring-dashboards/latest",
"https://github.com/googleapis/nodejs-monitoring-dashboards/blob/master/samples/quickstart.js",
"https://github.com/googleapis/nodejs-monitoring-dashboards/tree/master/samples"
]
}
55 changes: 55 additions & 0 deletions packages/google-monitoring-dashboard/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"name": "@google-cloud/monitoring-dashboards",
"version": "0.1.0",
"description": "interact with dashboards for viewing and analyzing metric data",
"repository": "googleapis/nodejs-monitoring-dashboards",
"license": "Apache-2.0",
"author": "Google LLC",
"files": [
"build/src",
"build/protos"
],
"main": "build/src/index.js",
"scripts": {
"clean": "gts clean",
"compile": "tsc -p . && cp -r protos build/",
"compile-protos": "compileProtos src",
"docs": "jsdoc -c .jsdoc.js",
"docs-test": "linkinator docs",
"fix": "gts fix && eslint samples --fix",
"lint": "gts check && eslint samples",
"predocs-test": "npm run docs",
"prepare": "npm run compile-protos && npm run compile",
"system-test": "c8 mocha build/system-test",
"test": "c8 mocha build/test",
"samples-test": "cd samples/ && npm link ../ && npm test && cd ../"
},
"dependencies": {
"google-gax": "^1.12.0"
},
"devDependencies": {
"@types/mocha": "^5.2.5",
"@types/node": "^12.0.0",
"c8": "^6.0.0",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.9.0",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-prettier": "^3.1.2",
"gts": "^1.0.0",
"jsdoc": "^3.5.5",
"jsdoc-fresh": "^1.0.1",
"jsdoc-region-tag": "^1.0.2",
"linkinator": "^1.5.0",
"mocha": "^6.0.0",
"null-loader": "^3.0.0",
"pack-n-play": "^1.0.0-2",
"prettier": "^1.19.1",
"ts-loader": "^6.2.1",
"typescript": "~3.6.4",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.10"
},
"engines": {
"node": ">=10"
}
}
Loading

0 comments on commit 2311ea1

Please sign in to comment.