Skip to content

Commit

Permalink
feat: bring across dev/2.x.x branch for release as new extension
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Horton <[email protected]>
  • Loading branch information
madpah committed Jul 10, 2023
1 parent d8f7b6a commit 094eaf8
Show file tree
Hide file tree
Showing 174 changed files with 48,201 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .circleci/circleci-readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
CI Debug Notes
================
To validate some circleci stuff, I was able to run a “build locally” using the steps below.
The local build runs in a docker container.

* (Once) Install circleci client (`brew install circleci`)

* Convert the “real” config.yml into a self contained (non-workspace) config via:

circleci config process .circleci/config.yml > .circleci/local-config.yml

* Run a local build with the following command:

circleci local execute -c .circleci/local-config.yml --job 'build_and_test-39'

Typically, both commands are run together:

circleci config process .circleci/config.yml > .circleci/local-config.yml && circleci local execute -c .circleci/local-config.yml --job 'build_and_test-39'

With the above command, operations that cannot occur during a local build will show an error like this:

```
... Error: FAILED with error not supported
```
However, the build will proceed and can complete “successfully”, which allows you to verify scripts in your config, etc.
If the build does complete successfully, you should see a happy yellow `Success!` message.
92 changes: 92 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Copyright 2020-present Sonatype Inc.
#
# 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.
version: 2.1

orbs:
node: circleci/[email protected]

jobs:
build_and_test:
docker:
- image: 'cimg/base:stable'
resource_class: medium+
steps:
- checkout
- node/install:
install-yarn: true
node-version: '18.14.2' # LTS of 18 @ 24-Feb-2023
- node/install-packages:
pkg-manager: yarn
- run:
name: Confirm Node Version
command: node --version
- run:
name: Lint
command: yarn run lint
- run:
name: Build
command: yarn webpack --mode production --env production --no-watch
- run:
name: Test
command: yarn run test
- run:
name: Create ZIP of Build
command: cd build && zip -r sonatype-platform-browser-extension.zip * && cd ..
- store_artifacts:
path: build/sonatype-platform-browser-extension.zip
destination: sonatype-platform-browser-extension.zip

release_build:
docker:
- image: 'cimg/base:stable'
resource_class: medium+
steps:
- checkout
- node/install:
install-yarn: true
node-version: '18.14.2' # LTS of 18 @ 24-Feb-2023
- run:
name: Confirm Node Version
command: node --version
- run:
name: Lint
command: yarn run lint
- run:
name: Build
command: yarn webpack --mode production --env production --no-watch
- run:
name: Test
command: yarn run test
- run:
name: Semantic Release
command: npx semantic-release
- run:
# See https://circleci.com/blog/continuously-deploy-a-chrome-extension/
name: Publish to Chrome Store
command: echo 'Coming soon...'

workflows:
ci:
jobs:
- build_and_test:
filters:
branches:
ignore: main

release:
jobs:
- release_build:
filters:
branches:
only: main
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
webpack.config.js
53 changes: 53 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"root": true,
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": ["./tsconfig.json", "./tsconfig.service-worker.json"],
"ecmaVersion": 2020,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"plugins": [
"@typescript-eslint",
"react",
"react-hooks",
"eslint-plugin-import",
"prettier"
],
"rules": {
"@typescript-eslint/strict-boolean-expressions": [
2
// {
// "allowString" : false,
// "allowNumber" : false
// }
],
"react/jsx-filename-extension": [
"warn",
{
"extensions": [
".jsx",
".tsx"
]
}
],
"react/prop-types": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn"
},
"ignorePatterns": ["src/**/*.test.ts", "src/frontend/generated/*"],
"env": {
"browser": true
},
"settings": {
"react": {
"version": "detect"
}
}
}
41 changes: 41 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*

data
dist
packages

.circleci/local-config.yml
SAVETEXT.txt

.yarn
.yarnrc

yarn.lock

# Sonatype IQ Config
.sonatype-config

# CI (local config)
.circleci/local*.yml
16 changes: 16 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"printWidth": 120,
"trailingComma": "es5",
"tabWidth": 4,
"semi": false,
"singleQuote": true,
"bracketSpacing": true,
"jsxBracketSameLine": true,
"arrowParens": "always",
"endOfLine": "auto",
"jsxSingleQuote": true,
"proseWrap": "preserve",
"quoteProps": "as-needed",
"useTabs": false,
"htmlWhitespaceSensitivity": "css"
}
16 changes: 16 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"branches": [
"main"
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
["semantic-release-chrome", {
"extensionId": "mjehedmoboadebjmbmobpedkdgenmlhd",
"asset": "my-extension.zip"
}],
["@semantic-release/github", {
"assets": "dist/*.tgz"
}]
]
}
Loading

0 comments on commit 094eaf8

Please sign in to comment.