Skip to content

Commit

Permalink
feat: publish JS dependencies to appserver/package/static/js/dependen…
Browse files Browse the repository at this point in the history
…cies.txt (#103)

* feat: publish JS dependencies to appserver/package/static/js/dependencies.txt

More info: #422

* chore: fix typo
  • Loading branch information
artemrys authored Jul 8, 2022
1 parent 66f7593 commit 3236b1b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
22 changes: 22 additions & 0 deletions ui/.github/scripts/format_yarn_deps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import argparse
import sys


def main():
parser = argparse.ArgumentParser()
parser.add_argument("--output-file", type=str, required=True)
args = parser.parse_args()
result = []
if not sys.stdin.isatty():
yarn_deps = sys.stdin.readlines()
yarn_deps = yarn_deps[1:-1]
for yarn_dep in yarn_deps:
formatted_yarn_dep = yarn_dep.replace("├─ ", "").replace("└─ ", "")
result.append(formatted_yarn_dep)
with open(args.output_file, "w") as f:
for line in result:
f.writelines(line)


if __name__ == "__main__":
main()
6 changes: 6 additions & 0 deletions ui/.github/workflows/build-test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- uses: actions/setup-python@v4
with:
python-version: "3.7"

- run: npm install --global yarn

- name: Get yarn cache directory path
Expand All @@ -103,6 +107,8 @@ jobs:

- run: yarn run setup
- run: yarn run build
- run: |
yarn list --prod --depth 0 | python .github/scripts/format_yarn_deps.py --output-file=dist/package/appserver/static/js/dependencies.txt
- run: tar -czvf /tmp/splunk-ucc-ui.tgz -C dist .
- uses: actions/upload-artifact@v3
Expand Down

0 comments on commit 3236b1b

Please sign in to comment.