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

Update to V5 #115

Merged
merged 48 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
98fc1e3
remove unused account call
Feb 16, 2023
1d8a19e
update to support targeting modification via quick pick
Nov 23, 2023
a12ac2f
Remove unused import and code
Nov 23, 2023
f10db99
update README for existing functionality
Nov 25, 2023
e8e27b4
update README
Nov 26, 2023
1882bef
getting ready for prerelease
Jan 25, 2024
a4498e4
update changelog
Jan 25, 2024
cdc5db0
fixes
Jan 27, 2024
9ff80f4
update ci
Jan 30, 2024
fbdb477
Refactor CI configuration and update Node.js version
Jan 30, 2024
8c6024a
switch to xvfb action
Jan 30, 2024
ebc27a5
remove DISPLAY var
Jan 30, 2024
048808c
move test to xvfb
Jan 30, 2024
0fbff0c
xvfb both steps
Jan 30, 2024
f5d52bd
remove command
Jan 30, 2024
026d29e
switch test runner
Jan 30, 2024
e9843f9
switch xvfb
Jan 30, 2024
45a875b
test updates
Jan 30, 2024
d81053f
prettier fixes
Jan 30, 2024
4a12107
lint fixes
Jan 30, 2024
543502f
update version
Jan 30, 2024
759ddea
update CI version
Jan 30, 2024
0c0ad88
fix: double listed command
Feb 1, 2024
b3d6610
fix: double listed command
Feb 1, 2024
40a878f
wrap commands in try/catch blocks for registering
Feb 2, 2024
98bd49b
lint and prettier fixes
Feb 2, 2024
8cfe646
clean up logs
Feb 2, 2024
0a6bd2b
set action to v1.5.0
Feb 2, 2024
d50bde7
fix: targeting rules bug
Feb 3, 2024
99f65da
fix: flag lens variations
Feb 4, 2024
d72450c
add: missing icon files
Feb 4, 2024
793747a
add: gitlens mention
Feb 4, 2024
e4ff293
fix: remove console log from release view
Feb 6, 2024
35d0029
fix: build
Feb 6, 2024
c6a4ac0
xvfb change
Feb 6, 2024
f96bf01
move debug logging to separate file
Feb 6, 2024
31711d7
wrap context conditional for test
Feb 6, 2024
3fc468d
update to v5
Feb 6, 2024
f97284a
update README
Feb 6, 2024
97256ac
Update CHANGELOG.md
Feb 6, 2024
5c0bb77
Update README.md
Feb 6, 2024
ef06070
Update README.md
Feb 6, 2024
6d98c79
Update README.md
Feb 6, 2024
0f0d864
Update src/utils/contextYAML.ts
Feb 6, 2024
954e966
Update src/utils/rulesYaml.ts
Feb 6, 2024
fb4a00c
Update test/flagLens.test.ts
Feb 6, 2024
b9ac06e
Remove unneeded files
Feb 6, 2024
e538573
prettier fixes
Feb 6, 2024
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
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
Loading