shanedell commented on code in PR #708:
URL: https://github.com/apache/daffodil-vscode/pull/708#discussion_r1270653896
##########
build/yarn-scripts.ts:
##########
@@ -67,19 +83,51 @@ function scalaclean() {
function watch() {
concurrently(
[
- "yarn scalawatch",
- "webpack --watch --devtool nosources-source-map --config
./build/extension.webpack.config.js",
- "yarn watch:svelte"
+ 'yarn scalawatch',
+ 'webpack --watch --devtool nosources-source-map --config
./webpack/ext-dev.webpack.config.js',
+ 'yarn watch:svelte',
],
{
killOthers: ['failure', 'success'],
}
)
}
+function package() {
+ const pkg_dir = 'dist/package'
+
+ // create .vscodeignore to not package all node_modules into the vsix
+ fs.writeFileSync(
+ path.join(pkg_dir, '.vscodeignore'),
+ `# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+**/node_modules/**/*
+!node_modules/@omega-edit/server/bin
+!node_modules/@omega-edit/server/lib
+`
+ )
+
+ execSync('yarn install', { cwd: pkg_dir })
+ execSync('yarn vsce package --out ../../', { cwd: pkg_dir })
Review Comment:
@scholarsmate I mean this would depend on what others think, if others agree
we should revert it back we can as this was approved before this PR. This would
need to be a separate issue to resolve and would not be a part from this PR. Or
are you talking about just the package one since it does nothing other than run
`yarn` commands?
##########
package.json:
##########
@@ -24,23 +24,22 @@
},
"scripts": {
"postinstall": "cd src/svelte && yarn install",
- "gen-version-ts": "run-func build/scripts/yarn-scripts.ts genVersionTS",
- "nodeclean": "run-func build/scripts/yarn-scripts.ts nodeclean",
- "scalaclean": "run-func build/scripts/yarn-scripts.ts scalaclean",
+ "gen-version-ts": "run-func build/yarn-scripts.ts genVersionTS",
+ "nodeclean": "run-func build/yarn-scripts.ts nodeclean",
+ "scalaclean": "run-func build/yarn-scripts.ts scalaclean",
"clean": "yarn nodeclean && yarn scalaclean",
"precompile": "yarn nodeclean && yarn gen-version-ts && cd src/svelte &&
yarn build",
"compile": "tsc -p ./ && yarn sbt",
"lint": "yarn prettier src -c && cd src/svelte && yarn lint",
"lint:fix": "yarn prettier src -w && cd src/svelte && yarn lint:fix",
"scalawatch": "nodemon --config debugger/nodemon.json",
- "prewatch": "yarn gen-version-ts",
- "watch": "run-func build/scripts/yarn-scripts.ts watch",
+ "prewatch": "yarn gen-version-ts && yarn sbt",
+ "watch": "run-func build/yarn-scripts.ts watch",
"watch:svelte": "cd src/svelte && yarn dev",
- "webpack": "webpack --mode production --config
./build/extension.webpack.config.js",
- "prepackage": "yarn install && yarn compile && yarn webpack",
- "package": "yarn package-setup && yarn package-create",
- "package-setup": "run-func build/scripts/package.ts setup",
- "package-create": "run-func build/scripts/package.ts create",
+ "webpack": "webpack --mode production --config
./webpack/ext-dev.webpack.config.js",
+ "webpack:pkg": "webpack --mode production --config
./webpack/ext-package.webpack.config.js",
+ "prepackage": "yarn install && yarn compile && yarn webpack:pkg",
+ "package": "run-func build/yarn-scripts.ts package",
Review Comment:
@scholarsmate As mentioned
https://github.com/apache/daffodil-vscode/pull/708#discussion_r1270653896 this
may need to be discussed before changing it. Or are you only saying to change
this for the package yarn commands and all the others are fine? If its just
that one that should be fine but completely removing `yarn-scripts.ts` is
another thing.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]