Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
3aa3424
Update README.md (#272)
kal9mondal Feb 7, 2019
c68d219
fixed package-lock.json (#275)
ritwickdey Feb 7, 2019
110dee6
fixes for #255
ritwickdey Feb 12, 2019
a65c338
fixed linting issue
ritwickdey Feb 12, 2019
d46365b
v5.5.0 release
ritwickdey Feb 12, 2019
9b8c241
v5.5.1 Release for #285
ritwickdey Feb 12, 2019
b5ba37e
fixed header issue in html
ritwickdey Apr 8, 2019
4e88288
fix typo (#388)
tedsilb Apr 8, 2019
41df0b0
Add support for Browser Preview. Fixes #343 (#352)
auchenberg Apr 8, 2019
0f34e13
Fallback to random port if the default is taken. (#330)
Almo7aya Apr 8, 2019
008d5ea
switch to vscode-chokidar for #285
ritwickdey-kreeti Apr 17, 2019
a687a1f
v5.6.0 update
ritwickdey-kreeti Apr 17, 2019
c36575f
ops! Forget to publish :D
ritwickdey-kreeti Apr 17, 2019
b7e76bb
revert back to chokidar #431
ritwickdey-kreeti Apr 17, 2019
f9ae73b
version updated
ritwickdey-kreeti Apr 17, 2019
d7c4d49
doc fixed
ritwickdey-kreeti Apr 17, 2019
b0c192f
fixed doc
ritwickdey Apr 17, 2019
6756671
Update README.md
ritwickdey Apr 20, 2019
db73199
Update README.md
ritwickdey Apr 20, 2019
a4be2d7
Fixed Link
ritwickdey Apr 20, 2019
29cca17
fixed typo "behviour" to "behavior" (#2094)
josephsintum Jan 1, 2022
a6f1704
Change activationEvents to onStartupFinished (#2000)
willstocks Jan 1, 2022
92076ba
fix setting liveServer.settings.mount example code (#933)
johnnyyu0930 Jan 1, 2022
ee62b5b
Serve WASM files using the correct content-type. (#697)
fdb Jan 1, 2022
daa1789
Fixes ritwickdey/vscode-live-server/issues/1219 (#1220)
sandy081 Jan 1, 2022
6b48c17
migratated to new setup
ritwickdey Jan 1, 2022
892ef25
upgade version
ritwickdey Jan 2, 2022
21081a1
upgrade version to v5.7.0
ritwickdey Jan 18, 2022
4e1fe3b
CI version node 14.16.0
ritwickdey Jan 18, 2022
4b5c7b3
lock files up to date
ritwickdey Jan 18, 2022
c62e7ce
travis CI migration
ritwickdey Jan 18, 2022
61c40e7
skip cleanup = true
ritwickdey Jan 18, 2022
620738b
activation event updated.
ritwickdey Jan 18, 2022
43affbf
v5.7.1
ritwickdey Jan 18, 2022
1b8f82c
fixed activationEvents for javascript & SVG #2326
ritwickdey Jan 19, 2022
5f09765
lazy load of injected code
ritwickdey Jan 19, 2022
a8edc64
version 5.7.2
ritwickdey Jan 19, 2022
7c7d06a
Fixed GoLive Toogle button #2329
ritwickdey Jan 21, 2022
5891e42
v5.7.3 update
ritwickdey Jan 21, 2022
11274b7
Extension activation fixed for PHP. Version bump to v5.7.4
ritwickdey Jan 24, 2022
53c0de4
get local IP type fixed and fixed empty string condition of host sett…
ritwickdey Mar 8, 2022
e25842b
changed activationEvents to "onStartupFinished"
ritwickdey Mar 8, 2022
4f51bb7
update version to 5.7.5
ritwickdey Mar 8, 2022
6d2dfe5
Adding e2e test coverage (#2400)
christian-bromann May 7, 2022
1730f6b
Fixing HTML validator warning (#1692)
paulsmithkc May 7, 2022
ac31be3
run tests for changes on master branch (#2444)
christian-bromann Aug 30, 2022
8202218
fix: some missspellings :) (#2431)
draculapile Aug 30, 2022
f8b4cbc
fix typo and rearrange words in `src/appModel.ts` (#2465)
hamirmahal Aug 30, 2022
3d58e75
import -> require
ritwickdey Aug 30, 2022
e938eb7
removed useBrowserPreview settings
ritwickdey Aug 30, 2022
4815ade
added host with error message
ritwickdey Aug 30, 2022
6784a6a
fix release workflow
ritwickdey Aug 30, 2022
b8daa1b
change release default value
ritwickdey Aug 30, 2022
2c237d1
fix: tag push in release yml
ritwickdey Aug 30, 2022
5288abe
5.7.6
Aug 30, 2022
dfc8332
fix: require ip get call
ritwickdey Aug 30, 2022
83baf19
5.7.7
Aug 30, 2022
71bc737
Lazy load external libraries, activation time is now 3ms in MacOSM1 🎉
ritwickdey Aug 30, 2022
f36ba70
5.7.8
Aug 30, 2022
03722ff
Pin es5-ext to 0.10.53.
ritwickdey Aug 31, 2022
00c056c
add screen option to test workflow
ritwickdey Aug 31, 2022
2a9677b
fix: release pipeline
ritwickdey Aug 31, 2022
213680a
5.7.9
Aug 31, 2022
428e01c
updated grammar in appModel.ts (#2568)
Jacobkyalo Sep 6, 2022
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
136 changes: 136 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
name: Publish

on:
workflow_dispatch:
inputs:
releaseType:
description: "Release Type"
required: true
type: choice
default: "patch"
options:
- patch
- minor
- major
releaseChannel:
description: "Release Channel"
required: true
type: choice
default: stable
options:
- stable
- edge
publishMarketplace:
description: "Publish on Visual Studio Marketplace?"
required: true
type: choice
default: "no"
options:
- "yes"
- "no"
publishOpenVSX:
description: "Publish on Open VSX Registry?"
required: true
type: choice
default: "no"
options:
- "yes"
- "no"

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Clone Repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node version
uses: actions/setup-node@v1
with:
node-version: 16
- name: Install dependencies
run: npm install
- name: Build Package
run: npm run compile
- name: Run Tests
uses: GabrielBB/xvfb-action@v1
with:
run: npm test
options: "-screen 0 1600x1200x24"
- name: Create Changelog
run: |
git log $(git describe --tags --abbrev=0)..HEAD --oneline &> ${{ github.workspace }}-CHANGELOG.txt
cat ${{ github.workspace }}-CHANGELOG.txt
- name: Setup Git
run: |
git config --global user.name "Release Bot"
git config --global user.email "no-noreply@github.com"
- name: Get Current Version Number
run: |
CURRENT_VERSION=$(cat package.json | jq .version | cut -d'"' -f 2)
echo "CURRENT_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV
- name: Compile New Version (Edge)
run: |
RELEASE_VERSION=$(npx semver $CURRENT_VERSION -i pre${{ github.event.inputs.releaseType }} --preid edge)
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
echo "Bump to $RELEASE_VERSION"
if: ${{ github.event.inputs.releaseChannel == 'edge' && !contains(env.CURRENT_VERSION, 'edge') }}
- name: Compile New Version (Edge)
run: |
RELEASE_VERSION=$(npx semver $CURRENT_VERSION -i prerelease)
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
echo "Bump to $RELEASE_VERSION"
if: ${{ github.event.inputs.releaseChannel == 'edge' && contains(env.CURRENT_VERSION, 'edge') }}
- name: Compile New Version (Stable)
run: |
RELEASE_VERSION=$(npx semver $CURRENT_VERSION -i github.event.inputs.releaseType)
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
echo "Bump to $RELEASE_VERSION"
if: ${{ github.event.inputs.releaseChannel == 'stable' }}
- name: Version Package
run: |
git checkout .
npm version $RELEASE_VERSION
- name: Package Extension (Edge)
if: ${{ github.event.inputs.releaseChannel == 'edge' }}
run: |
node .github/scripts/updateEdgeVersion.js
npx vsce package --pre-release --no-git-tag-version --no-update-package-json -o "./live-server-$RELEASE_VERSION.vsix" ${{ github.event.inputs.additionalFlags }}
- name: Package Extension (Stable)
run: npx vsce package $RELEASE_VERSION --no-git-tag-version --no-update-package-json -o "./live-server-$RELEASE_VERSION.vsix" ${{ github.event.inputs.additionalFlags }}
if: ${{ github.event.inputs.releaseChannel == 'stable' }}
- name: Publish to Visual Studio Marketplace (Edge)
run: npx vsce publish --packagePath "./live-server-$RELEASE_VERSION.vsix" --pre-release --no-git-tag-version --no-update-package-json -p ${{ secrets.VSC_MKTP_PAT }} ${{ github.event.inputs.additionalFlags }}
if: ${{ github.event.inputs.publishMarketplace == 'yes' && github.event.inputs.releaseChannel == 'edge' }}
- name: Publish to Visual Studio Marketplace (Stable)
run: npx vsce publish --packagePath "./live-server-$RELEASE_VERSION.vsix" --no-git-tag-version --no-update-package-json -p ${{ secrets.VSC_MKTP_PAT }} ${{ github.event.inputs.additionalFlags }}
if: ${{ github.event.inputs.publishMarketplace == 'yes' && github.event.inputs.releaseChannel == 'stable' }}
- name: Publish to Open VSX Registry (Edge)
uses: HaaLeo/publish-vscode-extension@v1
if: ${{ github.event.inputs.publishOpenVSX == 'yes' && github.event.inputs.releaseChannel == 'edge' }}
with:
preRelease: true
pat: ${{ secrets.OPEN_VSX_TOKEN }}
extensionFile: ./live-server-${{ env.RELEASE_VERSION }}.vsix
- name: Publish to Open VSX Registry (Stable)
uses: HaaLeo/publish-vscode-extension@v1
if: ${{ github.event.inputs.publishOpenVSX == 'yes' && github.event.inputs.releaseChannel == 'stable' }}
with:
preRelease: false
pat: ${{ secrets.OPEN_VSX_TOKEN }}
extensionFile: ./live-server-${{ env.RELEASE_VERSION }}.vsix
- name: Push Tags
run: |
git log -1 --stat
git push origin master --tags
- run: |
export GIT_TAG=$(git describe --tags --abbrev=0)
echo "GIT_TAG=$GIT_TAG" >> $GITHUB_ENV
- name: GitHub Release
uses: ncipollo/release-action@v1
with:
artifacts: "./live-server-*"
bodyFile: ${{ github.workspace }}-CHANGELOG.txt
tag: ${{ env.GIT_TAG }}
prerelease: ${{ github.event.inputs.releaseChannel == 'edge' }}
36 changes: 36 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CI

on:
push:
branches:
- master
pull_request:

jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 16
- name: Install Dependencies
run: npm install
- name: Build
run: npm run compile
- name: Run Tests
uses: GabrielBB/xvfb-action@v1
if: matrix.os != 'ubuntu-latest'
with:
run: npm test
options: "-screen 0 1600x1200x24"
- name: Run Tests
uses: GabrielBB/xvfb-action@v1
if: matrix.os == 'ubuntu-latest'
with:
run: ./node_modules/.bin/run-s test:lint test:unit
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ node_modules
_site
Gemfile.lock
**/*.vsix
.vscode-test
.vscode-test
.wdio-vscode-service
*-CHANGELOG.txt
47 changes: 0 additions & 47 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.vscode/**
.vscode-test/**
.wdio-vscode-service/**
out/test/**
test/**
src/**
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog
| Version | Date | Changelog |
|---|---|---|
| 5.6.1 | 17.04.19 | Fixed `Extension host terminated unexpectedly` *[[#431](https://github.com/ritwickdey/vscode-live-server/issues/431)]*
|5.6.0 | 17.04.19 | &mdash; ***[NEW]*** Intregation of `Browser Preview` with `Live Server` *[[#352](https://github.com/ritwickdey/vscode-live-server/pull/352) - Thanks to [Kenneth Auchenberg](https://github.com/auchenberg) ]* <br><br> &mdash; ***[NEW]*** Fallback to random port If given port is busy. *[[#330](https://github.com/ritwickdey/vscode-live-server/pull/330) - Thanks to [Ali Almohaya](https://github.com/Almo7aya) ] <br><br> &mdash; ***[FIXES]**** Moved to `vscode-chokidar` lib for [#285](https://github.com/ritwickdey/vscode-live-server/issues/285). <br><br> &mdash;Doc Fixes *[[#388](https://github.com/ritwickdey/vscode-live-server/pull/388) - Thanks to [Ted Silbernagel](https://github.com/tedsilb)]*
|5.5.1|12.02.19 | &mdash; ***[Fixes]*** Fixed `Extension host terminated unexpectedly` for MacOS. [[#285](https://github.com/ritwickdey/vscode-live-server/issues/285)]
|5.5.0| 12.02.19 | &mdash; ***[Fixes]*** Fixed `ignoreFiles` settings [[#255](https://github.com/ritwickdey/vscode-live-server/issues/255)] <br> &mdash; Attempt to fix `high cpu load` [[#278](https://github.com/ritwickdey/vscode-live-server/issues/278)]
|5.4.0| 30.01.19 | Bug fix for fsevents on Visual Code Insiders.
|5.3.1| 28.11.18 | Event-Stream Package Security Update.
|5.3.0| 27.11.18 | Few Packages are upgraded.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017 Ritwick Dey
Copyright (c) 2017-2022 Ritwick Dey

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
24 changes: 17 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_[I'm sorry but I'm now super busy, If you want to be a maintainer of the project please feel me to contact me! You've to be passionate about programming]_
_[Wanna try [LIVE SERVER++](https://github.com/ritwickdey/vscode-live-server-plus-plus) (BETA) ? It'll enable live changes without saving file. https://github.com/ritwickdey/vscode-live-server-plus-plus ]_

# Live Server

Expand Down Expand Up @@ -65,14 +65,24 @@ All settings are now listed here [Settings Docs](./docs/settings.md).

## What's new ?

* ### Version 5.4.0 (30.01.19)
* Bug fix for fsevents on Visual Code Insiders.

* ### Version 5.6.1 (17.04.19)
* Fixed `Extension host terminated unexpectedly` *[[#431](https://github.com/ritwickdey/vscode-live-server/issues/431)]*

* ### Version 5.6.0 (17.04.19)
* ***[NEW]*** Intregation of `Browser Preview` with `Live Server` *[[#352](https://github.com/ritwickdey/vscode-live-server/pull/352) - Thanks to [Kenneth Auchenberg](https://github.com/auchenberg)]*
* ***[NEW]*** Fallback to random port If given port is busy. *[[#330](https://github.com/ritwickdey/vscode-live-server/pull/330) - Thanks to [Ali Almohaya](https://github.com/Almo7aya) ]*
* ***[FIXES]*** Moved to `vscode-chokidar` lib for *[#285](https://github.com/ritwickdey/vscode-live-server/issues/285)*.
* Doc Fixes *[[#388](https://github.com/ritwickdey/vscode-live-server/pull/388) - Thanks to [Ted Silbernagel](https://github.com/tedsilb)]*


* ### Version 5.5.1 (12.02.19)
* ***[Fixes]*** Fixed `Extension host terminated unexpectedly` for MacOS. [[#285](https://github.com/ritwickdey/vscode-live-server/issues/285)]

* ### Version 5.3.1 (28.11.18)
* Event-Stream Package Security Update.
* ### Version 5.5.0 (12.02.19)
* ***[Fixes]*** Fixed `ignoreFiles` settings [[#255](https://github.com/ritwickdey/vscode-live-server/issues/255)]
* Attempt to fix `high cpu load` [[#278](https://github.com/ritwickdey/vscode-live-server/issues/278)]

* ### Version 5.3.0 (27.11.18)
* Few Packages are upgraded.


## Changelog
Expand Down
18 changes: 0 additions & 18 deletions appveyor.yml

This file was deleted.

4 changes: 2 additions & 2 deletions docs/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@

<hr>

* **`liveServer.settings.fullReload:`** : By Default Live Server inject CSS changes without full reloading of browser. You can change this behviour by making this setting as `true`.
* **`liveServer.settings.fullReload:`** : By Default Live Server inject CSS changes without full reloading of browser. You can change this behavior by making this setting as `true`.

* Default: `false`

Expand All @@ -152,7 +152,7 @@
* Example:
```js
{
"liveServer.settings.mount:" [
"liveServer.settings.mount": [
["/", "/path1"],
["/", "/path2"],
["/root", "/dist"]
Expand Down
11 changes: 8 additions & 3 deletions lib/live-server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,15 @@ var fs = require('fs'),
require('colors');


var INJECTED_CODE = fs.readFileSync(path.join(__dirname, "injected.html"), "utf8");


let useBrowserExtension = false;
let GET_INJECTED_CODE = () => {
return useBrowserExtension === true ? '' : INJECTED_CODE;
if (!GET_INJECTED_CODE.cache){
GET_INJECTED_CODE.cache = fs.readFileSync(path.join(__dirname, "injected.html"), "utf8");
}

return useBrowserExtension === true ? '' : GET_INJECTED_CODE.cache;
}

var LiveServer = {
Expand Down Expand Up @@ -115,7 +119,8 @@ function staticServer(root, onTagMissedCallback) {
res.setHeader('Content-Length', len);
var originalPipe = stream.pipe;
stream.pipe = function (resp) {
originalPipe.call(stream, es.replace(new RegExp(injectTag, "i"), GET_INJECTED_CODE() + injectTag)).pipe(resp);
originalPipe.call(stream, es.replace(new RegExp(injectTag, "i"), GET_INJECTED_CODE() + injectTag))
.pipe(resp);
};
}
}
Expand Down
9 changes: 5 additions & 4 deletions lib/live-server/injected.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- Code injected by live-server -->
<script type="text/javascript">
<script>
// <![CDATA[ <-- For SVG support
if ('WebSocket' in window) {
(function () {
Expand All @@ -8,13 +8,14 @@
var head = document.getElementsByTagName("head")[0];
for (var i = 0; i < sheets.length; ++i) {
var elem = sheets[i];
head.removeChild(elem);
var parent = elem.parentElement || head;
parent.removeChild(elem);
var rel = elem.rel;
if (elem.href && typeof rel != "string" || rel.length == 0 || rel.toLowerCase() == "stylesheet") {
var url = elem.href.replace(/(&|\?)_cacheOverride=\d+/, '');
elem.href = url + (url.indexOf('?') >= 0 ? '&' : '?') + '_cacheOverride=' + (new Date().valueOf());
}
head.appendChild(elem);
parent.appendChild(elem);
}
}
var protocol = window.location.protocol === 'http:' ? 'ws://' : 'wss://';
Expand All @@ -34,4 +35,4 @@
console.error('Upgrade your browser. This Browser is NOT supported WebSocket for Live-Reloading.');
}
// ]]>
</script>
</script>
Loading