Skip to content

Commit

Permalink
Refactor vue library to not use dist folder in npm
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-dharti-r committed Jan 11, 2024
1 parent 1100cf5 commit 892c748
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 25 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ jobs:
npm ci
npm run build
# Check if the version already exists on npm
# Check if the vue-file-upload version already exists on npm
- name: Check Version Existence
id: check_version
run: |
if npm show @canopassoftware/vue-file-upload@1.0.6; then
if npm show @canopassoftware/vue-file-upload@1.0.7; then
echo "Version already published. Skipping npm publish."
echo "::set-output name=skip_publish::true"
else
echo "::set-output name=skip_publish::false"
fi
# Publish only if the version check passed
# Publish only if the vue-file-upload version check passed
- name: Publish to npm
if: steps.check_version.outputs.skip_publish != 'true'
if: steps.check_version.outputs.skip_publish != true
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand All @@ -50,7 +50,7 @@ jobs:
npm ci
npm run build
# Check if the version already exists on npm
# Check if the react-file-upload version already exists on npm
- name: Check Version Existence
id: check_version
run: |
Expand All @@ -61,9 +61,9 @@ jobs:
echo "::set-output name=skip_publish::false"
fi
# Publish only if the version check passed
# Publish only if the react-file-upload version check passed
- name: Publish to npm
if: steps.check_version.outputs.skip_publish != 'true'
if: steps.check_version.outputs.skip_publish != true
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,4 @@ This project is licensed under the [MIT](https://github.com/canopas/web-file-upl

## Contact Information

Vue file upload is owned and maintained by the [Canopas team](https://canopas.com/). You can reach out them on Github at [canopas](https://github.com/canopas) for questions or need support.
Web file upload is owned and maintained by the [Canopas team](https://canopas.com/). You can reach out them on Github at [canopas](https://github.com/canopas) for questions or need support.
7 changes: 6 additions & 1 deletion vue/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,9 @@ coverage
*.ntvs*
*.njsproj
*.sln
*.sw?
*.sw?

index.mjs
index.umd.js
favicon.ico
style.css
2 changes: 1 addition & 1 deletion vue/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ import { SingleFileUpload, MultipleFileUpload } from '@canopassoftware/vue-file-
- Use `style.css` for UI by importing like,

```js
import "@canopassoftware/vue-file-upload/dist/style.css"
import "@canopassoftware/vue-file-upload/style.css"
```

### Creating custom UI with file preview
Expand Down
1 change: 1 addition & 0 deletions vue/examples/CanvasView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
</template>

<script lang="ts">
import "@canopassoftware/vue-file-upload/style.css"
import { SingleFileUpload, MultipleFileUpload } from '@canopassoftware/vue-file-upload'
export default {
Expand Down
1 change: 1 addition & 0 deletions vue/examples/LongSquareView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
</template>

<script lang="ts">
import "@canopassoftware/vue-file-upload/style.css"
import { SingleFileUpload, MultipleFileUpload } from '@canopassoftware/vue-file-upload'
export default {
Expand Down
1 change: 1 addition & 0 deletions vue/examples/RoundView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
</template>

<script lang="ts">
import "@canopassoftware/vue-file-upload/style.css"
import { SingleFileUpload, MultipleFileUpload } from '@canopassoftware/vue-file-upload'
export default {
Expand Down
1 change: 1 addition & 0 deletions vue/examples/SquareView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
</template>

<script lang="ts">
import "@canopassoftware/vue-file-upload/style.css"
import { SingleFileUpload, MultipleFileUpload } from '@canopassoftware/vue-file-upload'
export default {
Expand Down
8 changes: 4 additions & 4 deletions vue/examples/demo/package-lock.json

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

2 changes: 1 addition & 1 deletion vue/examples/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"format": "prettier --write src/"
},
"dependencies": {
"@canopassoftware/vue-file-upload": "^1.0.3",
"@canopassoftware/vue-file-upload": "^1.0.7",
"vue": "^3.3.4",
"vue-router": "^4.2.5"
},
Expand Down
1 change: 1 addition & 0 deletions vue/examples/demo/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { createApp } from 'vue'
import App from './App.vue'
import router from './router'

import "@canopassoftware/vue-file-upload/style.css"
import { SingleFileUpload, MultipleFileUpload } from '@canopassoftware/vue-file-upload'

const app = createApp(App)
Expand Down
6 changes: 0 additions & 6 deletions vue/examples/demo/src/views/IndexView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,8 @@
</template>

<script lang="ts">
import { SingleFileUpload, MultipleFileUpload } from '@canopassoftware/vue-file-upload'
export default {
name: 'IndexView',
components: {
MultipleFileUpload,
SingleFileUpload
},
data() {
return {
uploadedFile: {} as {
Expand Down
14 changes: 10 additions & 4 deletions vue/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@canopassoftware/vue-file-upload",
"version": "1.0.6",
"version": "1.0.7",
"description": "Show the preview of file and manage files data to upload",
"main": "./dist/index.umd.js",
"main": "index.umd.js",
"repository": {
"type": "git",
"url": "git+https://github.com/canopas/file-upload-web-frontend.git"
Expand All @@ -22,7 +22,7 @@
"homepage": "https://github.com/canopas/file-upload-web-frontend#readme",
"scripts": {
"dev": "tailwindcss -i ./src/input.css -o ./dist/output.css && vite",
"build": "npm run build-css && vite build",
"build": "npm run build-css && vite build && cp -r ./dist/* ./",
"preview": "vite preview",
"build-only": "vite build",
"type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false",
Expand Down Expand Up @@ -60,5 +60,11 @@
},
"directories": {
"example": "examples"
}
},
"files": [
"./index.mjs",
"./index.umd.js",
"./style.css",
"./favicon.ico"
]
}

0 comments on commit 892c748

Please sign in to comment.