Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: rename components package to smart camera web #140

Merged
merged 8 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ on:
jobs:
test:
uses: ./.github/workflows/test.yml
components:
smart-camera-web:
needs:
- test
defaults:
run:
working-directory: ./packages/components
working-directory: ./packages/smart-camera-web
runs-on: ubuntu-latest
steps:
- name: checkout code
Expand All @@ -27,9 +27,9 @@ jobs:
- name: build application
run: npm run build
- name: set destination directory
id: set_dest_dir_camera_web
id: set_dest_dir_smart_camera_web
run: >-
echo "DEST_DIR_COMPONENTS=js/preview-$GITHUB_HEAD_REF" >>
echo "DEST_DIR_SMART_CAMERA_WEB=js/preview-$GITHUB_HEAD_REF" >>
"$GITHUB_ENV"
- name: deploy preview to s3
uses: jakejarvis/[email protected]
Expand All @@ -42,8 +42,8 @@ jobs:
AWS_ACCESS_KEY_ID: '${{ secrets.AWS_ACCESS_KEY_ID }}'
AWS_SECRET_ACCESS_KEY: '${{ secrets.AWS_SECRET_ACCESS_KEY }}'
AWS_REGION: '${{ secrets.AWS_REGION }}'
SOURCE_DIR: ./packages/components
DEST_DIR: '${{ env.DEST_DIR_COMPONENTS }}'
SOURCE_DIR: ./packages/smart-camera-web
DEST_DIR: '${{ env.DEST_DIR_SMART_CAMERA_WEB }}'
embed:
needs:
- test
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ on:
jobs:
test:
uses: ./.github/workflows/test.yml
components:
smart-camera-web:
needs: [test]
runs-on: ubuntu-latest
timeout-minutes: 5
defaults:
run:
working-directory: ./packages/components
working-directory: ./packages/smart-camera-web
steps:
- name: checkout code
uses: actions/checkout@v4
Expand All @@ -26,7 +26,7 @@ jobs:
AWS_ACCESS_KEY_ID: "${{ secrets.AWS_ACCESS_KEY_ID }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_ACCESS_KEY }}"
AWS_REGION: "${{ secrets.AWS_REGION }}"
SOURCE_DIR: "./packages/components"
SOURCE_DIR: "./packages/smart-camera-web"
DEST_DIR: "js/staging"
embed:
needs: [test]
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@ on:
jobs:
test:
uses: ./.github/workflows/test.yml
components:
smart-camera-web:
needs: [test]
runs-on: ubuntu-latest
timeout-minutes: 5
defaults:
run:
working-directory: ./packages/components
working-directory: ./packages/smart-camera-web
steps:
- name: checkout code
uses: actions/checkout@v4
- name: get-npm-version
id: package-version
uses: martinbeentjes/[email protected]
with:
path: packages/components
path: packages/smart-camera-web
- name: set destination directory
id: set_destination
env:
TAG: ${{ steps.package-version.outputs.current-version }}
run: |
echo "DEST_DIR_COMPONENTS=js/v$TAG" >> $GITHUB_OUTPUT
echo "DEST_DIR_SMART_CAMERA_WEB=js/v$TAG" >> $GITHUB_OUTPUT
- name: deploy to s3 / cloudfront
uses: jakejarvis/[email protected]
with:
Expand All @@ -34,9 +34,9 @@ jobs:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SOURCE_DIR: ./packages/components
SOURCE_DIR: ./packages/smart-camera-web
AWS_REGION: ${{ secrets.AWS_REGION }}
DEST_DIR: ${{ steps.set_destination.outputs.DEST_DIR_COMPONENTS }}
DEST_DIR: ${{ steps.set_destination.outputs.DEST_DIR_SMART_CAMERA_WEB }}
embed:
needs: [test]
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ on:
pull_request:
workflow_dispatch:
jobs:
components:
smart-camera-web:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./packages/components
working-directory: ./packages/smart-camera-web
steps:
- name: checkout code
uses: actions/checkout@v4
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/share-preview-url.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
steps:
- name: checkout code
uses: actions/checkout@v4
- name: get dest dir for web components
id: get_dest_dir_components
working-directory: ./packages/components
- name: get dest dir for web smart-camera-web
id: get_dest_dir_smart_camera_web
working-directory: ./packages/smart-camera-web
run: >-
echo "DEST_DIR_COMPONENTS=js/preview-$GITHUB_HEAD_REF" >>
echo "DEST_DIR_SMART_CAMERA_WEB=js/preview-$GITHUB_HEAD_REF" >>
"$GITHUB_ENV"
- name: get dest dir for web embed
id: get_dest_dir_embed
Expand All @@ -30,9 +30,9 @@ jobs:
This branch has been deployed to s3 / cloudfront.
✅ Preview URL for Components / Smart Camera Web:
✅ Preview URL for Smart Camera Web:
https://cdn.smileidentity.com/${{ env.DEST_DIR_COMPONENTS }}/smart-camera-web.js
https://cdn.smileidentity.com/${{ env.DEST_DIR_SMART_CAMERA_WEB }}/smart-camera-web.js
✅ Preview URL for Embed:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: test
on:
workflow_call:
jobs:
components:
smart-camera-web:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./packages/components
working-directory: ./packages/smart-camera-web
steps:
- name: checkout code
uses: actions/checkout@v4
Expand All @@ -21,7 +21,7 @@ jobs:
with:
install: false
start: npm start
working-directory: ./packages/components
working-directory: ./packages/smart-camera-web
wait-on: 'http://localhost:8000'
embed:
runs-on: ubuntu-latest
Expand Down
36 changes: 18 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/embed/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@smile_identity/web-page",
"name": "@smileid/embed",
"version": "v1.2.3",
"description": "Self Hosted Integration for Smile Identity on the Web",
"private": true,
Expand Down Expand Up @@ -27,7 +27,7 @@
},
"homepage": "https://github.com/smileidentity/hosted-web-integration#readme",
"dependencies": {
"@smile_identity/smart-camera-web": "file:../components",
"@smile_identity/smart-camera-web": "^1.0.2",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure about this change? It's going to make publishing a lot more complicated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested and verified that it uses the local package as we have this set up as a workspace.

I see the concerns around possible version collisions, will test that shortly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested, and returning to file path.

while this is the right direction for workspaces, we need to avoid situations where updates
to workspace packages do not reflect in dependent packages.

for now, local paths are the better option.

"jszip": "^3.10.1",
"validate.js": "^0.13.1"
},
Expand Down
File renamed without changes.