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

chore: setup ci & release workflows, update readme #24

Merged
Merged
Show file tree
Hide file tree
Changes from all 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
11 changes: 11 additions & 0 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: ci-workflow
on:
push:
branches:
- master
pull_request:
workflow_dispatch:

jobs:
ci-build-job:
uses: looker-open-source/reusable-actions/.github/workflows/marketplace-viz-ci-build.yml@main
21 changes: 21 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: ci-release-workflow

on:
push:
branches:
- master
workflow_dispatch:

# Cancels any release workflows in progress
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true

jobs:
ci-release-job:
permissions:
contents: write
pull-requests: write
uses: looker-open-source/reusable-actions/.github/workflows/marketplace-viz-release.yml@main
# Inherits the Looker Automation Bot token to create release PRs and releases
secrets: inherit
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/
.DS_STORE
yarn-error.log
dist/
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn run format && yarn run test && yarn run build
yarn run format && yarn run test && yarn run build:legacy
78 changes: 24 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,72 +1,42 @@
# Multiple Value Visualization

### What if I find an error? Suggestions for improvements?
### What if I find an error or want to suggest improvements?

Great! Marketplace content -- including visualizations -- were designed for continuous improvement through the help of the entire Looker community and we'd love your input. To report an error or improvement recommendation, please get in touch at help.looker.com to submit a request. Please be as detailed as possible in your explanation and we'll address it as quick as we can.
We welcome your contributions to this open source visualization with a pull request. Please reach out to Google Cloud support to report an error or suggest an improvement. You can also extend this visualization for your own use case.

### Interested in extending the visualization for your own use case?
### Local development

#### Quickstart Dev Instructions
You must have Node v16 and `yarn` installed.

1. **Install Dependecies.**
#### Install Dependencies

Using yarn, install all dependencies and the git hooks to ensure code
quality using:
Call `yarn` to install all dependencies, includes React.

```
yarn
```
```
yarn
```

2. ** Install all the git hooks to ensure code quality using**
#### Build javascript

```
yarn prepare
```
Run `yarn build` to bundle the javascript. The resulting minified bundle.js will be in the `dist` directory.

3. **Make changes to the source code**
```
yarn build
```

4. **Compile your code**
#### Local testing and other commands

You need to compile your react code, let's run:
Check package.json for additional commands.

```
yarn build
```
#### Commit title format

Recommended: Webpack can detect changes and build automatically
Commit titles on `master` branch follow [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/#summary) message spec. Your commit title must prefix one of 3 types and an optional `!` with the format `TYPE: commit title goes here`.

```
yarn watch
```
- `fix` - a commit of the type fix patches a bug (correlates with PATCH in Semantic Versioning). `fix: Correct number formatting`
- `feat` - a commit of the type feat introduces a new feature (correlates with MINOR in Semantic Versioning). `feat: Add column sorting`
- `chore` - a commit of the type chore does not affect viz functionality (corresponds with no change in Semantic Versioning). `chore: Update build process`
- Append an `!` exclamation point to the type if it is a breaking change. `fix!: ...`

Your compiled code can be found in this repo.
#### Release management

5. **Running unit tests**

```shell
yarn test
```

or

```shell
bin/test
```

**`multiple_value.js`**: This visualization's minified distribution file.

**`LICENSE`**: Looker's Marketplace content License file.

**`manifest.lkml`**: Looker's external dependencies configuration file. The visualization object is defined here.

**`marketplace.json`**: A JSON file containing information the marketplace installer uses to set up this project.

**`/src`**: This directory will contain all of the visualization's source code.

**`/node_modules`**: The directory where all of the modules of code that your project depends on (npm packages) are automatically installed.

**`README.md`**: This! A text file containing useful reference information about this visualization.

**`yarn.lock`**: [Yarn](https://yarnpkg.com/) is a package manager alternative to npm. This file serves essentially the same purpose as `package-lock.json`, just for a different package management system.

**`.babelrc`**: A configuration file for the Babel jsx -> js compiler.
This repo uses GitHub workflows with [release-please](https://github.com/googleapis/release-please) [action](https://github.com/google-github-actions/release-please-action) to create Github releases, determine versioning, and generate changelogs.
73 changes: 0 additions & 73 deletions multiple_value.js

This file was deleted.

7 changes: 2 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"description": "",
"main": "",
"scripts": {
"prepare": "husky install",
"build": "env NODE_OPTIONS='--openssl-legacy-provider' webpack --config webpack.config.js",
"build": "webpack --config webpack.config.js",
"build:legacy": "env NODE_OPTIONS='--openssl-legacy-provider' webpack --config webpack.config.js",
"start": "webpack-dev-server --open",
"watch": "webpack-dev-server --watch --progress",
"format": "prettier --ignore-path .prettierignore --write '**/*.js'",
Expand Down Expand Up @@ -41,8 +41,6 @@
"@babel/plugin-proposal-class-properties": "^7.5.5",
"@babel/preset-env": "^7.9.5",
"@babel/preset-react": "^7.9.4",
"@commitlint/cli": "^18.2.0",
"@commitlint/config-conventional": "^18.1.0",
"@types/react": "^16.9.49",
"@types/react-dom": "^16.9.8",
"@types/styled-components": "^5.1.3",
Expand All @@ -53,7 +51,6 @@
"eslint-config-prettier": "^6.2.0",
"eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-react": "^7.14.3",
"husky": "^8.0.3",
"jest": "^29.7.0",
"prettier": "3.0.3",
"style-loader": "^2.0.0",
Expand Down
6 changes: 2 additions & 4 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ var webpackConfig = {
},
},
output: {
filename: '[name].js',
path: __dirname,
library: '[name]',
libraryTarget: 'umd',
filename: 'bundle.js',
path: path.join(path.resolve(__dirname), '/dist'),
},
module: {
rules: [
Expand Down