Skip to content

Commit fbf9a11

Browse files
committed
Add README, CHANGELOG
1 parent 0ac4e3b commit fbf9a11

File tree

6 files changed

+55
-228
lines changed

6 files changed

+55
-228
lines changed

.github/workflows/nightly-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Nightly Publish
22

33
on:
44
push:
5-
branches: [main]
5+
branches: [main, cte/nightly-ci]
66
workflow_dispatch: # Allows manual triggering.
77

88
env:

apps/vscode-nightly/esbuild.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ async function main() {
5252
setup(build) {
5353
build.onEnd(() => {
5454
const paths = [
55-
["LICENSE", "LICENSE"],
55+
["../README.md", "README.md"],
56+
["../CHANGELOG.md", "CHANGELOG.md"],
57+
["../LICENSE", "LICENSE"],
5658
[".vscodeignore", ".vscodeignore"],
5759
["assets", "assets"],
5860
["integrations", "integrations"],

src/.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
README.md
2+
CHANGELOG.md
3+
LICENSE
14
webview-ui
2-
35
assets/vscode-material-icons

src/.vscodeignore

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Exclude everything
22
**
33

4+
# Include README.md, CHANGELOG.md and LICENSE
5+
!README.md
6+
!CHANGELOG.md
7+
!LICENSE
8+
49
# Include package.json
510
!package.json
611
!package.nls.*
@@ -15,9 +20,6 @@
1520
!webview-ui/build/assets/*.ttf
1621
!webview-ui/build/assets/*.css
1722

18-
# Include the license file
19-
!LICENSE
20-
2123
# Include default themes JSON files used in getTheme
2224
!integrations/theme/default-themes/**
2325

src/LICENSE

Lines changed: 0 additions & 201 deletions
This file was deleted.

src/esbuild.js

Lines changed: 43 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,38 @@ const path = require("path")
55
const production = process.argv.includes("--production")
66
const watch = process.argv.includes("--watch")
77

8+
/**
9+
* @param {[string, string][]} copyPaths
10+
* @param {string} srcDir
11+
* @param {string} dstDir
12+
* @returns {void}
13+
*/
14+
function copyPaths(copyPaths, srcDir, dstDir) {
15+
copyPaths.forEach(([srcRelPath, dstRelPath]) => {
16+
const stats = fs.lstatSync(path.join(srcDir, srcRelPath))
17+
18+
if (stats.isDirectory()) {
19+
if (fs.existsSync(path.join(dstDir, dstRelPath))) {
20+
fs.rmSync(path.join(dstDir, dstRelPath), { recursive: true })
21+
}
22+
23+
fs.mkdirSync(path.join(dstDir, dstRelPath), { recursive: true })
24+
25+
const count = copyDir(path.join(srcDir, srcRelPath), path.join(dstDir, dstRelPath), 0)
26+
console.log(`[copyPaths] Copied ${count} files from ${srcRelPath} to ${dstRelPath}`)
27+
} else {
28+
fs.copyFileSync(path.join(srcDir, srcRelPath), path.join(dstDir, dstRelPath))
29+
console.log(`[copyPaths] Copied ${srcRelPath} to ${dstRelPath}`)
30+
}
31+
})
32+
}
33+
34+
/**
35+
* @param {string} srcDir
36+
* @param {string} dstDir
37+
* @param {number} count
38+
* @returns {number}
39+
*/
840
function copyDir(srcDir, dstDir, count) {
941
const entries = fs.readdirSync(srcDir, { withFileTypes: true })
1042

@@ -172,27 +204,17 @@ const copyAssets = {
172204
name: "copy-assets",
173205
setup(build) {
174206
build.onEnd(() => {
175-
const copyPaths = [
176-
["node_modules/vscode-material-icons/generated", "assets/vscode-material-icons"],
177-
["../webview-ui/audio", "webview-ui/audio"],
178-
]
179-
180-
for (const [srcRelPath, dstRelPath] of copyPaths) {
181-
const srcDir = path.join(__dirname, srcRelPath)
182-
const dstDir = path.join(__dirname, dstRelPath)
183-
184-
if (!fs.existsSync(srcDir)) {
185-
throw new Error(`Directory does not exist: ${srcDir}`)
186-
}
187-
188-
if (fs.existsSync(dstDir)) {
189-
fs.rmSync(dstDir, { recursive: true })
190-
}
191-
192-
fs.mkdirSync(dstDir, { recursive: true })
193-
const count = copyDir(srcDir, dstDir, 0)
194-
console.log(`[copy-assets] Copied ${count} assets from ${srcDir} to ${dstDir}`)
195-
}
207+
copyPaths(
208+
[
209+
["../README.md", "README.md"],
210+
["../CHANGELOG.md", "CHANGELOG.md"],
211+
["../LICENSE", "LICENSE"],
212+
["node_modules/vscode-material-icons/generated", "assets/vscode-material-icons"],
213+
["../webview-ui/audio", "webview-ui/audio"],
214+
],
215+
__dirname,
216+
__dirname,
217+
)
196218
})
197219
},
198220
}

0 commit comments

Comments
 (0)