You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "shanedell (via GitHub)" <gi...@apache.org> on 2023/07/19 13:23:21 UTC

[GitHub] [daffodil-vscode] shanedell opened a new pull request, #708: Multiple updates

shanedell opened a new pull request, #708:
URL: https://github.com/apache/daffodil-vscode/pull/708

   Multiple updates:
   
   - Use webpack for doing most packaging tasks instead of using a manual TS script for everything.
   - Update webpack to automatically extract out the debugger package to ./daffodil-debugger-${daffodilVersion}-${extVersion}.
     - This allowed for the code to unzip the debugger in the extension to be removed.
     - This also allows for easier running of the debugger.
     - No longer extract the package out to somewhere else on the user system.
       - The extracted debugger folder with the bin and lib dirs are bundled with the extension source.
   - Update scalawatch to build scala code then generate the version.ts, this will ensure the updated debugger package gets unzipped.
   - Move location of webpack files as now there are two.
     - webpack/ext-dev.webpack.config.js - used when running locally.
     - webpack/ext-package.webpack.config.js - used when creating a package.
   - Remove build/scripts directory.
   - Move build/scripts/yarn-scripts.ts to build/yarn-scripts.ts
   - Remove .vscodeignore, gets automatically created during the packaging to ignore node_modules.
   
   Closes #692


-- 
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: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] shanedell commented on a diff in pull request #708: Multiple updates

Posted by "shanedell (via GitHub)" <gi...@apache.org>.
shanedell commented on code in PR #708:
URL: https://github.com/apache/daffodil-vscode/pull/708#discussion_r1270655129


##########
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:
   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?



-- 
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: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] scholarsmate commented on a diff in pull request #708: Multiple updates

Posted by "scholarsmate (via GitHub)" <gi...@apache.org>.
scholarsmate commented on code in PR #708:
URL: https://github.com/apache/daffodil-vscode/pull/708#discussion_r1270661472


##########
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:
   Just saying that fix the `package` `yarn` script to have **it** call the other `yarn` `commands` instead of calling the `yarn` commands inside of the `yarn-scripts.ts` file



-- 
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: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] scholarsmate commented on a diff in pull request #708: Multiple updates

Posted by "scholarsmate (via GitHub)" <gi...@apache.org>.
scholarsmate commented on code in PR #708:
URL: https://github.com/apache/daffodil-vscode/pull/708#discussion_r1270652467


##########
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:
   Put the `yarn` calls at the end of that `package` function here in this line instead of calling back to `yarn` and creating a cycle.



-- 
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: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] scholarsmate commented on a diff in pull request #708: Multiple updates

Posted by "scholarsmate (via GitHub)" <gi...@apache.org>.
scholarsmate commented on code in PR #708:
URL: https://github.com/apache/daffodil-vscode/pull/708#discussion_r1270662938


##########
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:
   I think we can then get rid of the `execSync` dependency once this change is done too.



-- 
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: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] scholarsmate commented on a diff in pull request #708: Multiple updates

Posted by "scholarsmate (via GitHub)" <gi...@apache.org>.
scholarsmate commented on code in PR #708:
URL: https://github.com/apache/daffodil-vscode/pull/708#discussion_r1270649637


##########
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:
   `yarn` running `yarn-scripts` that then run `yarn` is headache inducing.  I'm not a big fan of this, even if it means we have a longer `yarn scripts` `package` command.  Having `yarn` call these functions that then in turn call `yarn` again doesn't feel right to me.  I'd prefer that we don't do this and instead have a more complex `package` command.  It would be easier to track what's going on there.



-- 
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: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] shanedell commented on a diff in pull request #708: Multiple updates

Posted by "shanedell (via GitHub)" <gi...@apache.org>.
shanedell commented on code in PR #708:
URL: https://github.com/apache/daffodil-vscode/pull/708#discussion_r1270655129


##########
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:
   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: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] shanedell merged pull request #708: Multiple updates

Posted by "shanedell (via GitHub)" <gi...@apache.org>.
shanedell merged PR #708:
URL: https://github.com/apache/daffodil-vscode/pull/708


-- 
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: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] arosien commented on a diff in pull request #708: Multiple updates

Posted by "arosien (via GitHub)" <gi...@apache.org>.
arosien commented on code in PR #708:
URL: https://github.com/apache/daffodil-vscode/pull/708#discussion_r1269858188


##########
src/classes/artifact.ts:
##########
@@ -36,14 +37,7 @@ export class Artifact {
       ? `${type}-${this.version}-${LIB_VERSION}`
       : `${type}-${this.version}`
     this.archive = `${this.name}.zip`
+    this.folder = `${this.name}`
     this.scriptName = osCheck(`${baseScriptName}.bat`, `./${baseScriptName}`)
   }
-

Review Comment:
   FYI I filed https://github.com/apache/daffodil-vscode/issues/711 which is related to these lines.



-- 
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: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] shanedell commented on a diff in pull request #708: Multiple updates

Posted by "shanedell (via GitHub)" <gi...@apache.org>.
shanedell commented on code in PR #708:
URL: https://github.com/apache/daffodil-vscode/pull/708#discussion_r1269862044


##########
src/classes/artifact.ts:
##########
@@ -36,14 +37,7 @@ export class Artifact {
       ? `${type}-${this.version}-${LIB_VERSION}`
       : `${type}-${this.version}`
     this.archive = `${this.name}.zip`
+    this.folder = `${this.name}`
     this.scriptName = osCheck(`${baseScriptName}.bat`, `./${baseScriptName}`)
   }
-

Review Comment:
   @arosien Just pushed an update to also delete the `Backend` class and linked to close issue #711 



-- 
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: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] scholarsmate commented on a diff in pull request #708: Multiple updates

Posted by "scholarsmate (via GitHub)" <gi...@apache.org>.
scholarsmate commented on code in PR #708:
URL: https://github.com/apache/daffodil-vscode/pull/708#discussion_r1270661472


##########
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:
   Just saying that we fix the `package` `yarn` script to have **it** call the other `yarn` `commands` instead of calling the `yarn` commands inside of the `yarn-scripts.ts` file



-- 
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: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] shanedell commented on a diff in pull request #708: Multiple updates

Posted by "shanedell (via GitHub)" <gi...@apache.org>.
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:
   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. @mbeckerle @arosien @stevedlawrence @nlewis05 @michael-hoke @stricklandrbls @rthomas320 what do you guys think?



-- 
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: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] shanedell commented on a diff in pull request #708: Multiple updates

Posted by "shanedell (via GitHub)" <gi...@apache.org>.
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: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] shanedell commented on a diff in pull request #708: Multiple updates

Posted by "shanedell (via GitHub)" <gi...@apache.org>.
shanedell commented on code in PR #708:
URL: https://github.com/apache/daffodil-vscode/pull/708#discussion_r1270662001


##########
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:
   That makes sense but I also think having it all together makes easier to follow what is going on. If split up between running some stuff in the file and other in the scripts section it might get confusing.



-- 
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: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] scholarsmate commented on a diff in pull request #708: Multiple updates

Posted by "scholarsmate (via GitHub)" <gi...@apache.org>.
scholarsmate commented on code in PR #708:
URL: https://github.com/apache/daffodil-vscode/pull/708#discussion_r1270659065


##########
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:
   I'm not suggesting we toss the whole thing out, just avoid calling `yarn` in this supplemental scripts file.



-- 
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: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org