Skip to content

Commit

Permalink
feat: looker resources index (#931)
Browse files Browse the repository at this point in the history
* feat: Add looker resources index. See bin/looker-resources-index/README.md for details
  • Loading branch information
fabio-looker authored Dec 28, 2021
1 parent 861c105 commit 82e965b
Show file tree
Hide file tree
Showing 18 changed files with 1,363 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bin/looker-resources-index/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
tmp
18 changes: 18 additions & 0 deletions bin/looker-resources-index/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Looker Resources Index

This folder contains data (in code) about Looker-related resources and scripts to maintain and repackage that data for publication.

The main location that the data is maintained is in `src/resource-data/resources.ts`

The main output of these scripts is a JSON file in `../../docs/resources` intended to be checked in to git and consumed via CDN. You may also import the typescript exports from this folder, for example to benefit from type declarations.

* Before use, install dependencies with `yarn install`
* To run tests & reports about the resources data, `yarn run analyze`
* To build the distributable JSON file, run `yarn run build`

## Sample Use Cases

- Create a "resource explorer" UI (for developer portal or hackathons)
- Generate a "home"/"index" page for the developer portal
- Generate an "Overview" page for each platform feature page (e.g. Actions, API, etc.)
- Find and embed "related resources" into specific articles and content
21 changes: 21 additions & 0 deletions bin/looker-resources-index/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "looker-resources-index",
"description": "A listing of Looker-related resources, and some automation for publishing the listing in consumable formats",
"main": "src/resource-data/resources.ts",
"private": true,
"engines": {
"node": ">=12.0.0"
},
"scripts": {
"start": "echo \"No 'start' command available. Did you want to 'build'?\"",
"build": "node_modules/.bin/tsc --project . && node tmp/compiled-typescript/scripts/build.js",
"analyze": "node_modules/.bin/tsc --project . && node tmp/compiled-typescript/scripts/analyze/cli.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Looker",
"license": "MIT",
"devDependencies": {
"@types/node": "^16.11.13",
"typescript": "^4.5.4"
}
}
42 changes: 42 additions & 0 deletions bin/looker-resources-index/src/resource-data/definitions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
MIT License
Copyright (c) 2021 Looker Data Sciences, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
import type { LocaleString } from '../types'
import { ContentType } from '../types'

export const contentType: Record<string, LocaleString> = {
[ContentType.demo]:
'Demo content demonstrates a use case and/or business value without the need for coding, configuration, or installation.',
[ContentType.sandbox]:
'Sandbox content allows interactive testing, coding, and simulation, without the need for setup or installation.',
[ContentType.sampleCode]:
'Sample code refers to illustrative code, usually simplified, that is representative of code that would be written by an application or service that integrates with one of our platform features.',
[ContentType.sourceCode]:
'Source code refers to the underlying code that defines our integrations. It is available for our open-source platform features, such as the Action API. It can often play a similar role to reference material, and can be much more complex than sample code.',
[ContentType.library]:
'Code that can be consumed as a dependency of other code, usually via a package/module manager',
[ContentType.installableCode]:
'Installable code is template or sample code that can also be directly deployed and then modified, often through existing automation such as the Looker Marketplace, without the need to first adapt it.',
}
Loading

0 comments on commit 82e965b

Please sign in to comment.