Skip to content

Commit

Permalink
Feature/manifest v3 migration (#63)
Browse files Browse the repository at this point in the history
* BDE-226 adding nix develop and direnv for development environment setup

* BDE-226 initiated github CI workflow

* BDE-226 reviewed building, splitted app from generated files, imported libs from node_modules

* updated dependencies
* splitted app from transpilled files (babel)
* imported libs from dependencies
* allow using local connect (let's use the URL protocol)
* ...

* BDE-226 v3 manifest refactor

* moving from backround page to service worker
* always call service worker components from popup pages

* BDE-226 disabled building and running tests

* BDE-226 attach zip files to the build

* BDE-226 nuxeo server locator should'nt [de]activate tab while stating about nuxeo URL

* BDE-226 fixing-up document browsing (json tab included)

* WIP fixing up web-designed preview pipeline

* BDE-226 fix CI artifact upload

* BDE-226 fix typo on action operation in service connector

* BDE-226 move on redirection from webRequest to declarativeNetRequest

* BDE-226 log null evaluation of tab URLs

* BDE-226 bind dynamically methods in constructors

* BDE-226 fixing up designer live preview redirections

* BDE-226 vite/terser update

* BDE-226 reviewed tab activation

* BDE-226 open tab when connect unauthenticated on studio project

* BDE-226 inject basic auth header for redirection using https

* BDE-226 accept non-redirected pages from designer-livepreview (to be refined)

* BDE-226 fixing up the basic authentication rule workaround in declarative net

* BDE-226 make use of session rules in declarative net engine

* BDE-226 cleaning service worker bootstrap

* BDE-226 removed unused information retrieves from groovy studio package name checker

* BDE-226 fixing up json highlighting css loading

* BDE-226 removed duplicate code from repository indexer

* BDE-226 fixing up toggle classes in elastic search indexing

* BDE-226 cosmit (package.json)

* BDE-226 enhanced repository indexing notification

* BDE-226 fixing up hot-reload operation invokes

* BDE-226 bootstrap better

* BDE-226 use scheme transform to redirect allowing to get the secure cookie injection

* BDE-226 renamed variables in global scope for debugging

* BDE-226 better handling of undo in declarative net rules

* BDE-226 relocated locally all /index-* includes in popup web pages

* BDE-226 introduce a base class for dynamically introspecting service worker components

* BDE-226 display studio package name

* BDE-226 aligned linting with code base

* BDE-226 studio project registration reviewed (to be continued)

* BDE-226 allow registering other developed studio project

* BDE-226 fixing up buttons enabling states

* BDE-226 fixing up components promise availability

* BDE-226 fixing up about displaying

* BDE-226 reviewed no studio project installed

* BDE-226 server errors notification cleanup

* BDE-226 always disable tab extension when not on an nuxeo server page (as enabling do already)

* BDE-226 renamed withXXX to asXXX when not providing an input

* BDE-226 fixing up missing pending rules reset in declarative net after flushing

* BDE-226 better designer live review button displaying and click handling

* BDE-226 fixup nuxeo operation empty content response handling
  - convert response into an empty JSON object in connector

* BDE-226 reviewed connect and nuxeo server discovering

* BDE-226 do not display registered package name in popup heading

* BDE-226 fixing tab navigation on doc path

* BDE-226 cleaning up manifest permissions

* BDE-226 added release job in github workflow

- defined version from package.json
- injected built version in dotenv
- generated manifest version according to

* BDE-226 popups should always use promises from the service worker

* BDE-226 reset jQuery handlers when reloading from step debugger

* BDE-226 better promises handling when saving options

* BDE-226 added development mode feature flags for 'studio-package-name' at first

* BDE-226 better handling of the popup displaying

  - get connect location from the nuxeo server
  - allow to override the connect location for the nuxeo server connected
  - hide the popup page building, display it when the load ends up

* BDE-226 shared service worker bridge bootstrap logic

- allow to bind a service workspace bridge and
    to bootstrap an entry point with.
  - used in main and about popup pages

* BDE-226 fixing up missing development mode when building entry points

* BDE-226 trying to capture cookies from document content

* BDE-226 fixing up https redirection in live preview

  we finally get cookie header from the browser for the
  hosts we have permissions to.
  (localhost:8080, com.nuxeo.connect and nos-preprod-connect.nuxeocloud.com)

* BDE-226 ensure links content always being displayed in viewport

* BDE-226 ensure we're releasing the correct zip file for chrome

* BDE-226 better notifying user on hot-reload errors

* BDE-226 reduced permissions on the manifest extension according to features

* BDE-226 fixup doc browser loading from home page on webUI

* BDE-226 cleaning up query search form

* BDE-226 reviewed desktop notifier and un-registered studio package

* BDE-226 shade popup when no studio package registered

* BDE-226 ensure right server being selected

* prevent connection to production server
* display popups for unregistered studio project and development mode disabled

* BDE-226 cleaning up useless folders
  • Loading branch information
nxmatic authored Apr 6, 2024
1 parent 2a5078b commit 049e20c
Show file tree
Hide file tree
Showing 151 changed files with 15,586 additions and 40,053 deletions.
5 changes: 4 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"presets": ["@babel/preset-env"]
"presets": ["@babel/preset-env"],
"plugins": [
["@babel/plugin-proposal-decorators", { "legacy": true }]
]
}
15 changes: 15 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# inlined shared variables, no needs of encryption

[[ -z "$GITHUB_WORKSPACE" ]] &&
source_up

[[ -z "$(command -v nix)" ]] &&
return

set -a
TAG_VERSION=0.0.0
set +a

pushd .nix
use flake . --impure
popd
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test/**
57 changes: 57 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"parser": "@babel/eslint-parser",
"parserOptions": {
"ecmaVersion": 2022,
"ecmaFeatures": {
"legacyDecorators": true,
"importAssertions": true
}
},
"extends": [
"eslint:recommended",
"airbnb-base"
],
"rules": {
"comma-dangle": "off",
"func-names": 0,
"indent": ["error", 2],
"import/no-extraneous-dependencies": ["error", {"devDependencies": ["**/*"]}],
"max-len": [2, 120, 2, {
"ignoreUrls": true,
"ignoreTemplateLiterals": true,
"ignoreRegExpLiterals": true,
"ignoreStrings": true,
"ignoreComments": false
}],
"no-console": 0,
"no-else-return": 0,
"no-multi-assign": 0,
"no-param-reassign": 0,
"no-throw-literal": 0,
"no-tabs": 0,
"no-underscore-dangle": 0,
"no-unused-expressions": 0,
"no-use-before-define": ["error", {"variables": false}],
"no-useless-escape": 0,
"operator-linebreak": "off",
"prefer-destructuring": ["error", {
"array": false,
"object": false
}, {
"enforceForRenamedProperties": false
}],
"radix": 0,
"wrap-iife": [2, "inside"]
},
"globals": {
"chrome": true,
"browser": true,
"app": true,
"navigator": true,
"window": true,
"document": true,
"Nuxeo": true,
"disableTabExtension": true,
"hljs": true
}
}
68 changes: 68 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: CI Build

