Skip to content

Commit

Permalink
Update to V5 (#115)
Browse files Browse the repository at this point in the history
* remove unused account call

* update to support targeting modification via quick pick

* Remove unused import and code

* update README for existing functionality

* update README

WIP commit of all changes

* getting ready for prerelease

* update changelog

* fixes

* update ci

* Refactor CI configuration and update Node.js version

* switch to xvfb action

* remove DISPLAY var

* move test to xvfb

* xvfb both steps

* remove command

* switch test runner

* switch xvfb

* test updates

* prettier fixes

* lint fixes

* update version

* update CI version

* fix: double listed command

fix: first entry in flag list not expanding

* fix: double listed command

fix: first entry in flag list not expanding

* wrap commands in try/catch blocks for registering

* lint and prettier fixes

* clean up logs

update publish action

* set action to v1.5.0

* fix: targeting rules bug

clean up targeting implementation

* fix: flag lens variations

add: osmo icon

simplify multiple functions

add: released flags highlights

* add: missing icon files

* add: gitlens mention

* fix: remove console log from release view

add: sort project in configuration based on current

add status bar and trigger config command

* fix: build

remove: unused comments

* xvfb change

* move debug logging to separate file

* wrap context conditional for test

* update to v5

* update README

* Update CHANGELOG.md

Co-authored-by: Henry Barrow <[email protected]>

* Update README.md

Co-authored-by: Henry Barrow <[email protected]>

* Update README.md

Co-authored-by: Henry Barrow <[email protected]>

* Update README.md

Co-authored-by: Henry Barrow <[email protected]>

* Update src/utils/contextYAML.ts

Co-authored-by: Henry Barrow <[email protected]>

* Update src/utils/rulesYaml.ts

Co-authored-by: Henry Barrow <[email protected]>

* Update test/flagLens.test.ts

Co-authored-by: Henry Barrow <[email protected]>

* Remove unneeded files

* prettier fixes

---------

Co-authored-by: Henry Barrow <[email protected]>
  • Loading branch information
InTheCloudDan and ldhenry authored Feb 6, 2024
1 parent d2355ca commit 92a7aef
Show file tree
Hide file tree
Showing 80 changed files with 8,139 additions and 2,906 deletions.
47 changes: 0 additions & 47 deletions .circleci/config.yml

This file was deleted.

33 changes: 33 additions & 0 deletions .fantasticonrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//@ts-check

/** @type {import('@twbs/fantasticon').RunnerOptions} */
const config = {
name: 'glicons',
prefix: 'glicon',
codepoints: require('./images/icons/template/mapping.json'),
inputDir: './images/icons',
outputDir: './dist',
fontsUrl: '#{root}/dist',
// @ts-ignore
fontTypes: ['woff2'],
normalize: true,
// @ts-ignore
assetTypes: ['html', 'scss', 'json'],
templates: {
html: './images/icons/template/icons-contribution.hbs',
scss: './images/icons/template/styles.hbs',
},
formatOptions: {
json: {
indent: 2,
},
},
pathOptions: {
woff2: './dist/glicons.woff2',
scss: './dist/glicons.scss',
html: './dist/icons-contribution.json',
json: './images/icons/template/mapping.json',
},
};

module.exports = config;
77 changes: 35 additions & 42 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,42 @@
name: CI
name: Node CI

on:
push:
branches: [ main, beta, prerelease ]
workflow_dispatch:
on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- uses: actions/setup-node@v2
with:
node-version: '14'
- run: yarn
- run: yarn prepare-beta
if: ${{ steps.extract_branch.outputs.branch == 'beta' }}
- name: Run headless test
uses: GabrielBB/xvfb-action@v1
with:
run: yarn test
- run: yarn run prettier:check
- run: yarn run lint
- name: Publish to Visual Studio Marketplace
if: ${{ steps.extract_branch.outputs.branch != 'prerelease' }}
uses: HaaLeo/publish-vscode-extension@v1
with:
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }}
registryUrl: https://marketplace.visualstudio.com
yarn: true
- name: Publish to Visual Studio Marketplace for pre-release
if: ${{ steps.extract_branch.outputs.branch == 'prerelease' }}
uses: HaaLeo/publish-vscode-extension@v1
with:
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }}
registryUrl: https://marketplace.visualstudio.com
yarn: true
preRelease: true
- name: Publish to Open VSX Registry
uses: HaaLeo/publish-vscode-extension@v0
with:
pat: ${{ secrets.OPEN_VSX_TOKEN }}
yarn: true
- uses: actions/checkout@v2

- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '18.19.0'

- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- name: Install dependencies
run: yarn

- name: Setup
run: yarn build:setup

- name: Setup xvfb
run: xvfb-run -a yarn run vscode:prepublish

- name: Run xvfb test
run: xvfb-run -a yarn test

- name: Prettier
run: yarn run prettier:check

- name: Lint
run: yarn run lint
47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI

on:
push:
branches: [ main, beta, prerelease ]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- uses: actions/setup-node@v2
with:
node-version: '18.19.0'
- run: yarn
- run: yarn build:setup
- run: yarn prepare-beta
if: ${{ steps.extract_branch.outputs.branch == 'beta' }}
- run: xvfb-run -a yarn test
- run: yarn run prettier:check
- run: yarn run lint
- name: Publish to Visual Studio Marketplace
if: ${{ steps.extract_branch.outputs.branch != 'prerelease' }}
uses: HaaLeo/[email protected]
with:
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }}
registryUrl: https://marketplace.visualstudio.com
yarn: true
- name: Publish to Visual Studio Marketplace for pre-release
if: ${{ steps.extract_branch.outputs.branch == 'prerelease' }}
uses: HaaLeo/[email protected]
with:
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }}
registryUrl: https://marketplace.visualstudio.com
yarn: true
preRelease: true
- name: Publish to Open VSX Registry
uses: HaaLeo/publish-vscode-extension@v0
with:
pat: ${{ secrets.OPEN_VSX_TOKEN }}
yarn: true
1 change: 0 additions & 1 deletion .prettierignore

This file was deleted.

15 changes: 15 additions & 0 deletions .vscode-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// .vscode-test.js
const { defineConfig } = require('@vscode/test-cli');

