Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Optimize build#551

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ShMcK merged 5 commits intomasterfromoptimize-build
Nov 28, 2021
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
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
3 changes: 3 additions & 0 deletions.eslintignore
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
build
dist
node_modules
2 changes: 1 addition & 1 deletion.gitignore
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,8 +9,8 @@ package-lock.json
.npmrc

# output directory
out
build
dist
web-app/build/
web-app/node_modules

Expand Down
3 changes: 3 additions & 0 deletions.vscode/settings.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,7 +16,10 @@
"browserslist",
"codeally",
"coderoad",
"esbuild",
"flowtype",
"fsevents",
"outfile",
"packagejson",
"prismjs",
"Traceback",
Expand Down
10 changes: 6 additions & 4 deletions.vscodeignore
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,12 +2,14 @@
.gitignore

## VSCode
.vscode/**
.vscode-test/**
.vscode
.vscode-test
vsc-extension-quickstart.md

## CI/CD
.circleci
## Modules
node_modules/**
!node_modules/fsevents/**
!node_modules/jsdom/**

## TypeScript
**/tsconfig.json
Expand Down
8 changes: 6 additions & 2 deletionspackage.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
{
"name":"coderoad",
"version":"0.17.0",
"version":"0.17.1",
"description":"Play interactive coding tutorials in your editor",
"keywords": [
"tutorial",
Expand DownExpand Up@@ -31,7 +31,10 @@
"package":"./scripts/package.sh",
"storybook":"yarn --cwd web-app storybook",
"test":"jest",
"watch":"tsc -watch -p ./"
"esbuild-base":"esbuild ./src/extension.ts --bundle --outfile=build/extension.js --external:vscode --external:fsevents --external:jsdom --format=cjs --platform=node",
"esbuild":"npm run esbuild-base -- --sourcemap",
"esbuild-watch":"npm run esbuild-base -- --sourcemap --watch",
"test-compile":"tsc -watch -p ./"
},
"dependencies": {
"chokidar":"3.5.2",
Expand All@@ -56,6 +59,7 @@
"@types/semver":"^7.3.9",
"@typescript-eslint/eslint-plugin":"5.4.0",
"@typescript-eslint/parser":"5.4.0",
"esbuild":"0.14.0",
"eslint-config-prettier":"8.3.0",
"eslint-config-react-app":"6.0.0",
"eslint-plugin-flowtype":"8.0.3",
Expand Down
10 changes: 6 additions & 4 deletionsscripts/build.sh
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,20 +8,22 @@ echo "Cleaning up previous build..."
rm -rf build

# build extension
echo"Compiling..."
tsc -p ./
echo"Bundling src..."
npm run esbuild

# build web app
echo"Building webapp..."
cd web-app
yarn build
cd ..

# For Windows build: switch the next 2 lines
echo"Bundling webapp..."
if [["$OSTYPE"=="msys" ]];then
echo"linux subsystem on windows selected"
#linux subsystem on windows selected
cp -R ./web-app/build/ ./
else
echo"Unix system selected"
# unix
cp -R ./web-app/build/. ./build/
fi

Expand Down
3 changes: 2 additions & 1 deletionscripts/package.sh
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,8 +12,9 @@ OUTPUT_FILE=coderoad-$PACKAGE_VERSION.vsix
echo"Creating$OUTPUT_FILE..."

echo"Building..."
GENERATE_SOURCEMAP=false# reduces output size by 5mb+
exportGENERATE_SOURCEMAP=false# reduces output size by 5mb+
yarn build
npm run esbuild-base -- --minify

echo"Packaging Extension..."
mkdir -p ./$RELEASES_FOLDER
Expand Down
2 changes: 1 addition & 1 deletionsrc/services/node/index.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,7 @@ import { WORKSPACE_ROOT } from '../../environment'

constasyncExec=promisify(cpExec)
constasyncRemoveFile=promisify(fs.unlink)
constasyncReadFile=promisify(fs.readFile)
exportconstasyncReadFile=promisify(fs.readFile)
constasyncWriteFile=promisify(fs.writeFile)

interfaceExecParams{
Expand Down
14 changes: 13 additions & 1 deletionsrc/services/webview/render.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
import{JSDOM}from'jsdom'
import*aspathfrom'path'
import*asvscodefrom'vscode'
import{asyncReadFile}from'../node'
import{onError}from'../telemetry'
import{CONTENT_SECURITY_POLICY_EXEMPTIONS}from'../../environment'

Expand DownExpand Up@@ -64,7 +65,18 @@ async function render(panel: vscode.WebviewPanel, rootPath: string): Promise<voi
construnTimeScript=document.createElement('script')
runTimeScript.nonce=getNonce()
nonces.push(runTimeScript.nonce)
constmanifest=awaitimport(path.join(rootPath,'asset-manifest.json'))

// note: file cannot be imported or results in esbuild error. Easier to read it.
letmanifest
try{
constmanifestPath=path.join(rootPath,'asset-manifest.json')
console.log(manifestPath)
constmanifestFile=awaitasyncReadFile(manifestPath,'utf8')
manifest=JSON.parse(manifestFile)
}catch(e){
thrownewError('Failed to read manifest file')
}

runTimeScript.src=createUri(manifest.files['runtime-main.js'])
document.body.appendChild(runTimeScript)

Expand Down
12 changes: 11 additions & 1 deletiontsconfig.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,5 +26,15 @@
"allowJs":true,
"removeComments":true
},
"exclude": ["docs","node_modules",".vscode-test","build","resources","web-app","*.js","*.test.ts","scripts"]
"exclude": [
"docs",
"node_modules",
".vscode-test",
"build",
"resources",
"web-app",
"*.js",
"*.test.ts",
"scripts"
]
}
2 changes: 1 addition & 1 deletionweb-app/.env.example
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
SKIP_PREFLIGHT_CHECK=true
VERSION=0.17.0
VERSION=0.17.1
NODE_ENV=local
REACT_APP_DEBUG=false
REACT_APP_LOG=false
Expand Down
2 changes: 1 addition & 1 deletionweb-app/package.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
{
"name":"coderoad-app",
"version":"0.17.0",
"version":"0.17.1",
"private":true,
"scripts": {
"analyze":"source-map-explorer 'build/static/js/*.js'",
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp