Add script for packaging.
This commit is contained in:
parent
d9c86edd4e
commit
dfb63ce3f5
|
@ -13,5 +13,6 @@ steps:
|
|||
- name: build
|
||||
image: node:14.15.4
|
||||
commands:
|
||||
- npm -g install vsce
|
||||
- npm ci
|
||||
- npm run vscode:prepublish
|
||||
- npm run package
|
||||
|
|
|
@ -8,11 +8,14 @@
|
|||
|
||||
**/*.map
|
||||
**/*.ts
|
||||
**/tsconfig.json
|
||||
**/*.vsce-pre-package-backup
|
||||
.drone.yml
|
||||
.gitignore
|
||||
.gitattributes
|
||||
.travis.yml
|
||||
.vscode/**
|
||||
src/**
|
||||
scripts/**
|
||||
.vscode/
|
||||
LICENSE_NOTICE.md
|
||||
node_modules/
|
||||
src/
|
||||
scripts/
|
||||
tsconfig.json
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
},
|
||||
"scripts": {
|
||||
"vscode:prepublish": "webpack --mode production",
|
||||
"package": "sh ./scripts/package.sh",
|
||||
"build": "webpack --mode development",
|
||||
"prepare": "sh ./scripts/prepare.sh",
|
||||
"lint": "eslint --ext ts --fix src",
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/env sh
|
||||
#
|
||||
# Copyright (C) 2021 CismonX <admin@cismon.net>
|
||||
#
|
||||
# Copying and distribution of this file, with or without modification, are
|
||||
# permitted in any medium without royalty, provided the copyright notice and
|
||||
# this notice are preserved. This file is offered as-is, without any warranty.
|
||||
#
|
||||
|
||||
BACKUP_SUFFIX=vsce-pre-package-backup
|
||||
JSON_FILES=(package.json language-configuration.json)
|
||||
for file in ${JSON_FILES[@]}; do
|
||||
mv $file $file.$BACKUP_SUFFIX
|
||||
json -j0 -f $file.$BACKUP_SUFFIX > $file
|
||||
done
|
||||
json -j0 -I -e 'delete this.eslintConfig; delete this.devDependencies;' -f package.json
|
||||
vsce package --baseContentUrl=`json -f package.json repository.url`
|
||||
for file in ${JSON_FILES[@]}; do
|
||||
mv $file.$BACKUP_SUFFIX $file
|
||||
done
|
Loading…
Reference in New Issue