module.exports = defineConfig([
{
label: 'unitTests',
files: ['out/test/*.test.js'],
version: 'insiders',
workspaceFolder: './sampleWorkspace',
mocha: {
ui: 'tdd',
timeout: 20000
}
}]
);
23 changes: 22 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,35 @@
{
"version": "0.1.0",
"configurations": [
{
"name": "Extension Tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
],
"outFiles": ["${workspaceFolder}/out/test/*.test.js"]
},
{
"name": "Run Debug Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--disable-extensions", "--extensionDevelopmentPath=${workspaceFolder}"],
"sourceMaps": true,
"outFiles": ["${workspaceFolder}/out/**/*.js"]
"outFiles": ["${workspaceFolder}/dist/*"]
//"preLaunchTask": "yarn"
},
{
"name": "Run Debug Extension - Profile",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--profile=vscode-testing", "--extensionDevelopmentPath=${workspaceFolder}", "--enable-proposed-api=launchdarklyofficial.launchdarkly"],
"sourceMaps": true,
"outFiles": ["${workspaceFolder}/dist/*"]
//"preLaunchTask": "yarn"
},
{
Expand Down
5 changes: 5 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ webpack.config.js
**/*.ts
*.vsix
CHANGELOG.md
.vscode-test/
coderefs/
.github
.circleci
.nyc_output
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@

All notable changes to the "launchdarkly" extension will be documented in this file.

## [5.0.0] - 2024-02-06

### Fixed

- Numerous performance issues related to code lens.
- Initial setup now recovers better if there's been a problem.

## Changed
- Initial setup is now split into Sign in and Configuration.
- Updated CLI version of Code References.

## Added
- Code lens and hover now show SDK availability of a flag.
- Sign via through AuthProvider API.
- `LaunchDarkly: Flag Actions` command.
- Quick Targeting allows you to add/remove single context or rule from a flag.
- Flags in File now has inline commands on entry.
- Status bar icon that tells you current configured project and environment.

## [4.0.2] - 2023-02-15

### Fixed
Expand Down
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# LaunchDarkly for Visual Studio Code

[![Version](https://img.shields.io/visual-studio-marketplace/v/launchdarklyofficial.launchdarkly?style=for-the-badge&colorA=2c2c2c&colorB=23328c)](https://marketplace.visualstudio.com/items?itemName=launchdarklyofficial.launchdarkly)
[![Installs](https://img.shields.io/visual-studio-marketplace/i/launchdarklyofficial.launchdarkly?style=for-the-badge&colorA=2c2c2c&colorB=23328c)](https://marketplace.visualstudio.com/items?itemName=launchdarklyofficial.launchdarkly)
[![Downloads](https://img.shields.io/visual-studio-marketplace/d/launchdarklyofficial.launchdarkly?style=for-the-badge&colorA=2c2c2c&colorB=23328c)](https://marketplace.visualstudio.com/items?itemName=launchdarklyofficial.launchdarkly)
[![Ratings](https://img.shields.io/visual-studio-marketplace/r/launchdarklyofficial.launchdarkly?style=for-the-badge&colorA=2c2c2c&colorB=23328c)](https://marketplace.visualstudio.com/items?itemName=launchdarklyofficial.launchdarkly)

The LaunchDarkly VSCode extension provides utilities that make it easy to work with feature flags using LaunchDarkly without ever leaving VSCode. See details about feature flags defined in your code, toggle them on or off, search for usage, see all possible flag variations and more.

<img src="https://github.com/launchdarkly/ld-vscode/raw/master/images/screenshot.png?raw=true" alt="screenshot" width="100%">
Expand All @@ -11,8 +16,10 @@ The LaunchDarkly VSCode extension provides utilities that make it easy to work w
- Open feature flags in LaunchDarkly (Default keybind: `ctrl+alt+g`/`⌘+alt+g`)
- [Feature flag explorer](#feature-flag-explorer): view a list of your feature flags and their settings in the explorer view
- [Create Boolean Flag](#create-boolean-flag)
- [Quick Links](#quick-links) to LaunchDarkly.
- [Flag Actions](#flag-actions-command)
- [Quick Links](#quick-links) to LaunchDarkly
- [Flags in File](#flags-in-file)
- [Flag Lens](#flag-lens)

Read our official documentation about this extension at <https://docs.launchdarkly.com/integrations/vscode>

Expand All @@ -33,6 +40,11 @@ Information required:

<img src="https://github.com/launchdarkly/ld-vscode/raw/beta/images/create-boolean-flag.gif?raw=true" width="350px" height="300px" alt="Create feature flag command">

### Flag Actions Command
Use the `LaunchDarkly: Flag Actions` command to bring up a menu of options that you can choose from to interact with your feature flags.

![Flag Actions](images/flag-actions.png)

### Toggle Feature Flag
Change the enabled state of a feature flag without moving your hands from your keyboard.

Expand Down Expand Up @@ -67,6 +79,14 @@ Flag names in the treeview can be right-clicked where you can update a flag's st

<img src="https://github.com/launchdarkly/ld-vscode/raw/beta/images/treeview-right-click.png?raw=true" width="350px" height="100px" alt="right click menu options">

### Flag Lens
The Flag Lens functionality shows insights about the usage and status of LaunchDarkly feature flags directly in the code. For a given feature flag in the codebase, the Flag Lens displays:

__Flag Name__: The feature flag's name as it appears in LaunchDarkly.
__Flag Status__: Whether the flag is currently enabled or disabled.
__Variation Information__: Which variation or value of the flag is currently being served.

This is OFF by default. It can be enabled through Settings > LaunchDarkly Extension > Enable Flag Lens.

## Contributing

Expand Down
Binary file added images/flag-actions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions images/icons/osmo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions images/icons/template/icons-contribution.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"icons": {
{{#each codepoints}}
"gitlens-{{@key}}": {
"description": "{{@key}} icon",
"default": {
"fontPath": "dist/glicons.woff2",
"fontCharacter": "\\\{{codepoint this}}"
}
{{#if @last}}
}
{{else}}
},
{{/if}}
{{/each}}
}
}
3 changes: 3 additions & 0 deletions images/icons/template/mapping.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"osmo": 61997
}
Loading

0 comments on commit 92a7aef

Please sign in to comment.