Skip to content

Commit 04f3361

Browse files
first commit
0 parents  commit 04f3361

24 files changed

+23631
-0
lines changed

.github/workflows/main.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: CI
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.ref }}
7+
cancel-in-progress: true
8+
9+
jobs:
10+
build:
11+
name: Build VSCode-Anura
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Setup pnpm
19+
uses: pnpm/action-setup@v4
20+
with:
21+
version: latest
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: "22"
27+
cache: "npm"
28+
29+
- name: Install dependencies
30+
run: npm install
31+
32+
- name: Build VSCode-Anura
33+
run: npm run build
34+
35+
- name: Package VSCode-Anura
36+
run: npm run package
37+
38+
- name: Upload Artifact (packaged)
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: anura-package
42+
path: vscode.app.zip
43+
44+
upload:
45+
name: Upload release
46+
runs-on: ubuntu-latest
47+
needs: [build]
48+
permissions: write-all
49+
if: github.ref == 'refs/heads/master'
50+
51+
steps:
52+
- name: Delete old release and tag
53+
uses: dev-drprasad/delete-tag-and-release@v1.1
54+
with:
55+
delete_release: true
56+
tag_name: latest
57+
github_token: ${{ github.token }}
58+
59+
- name: Get artifacts
60+
uses: actions/download-artifact@v4
61+
with:
62+
name: anura-package
63+
path: .
64+
65+
- name: Release to GitHub
66+
uses: ncipollo/release-action@v1
67+
with:
68+
name: Continuous Build
69+
tag: latest
70+
commit: master
71+
body: "${{ github.event.head_commit.url }} ${{ github.event.head_commit.message }}"
72+
artifacts: "vscode.app.zip"
73+
prerelease: true

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules/*
2+
*/node_modules/*
3+
vscode.app.zip
4+
myDav/out/main.js
5+
myDav/out/main.js.map

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# VSCode for AnuraSW v2.1
2+
This is a customized version of vscode-web which uses AnuraSW v2.1's WebDav share emulation feature to access the Anura filesystem.
3+
4+
### Customizations
5+
myDav folder contains a slightly updated version of vscode-webdav which uses webdav v5 instead of v4 and does a few things in native fetch. It also doesn't ask for a webdav address, instead it just appends window.location.origin + "/dav/" to whichever anura path is selected in the file picker.
6+
7+
### Packaging
8+
Only thing which needs to be built is the myDav extension. Running ./package.sh should do this for you and output an anura package file as ./vscode.app.zip

index.html

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<!-- Copyright (C) Microsoft Corporation. All rights reserved. -->
2+
<!DOCTYPE html>
3+
<html>
4+
<head>
5+
<meta charset="utf-8" />
6+
<script src="https://js.puter.com/v2/"></script>
7+
<!-- Mobile tweaks -->
8+
<meta name="mobile-web-app-capable" content="yes" />
9+
<meta name="apple-mobile-web-app-capable" content="yes" />
10+
<meta name="apple-mobile-web-app-title" content="Code" />
11+
<link rel="apple-touch-icon" href="./code-192.png" />
12+
13+
<!-- Disable pinch zooming -->
14+
<meta
15+
name="viewport"
16+
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no"
17+
/>
18+
19+
<!-- Workbench Icon/Manifest/CSS -->
20+
<link rel="icon" href="./favicon.ico" type="image/x-icon" />
21+
<link rel="manifest" href="/manifest.json" />
22+
<link
23+
data-name="vs/workbench/workbench.web.main"
24+
rel="stylesheet"
25+
href="./node_modules/vscode-web/dist/out/vs/workbench/workbench.web.main.css"
26+
/>
27+
</head>
28+
29+
<body aria-label=""></body>
30+
<script src="./puterjs-layer.js" type="module"></script>
31+
<script type="module">
32+
// const productData = `{
33+
// "productConfiguration": {
34+
// "nameShort": "VSCode",
35+
// "nameLong": "Visual Studio Code",
36+
// "applicationName": "code-web-sample",
37+
// "dataFolderName": ".vscode-web-sample",
38+
// "version": "1.91.1",
39+
// "extensionsGallery": {
40+
// "serviceUrl": "https://open-vsx.org/vscode/gallery",
41+
// "itemUrl": "https://open-vsx.org/vscode/item",
42+
// "resourceUrlTemplate": "https://openvsxorg.blob.core.windows.net/resources/{publisher}/{name}/{version}/{path}"
43+
// },
44+
// "extensionEnabledApiProposals": {
45+
// "vscode.vscode-web-playground": [
46+
// "fileSearchProvider",
47+
// "textSearchProvider"
48+
// ]
49+
// }
50+
// },
51+
52+
// "additionalBuiltinExtensions": [
53+
// {
54+
// "scheme": "${location.protocol.slice(0,-1)}",
55+
// "path": "${location.pathname.split("/").slice(0,-1).join("/")}/myExt"
56+
// },
57+
// {
58+
// "scheme": "${location.protocol.slice(0,-1)}",
59+
// "path": "${location.pathname.split("/").slice(0,-1).join("/")}/myDav"
60+
// }
61+
// ]
62+
// }
63+
// `
64+
// try {
65+
// const fileData = await top.anura.fs.promises.readFile("/" + location.pathname.split("/").slice(2,-1).join("/") + "/product.json", productData);
66+
// if (new TextDecoder().decode(fileData) !== productData) {
67+
// throw new Error("Product data outdated")
68+
// }
69+
// } catch {
70+
// await top.anura.fs.promises.writeFile("/" + location.pathname.split("/").slice(2,-1).join("/") + "/product.json", productData)
71+
// location.reload();
72+
// }
73+
</script>
74+
<!-- Startup (do not modify order of script tags!) -->
75+
<script src="./node_modules/vscode-web/dist/out/vs/loader.js"></script>
76+
<script src="./node_modules/vscode-web/dist/out/vs/webPackagePaths.js"></script>
77+
<script>
78+
Object.keys(self.webPackagePaths).map(function (key, index) {
79+
self.webPackagePaths[
80+
key
81+
] = `${location.href.split("/").slice(0,location.href.split("/").length - 1).join("/")}/node_modules/vscode-web/dist/node_modules/${key}/${self.webPackagePaths[key]}`;
82+
});
83+
require.config({
84+
baseUrl: `${location.href.split("/").slice(0,location.href.split("/").length - 1).join("/")}/node_modules/vscode-web/dist/out`,
85+
recordStats: true,
86+
trustedTypesPolicy: window.trustedTypes?.createPolicy('amdLoader', {
87+
createScriptURL(value) {
88+
return value;
89+
},
90+
}),
91+
paths: self.webPackagePaths,
92+
});
93+
</script>
94+
<script src="./node_modules/vscode-web/dist/out/vs/workbench/workbench.web.main.nls.js"></script>
95+
<script src="./node_modules/vscode-web/dist/out/vs/workbench/workbench.web.main.js"></script>
96+
<script src="./node_modules/vscode-web/dist/out/vs/code/browser/workbench/workbench.js"></script>
97+
</html>

manifest.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "Visual Studio Code",
3+
"type": "auto",
4+
"package": "anura.vscode",
5+
"index": "index.html",
6+
"icon": "node_modules/vscode-web/dist/code-192.png",
7+
"wininfo": {
8+
"title": "VSCode - Anura",
9+
"width": "800px",
10+
"height": "600px"
11+
}
12+
}
13+

myDav/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Change Log (vscode-webdav)
2+
3+
## 1.0.0 (Jan 2023)
4+
5+
* First version of the WebDAV FileSystemProvider
6+
* Support for three different authenttication schemes - Basic, Digest and Windows SSPI (Kerberos)
7+
* Secrets are stored securely in the VS Code SecretStorage

myDav/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Miro Paskov
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

myDav/README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
[![GitHub](https://img.shields.io/github/license/kowd/vscode-webdav?style=flat-square)](https://github.com/kowd/vscode-webdav/blob/main/LICENSE)
2+
[![Visual Studio Marketplace Version](https://img.shields.io/visual-studio-marketplace/v/kowd.vscode-webdav?style=flat-square)](https://marketplace.visualstudio.com/items?itemName=kowd.vscode-webdav)
3+
[![Visual Studio Marketplace Installs](https://img.shields.io/visual-studio-marketplace/i/kowd.vscode-webdav?style=flat-square)](https://marketplace.visualstudio.com/items?itemName=kowd.vscode-webdav)
4+
[![Coverage](https://img.shields.io/coverallsCoverage/github/kowd/vscode-webdav?style=flat-square)](https://coveralls.io/github/kowd/vscode-webdav)
5+
6+
# WebDAV Workspaces for Visual Studio Code
7+
8+
The `vscode-webdav` Visual Studio Code extension allows adding WebDAV endpoints as remote workspaces.
9+
10+
## How to use
11+
12+
Install the extension in VS Code.
13+
14+
### Adding a new WebDAV Workspace
15+
16+
There are three ways to open a WebDAV Workspace
17+
18+
* When no folder is open in VS Code, activate the explorer and click on the "Open WebDAV"
19+
20+
* Run the "Open WebDAV Workspace..." command and follow the prompts to enter an address, name and choose authentication.
21+
22+
* Open a `.code-workspace` file which contains a uri with a `webdav` or `webdavs` scheme (corresponding to `http` and `https` WebDAV endpoints respectively).
23+
```js
24+
{
25+
"folders": [{
26+
"name": "live.sysinternals.com",
27+
"uri": "webdavs://live.sysinternals.com"
28+
}]
29+
}
30+
```
31+
32+
### Authentication Support
33+
34+
The authentication schemes supported by the extension are:
35+
* `None` - no authentication.
36+
* `Basic` - for Basic authentication consider using TLS too. The password for the account is stored securely in the VS Code SecretStorage.
37+
* `Digest` - The password for the account is stored securely in the VS Code SecretStorage. This means that the OS-specific credential storage will be used.
38+
* `Windows (SSPI)` - This authentication uses the [Windows Security Support Provider Interface](https://learn.microsoft.com/en-us/windows/win32/rpc/security-support-provider-interface-sspi-). In practice this means that the authentication is Kerberos (via [SPNEGO](https://en.wikipedia.org/wiki/SPNEGO)). This should work the same way as in browsers like Edge or Chrome. It is only available on Windows.
39+
40+
### Changing Passwords or Authentication
41+
42+
If `Basic` or `Digest` authentication is used, you may need to update the password or the account.
43+
44+
If at any time authentication fails with a "Forbidden" error a notification pops up suggesting the authentication settings should be reset.
45+
46+
Additionally you can reset the authentication at any time by using the `Reset WebDAV Authentication ...` command.
47+
48+
### Operating System Support
49+
50+
The `Windows (SSPI)` authentication scheme is only supported on Windows.
51+
52+
## Contributions
53+
54+
Contributions are welcome.

myDav/icon.png

10 KB
Loading

myDav/jest.config.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/** @type {import('ts-jest').JestConfigWithTsJest} */
2+
module.exports = {
3+
clearMocks: true,
4+
collectCoverage: true,
5+
// An array of glob patterns indicating a set of files for which coverage information should be collected
6+
// collectCoverageFrom: undefined,
7+
8+
coverageDirectory: "coverage",
9+
coveragePathIgnorePatterns: [
10+
"\\\\node_modules\\\\",
11+
"\\\\out\\\\",
12+
],
13+
coverageProvider: "v8",
14+
coverageReporters: [
15+
"lcov",
16+
],
17+
preset: 'ts-jest',
18+
testEnvironment: 'node',
19+
maxWorkers: 1,
20+
moduleDirectories: ["node_modules"],
21+
};

0 commit comments

Comments
 (0)