on:
pull_request:

push:
branches:
- 'master'
- 'develop' # gitflow mainly on hosted runner
- '*-maintenance'
tags:
- 'v*'

workflow_dispatch:

workflow_call:

jobs:
build:
runs-on:
- ${{ github.repository_owner != github.actor && 'ubuntu-latest' || 'self-hosted' }}

steps:

- name: Checkout Commit
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

- name: Install pnpm
run: |
corepack enable
corepack prepare pnpm@next-8 --activate
- name: Install dependencies
run: pnpm install

- name: Build
run: pnpm build:chrome

- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: chrome
path: ./dist/chrome

- name: Zip artifact
if: startsWith(github.ref, 'refs/tags/v')
env:
VERSION: ${{ github.ref_name }}
run: |
cd ./dist/chrome
zip -r ../BrowserDeveloperExtension-Chrome-$VERSION.zip .
- name: Create Release and Upload Asset
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
files: ./dist/BrowserDeveloperExtension-Chrome-*.zip
draft: true
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
node_modules
temp
.tmp
build
dist
.sass-cache
.npmrc
bower_components
package
app/scripts
app/vendor
npm-debug.log
target
test*/screenshots/*.png
Expand All @@ -17,4 +16,8 @@ ftest/src/test/resources/instance.clid
.project
ftest/.settings/
selenium-standalone.txt
.local
.local
.nix/.devenv
.env.chrome
.env.firefox
.env.local
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "make.d"]
path = make.d
url = https://github.com/nuxeo/nos-jx-make.d.git
8 changes: 8 additions & 0 deletions .groovylintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "recommended",
"rules": {
"CompileStatic": {
"enabled": false
}
}
}
22 changes: 22 additions & 0 deletions .hintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"extends": [
"development"
],
"hints": {
"meta-viewport": "off",
"axe/language": [
"default",
{
"html-has-lang": "off"
}
],
"compat-api/css": [
"default",
{
"ignore": [
"text-align-last"
]
}
]
}
}
1 change: 0 additions & 1 deletion .jx/.gitignore

This file was deleted.

18 changes: 0 additions & 18 deletions .lighthouse/jenkins-x/Kptfile

This file was deleted.

22 changes: 0 additions & 22 deletions .lighthouse/jenkins-x/jenkins-trigger.yaml

This file was deleted.

22 changes: 0 additions & 22 deletions .lighthouse/jenkins-x/triggers.yaml

This file was deleted.

10 changes: 10 additions & 0 deletions .nix/.envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs="
fi

nix_direnv_watch_file flake.nix
nix_direnv_watch_file flake.lock
if ! use flake . --impure
then
echo "devenv could not be built. The devenv environment was not loaded. Make the necessary changes to devenv.nix and hit enter to try again." >&2
fi
1 change: 1 addition & 0 deletions .nix/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.devenv
Loading

0 comments on commit 049e20c

Please sign in to comment.