Skip to content

Commit aab7d7a

Browse files
authored
Fix/rename mountable (#1243)
* Move mountable to browser simply * Update Makefile * Update CI workflows * Fix files in the browser package * Update DEVELOPMENT.md * Update browser/README.md
1 parent b92f9a3 commit aab7d7a

25 files changed

+60
-60
lines changed

β€Ž.github/workflows/gh-pages.yml

+14-14
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ concurrency:
1212
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
1313

1414
env:
15-
GITHUB_PAGES_SUBDIR_MOUNTABLE: lib/mountable
15+
GITHUB_PAGES_SUBDIR_BROWSER: lib/browser
1616

1717
jobs:
1818
build:
1919
strategy:
2020
matrix:
21-
target: ["mountable"]
21+
target: ["browser"]
2222

2323
env:
2424
# To avoid an error like "FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory".
@@ -72,23 +72,23 @@ jobs:
7272
- name: Set up
7373
run: make init
7474

75-
## Build and deploy @stlite/mountable
75+
## Build and deploy @stlite/browser
7676
# PUBLIC_URL here is set as a relative path, which is possible to the trick introduced at https://github.com/whitphx/stlite/pull/143.
77-
- if: matrix.target == 'mountable'
77+
- if: matrix.target == 'browser'
7878
name: Set PUBLIC_URL
7979
run: echo "PUBLIC_URL=." >> $GITHUB_ENV
80-
- if: matrix.target == 'mountable'
81-
name: Build @stlite/mountable
80+
- if: matrix.target == 'browser'
81+
name: Build @stlite/browser
8282
run: |
8383
. .venv/bin/activate
84-
make mountable
84+
make browser
8585
86-
- if: matrix.target == 'mountable'
86+
- if: matrix.target == 'browser'
8787
name: Upload the built files as an artifact
8888
uses: actions/upload-artifact@v4
8989
with:
90-
name: stlite-mountable
91-
path: packages/mountable/build
90+
name: stlite-browser
91+
path: packages/browser/build
9292

9393
deploy:
9494
needs: build
@@ -102,8 +102,8 @@ jobs:
102102
steps:
103103
- uses: actions/download-artifact@v4
104104
with:
105-
name: stlite-mountable
106-
path: mountable
105+
name: stlite-browser
106+
path: browser
107107

108108
- name: Configure redirect
109109
run: |
@@ -124,8 +124,8 @@ jobs:
124124
125125
- name: Set the build artifact paths
126126
run: |
127-
mkdir -p /tmp/website/${GITHUB_PAGES_SUBDIR_MOUNTABLE}
128-
cp -r ./mountable/* /tmp/website/${GITHUB_PAGES_SUBDIR_MOUNTABLE}/.
127+
mkdir -p /tmp/website/${GITHUB_PAGES_SUBDIR_BROWSER}
128+
cp -r ./browser/* /tmp/website/${GITHUB_PAGES_SUBDIR_BROWSER}/.
129129
130130
- name: Upload the website files as an artifact
131131
uses: actions/upload-artifact@v4

β€Ž.github/workflows/main.yml

+29-29
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
kernel: ${{ steps.filter.outputs.kernel == 'true' || steps.filter.outputs.gha == 'true' || env.RUN_ALL_TESTS == 'true' }}
3131
# stlite-lib: ${{ steps.filter.outputs.stlite-lib == 'true' || steps.filter.outputs.gha == 'true' || env.RUN_ALL_TESTS == 'true' }}
3232
stlite-lib: true # This step does not detect changes in the `streamlit` submodule that is needed to trigger the test-stlite-lib job (https://github.com/dorny/paths-filter/issues/143), so skip checking and make it always return true as a workaround.
33-
mountable: ${{ steps.filter.outputs.mountable == 'true' || steps.filter.outputs.gha == 'true' || env.RUN_ALL_TESTS == 'true' }}
33+
browser: ${{ steps.filter.outputs.browser == 'true' || steps.filter.outputs.gha == 'true' || env.RUN_ALL_TESTS == 'true' }}
3434
sharing-editor: ${{ steps.filter.outputs.sharing-editor == 'true' || steps.filter.outputs.gha == 'true' || env.RUN_ALL_TESTS == 'true' }}
3535
sharing-common: ${{ steps.filter.outputs.sharing-common == 'true' || steps.filter.outputs.gha == 'true' || env.RUN_ALL_TESTS == 'true' }}
3636
desktop: ${{ steps.filter.outputs.desktop == 'true' || steps.filter.outputs.gha == 'true' || env.RUN_ALL_TESTS == 'true' }}
@@ -52,8 +52,8 @@ jobs:
5252
# stlite-lib: # We run this job anytime. See above.
5353
# - 'packages/kernel/py/stlite-lib/**/*'
5454
# - 'streamlit/**/*'
55-
mountable:
56-
- 'packages/mountable/**/*'
55+
browser:
56+
- 'packages/browser/**/*'
5757
sharing-editor:
5858
- 'packages/sharing-editor/**/*'
5959
sharing-common:
@@ -165,15 +165,15 @@ jobs:
165165
cd packages/kernel/py/stlite-lib
166166
uv run pytest -v
167167
168-
test-mountable:
168+
test-browser:
169169
needs: changes
170-
if: ${{ needs.changes.outputs.mountable == 'true' }}
170+
if: ${{ needs.changes.outputs.browser == 'true' }}
171171

172172
runs-on: ubuntu-latest
173173

174174
defaults:
175175
run:
176-
working-directory: packages/mountable
176+
working-directory: packages/browser
177177

178178
steps:
179179
- uses: actions/checkout@v4
@@ -282,9 +282,9 @@ jobs:
282282
- run: yarn typecheck
283283
- run: yarn test
284284

285-
build-mountable:
285+
build-browser:
286286
if: ${{ ! failure() }} # This job should run even if the depending jobs are skipped, but not when those jobs failed: https://qiita.com/abetomo/items/d9ede7dbeeb24f723fc5#%E8%A8%AD%E5%AE%9A%E4%BE%8B4
287-
needs: [test-kernel, test-stlite-lib, test-mountable]
287+
needs: [test-kernel, test-stlite-lib, test-browser]
288288

289289
runs-on: ubuntu-latest
290290

@@ -301,43 +301,43 @@ jobs:
301301
python-version-file: ${{ env.python-version-file }}
302302
node-version-file: ${{ env.node-version-file }}
303303

304-
## Build and deploy @stlite/mountable
304+
## Build and deploy @stlite/browser
305305
# PUBLIC_URL here is set as a relative path, which is possible to the trick introduced at https://github.com/whitphx/stlite/pull/143.
306306
- name: Set PUBLIC_URL
307307
run: echo "PUBLIC_URL=." >> $GITHUB_ENV
308-
- name: Build @stlite/mountable
308+
- name: Build @stlite/browser
309309
run: |
310310
. .venv/bin/activate
311-
make mountable
311+
make browser
312312
313313
- name: Package
314-
working-directory: packages/mountable
314+
working-directory: packages/browser
315315
run: yarn pack
316316

317317
- name: Get the built package file path
318318
id: get-package-file-path
319-
working-directory: packages/mountable
320-
run: echo "PACKAGE_FILE_PATH=$(find $(pwd) -name "stlite-mountable-*.tgz" -print -quit)" >> $GITHUB_OUTPUT
319+
working-directory: packages/browser
320+
run: echo "PACKAGE_FILE_PATH=$(find $(pwd) -name "stlite-browser-*.tgz" -print -quit)" >> $GITHUB_OUTPUT
321321

322322
- name: Upload the built tar ball as an artifact
323323
uses: actions/upload-artifact@v4
324324
if: ${{ ! startsWith(github.ref, 'refs/tags/v') }}
325325
with:
326326
path: ${{ steps.get-package-file-path.outputs.PACKAGE_FILE_PATH }}
327-
name: stlite-mountable-${{ github.sha }}.tgz
327+
name: stlite-browser-${{ github.sha }}.tgz
328328

329329
- name: Upload the built tar ball as an artifact (when pushed with a version tag)
330330
uses: actions/upload-artifact@v4
331331
if: startsWith(github.ref, 'refs/tags/v')
332332
with:
333333
path: ${{ steps.get-package-file-path.outputs.PACKAGE_FILE_PATH }}
334-
name: stlite-mountable-${{ github.ref_name }}.tgz
334+
name: stlite-browser-${{ github.ref_name }}.tgz
335335

336-
- name: "Inform the package stats of @stlite/mountable"
336+
- name: "Inform the package stats of @stlite/browser"
337337
uses: ./.github/actions/inform-package-stats
338338
with:
339-
key: mountable
340-
name: "@stlite/mountable"
339+
key: browser
340+
name: "@stlite/browser"
341341
input-path: ${{ steps.get-package-file-path.outputs.PACKAGE_FILE_PATH }}
342342

343343
# Also get stats of the built wheel files of stlite-lib and streamlit in this job.
@@ -356,18 +356,18 @@ jobs:
356356
uses: ./.github/actions/inform-package-stats
357357
with:
358358
key: stlite-lib-wheel
359-
name: "stlite-lib wheel (built as a part of @stlite/mountable)"
359+
name: "stlite-lib wheel (built as a part of @stlite/browser)"
360360
input-path: ${{ steps.get-wheel-file-path.outputs.STLITE_LIB_WHEEL_FILEPATH }}
361361
- name: "Inform the package stats of streamlit wheel"
362362
uses: ./.github/actions/inform-package-stats
363363
with:
364364
key: streamlit-wheel
365-
name: "streamlit wheel (built as a part of @stlite/mountable)"
365+
name: "streamlit wheel (built as a part of @stlite/browser)"
366366
input-path: ${{ steps.get-wheel-file-path.outputs.STREAMLIT_WHEEL_FILEPATH }}
367367

368-
publish-mountable:
368+
publish-browser:
369369
if: ${{ !failure() && startsWith(github.ref, 'refs/tags/v') }} # `!failure()` is necessary to avoid skipping this job after successful build: https://github.com/actions/runner/issues/491
370-
needs: [build-mountable]
370+
needs: [build-browser]
371371

372372
permissions:
373373
contents: write # Necessary for creating releases: https://github.com/softprops/action-gh-release#permissions
@@ -385,18 +385,18 @@ jobs:
385385

386386
- uses: actions/download-artifact@v4
387387
with:
388-
name: stlite-mountable-${{ github.ref_name }}.tgz
389-
path: packages/mountable
388+
name: stlite-browser-${{ github.ref_name }}.tgz
389+
path: packages/browser
390390

391-
- run: yarn publish stlite-mountable-v*.tgz --access public
391+
- run: yarn publish stlite-browser-v*.tgz --access public
392392
env:
393393
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
394-
working-directory: packages/mountable
394+
working-directory: packages/browser
395395

396396
- name: Create a new release
397397
uses: softprops/action-gh-release@v2
398398
with:
399-
files: packages/mountable/stlite-mountable-v*.tgz
399+
files: packages/browser/stlite-browser-v*.tgz
400400
generate_release_notes: true
401401

402402
build-sharing:
@@ -728,7 +728,7 @@ jobs:
728728
if: ${{ !failure() && startsWith(github.ref, 'refs/tags/v') }} # `!failure()` is necessary to avoid skipping this job after successful build: https://github.com/actions/runner/issues/491
729729
needs:
730730
- test-build-vscode-extension
731-
- publish-mountable # The VSC extension uses the same version of published @stlite/mountable, so it must be released in order.
731+
- publish-browser # The VSC extension uses the same version of published @stlite/browser, so it must be released in order.
732732

733733
permissions:
734734
contents: write # Necessary for creating releases: https://github.com/softprops/action-gh-release#permissions

β€ŽDEVELOPMENT.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ cd packages/kernel
2222
yarn start
2323
```
2424

25-
#### `@stlite/mountable`
25+
#### `@stlite/browser`
2626

2727
```shell
28-
cd packages/mountable
28+
cd packages/browser
2929
yarn start
3030
```
3131

β€ŽMakefile

+6-6
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ node_modules := $(BUILD_STATE_DIR)/node_modules/.built
3636
venv := $(BUILD_STATE_DIR)/venv/.built
3737
common := $(BUILD_STATE_DIR)/common/.built
3838
common-react := $(BUILD_STATE_DIR)/common-react/.built
39-
mountable := $(BUILD_STATE_DIR)/mountable/.built
39+
browser := $(BUILD_STATE_DIR)/browser/.built
4040
sharing := $(BUILD_STATE_DIR)/sharing/.built
4141
sharing-common := $(BUILD_STATE_DIR)/sharing-common/.built
4242
sharing-editor := $(BUILD_STATE_DIR)/sharing-editor/.built
@@ -50,7 +50,7 @@ streamlit_frontend_lib_prod := streamlit/frontend/lib/dist/*
5050
export USE_CONSTRAINTS_FILE := false # https://github.com/streamlit/streamlit/blob/1.27.0/.github/workflows/release.yml#L67-L68
5151

5252
.PHONY: all
53-
all: init $(mountable) $(sharing) $(sharing-editor) $(desktop)
53+
all: init $(browser) $(sharing) $(sharing-editor) $(desktop)
5454

5555

5656
.PHONY: init
@@ -99,10 +99,10 @@ $(common-react): $(shell find packages/common-react/src -type f \( -name "*.ts"
9999
@mkdir -p $(dir $@)
100100
@touch $@
101101

102-
.PHONY: mountable
103-
mountable: $(mountable)
104-
$(mountable): $(shell find packages/mountable/src -type f \( -name "*.ts" -o -name "*.tsx" \) ) $(node_modules) $(kernel) $(common) $(common-react)
105-
cd packages/mountable && yarn build
102+
.PHONY: browser
103+
browser: $(browser)
104+
$(browser): $(shell find packages/browser/src -type f \( -name "*.ts" -o -name "*.tsx" \) ) $(node_modules) $(kernel) $(common) $(common-react)
105+
cd packages/browser && yarn build
106106
@mkdir -p $(dir $@)
107107
@touch $@
108108

File renamed without changes.
File renamed without changes.
File renamed without changes.

β€Žpackages/browser/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# `@stlite/browser`
2+
3+
Mount a Streamlit app on a static web page.
4+
5+
See https://github.com/whitphx/stlite#readme
File renamed without changes.
File renamed without changes.

β€Žpackages/mountable/index.html β€Žpackages/browser/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="utf-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1" />
6-
<title>Stlite Mountable dev page</title>
6+
<title>Stlite Browser dev page</title>
77
</head>
88
<body>
99
<noscript>You need to enable JavaScript to run this app.</noscript>

β€Žpackages/mountable/package.json β€Žpackages/browser/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "@stlite/mountable",
2+
"name": "@stlite/browser",
33
"version": "0.75.0",
44
"type": "module",
5-
"description": "Mountable Stlite application",
5+
"description": "Browser Stlite",
66
"keywords": [
77
"stlite",
88
"streamlit",
@@ -25,7 +25,7 @@
2525
"repository": {
2626
"type": "git",
2727
"url": "https://github.com/whitphx/stlite.git",
28-
"directory": "packages/mountable"
28+
"directory": "packages/browser"
2929
},
3030
"dependencies": {
3131
"@stlite/common": "^0.75.0",
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

β€Žpackages/mountable/README.md

-5
This file was deleted.

0 commit comments

Comments
Β (0)