Skip to content

Commit

Permalink
Merge pull request #37 from obewds/dev
Browse files Browse the repository at this point in the history
0.11.0 - adding js file deletion to install script and fixing bug in update profile info form compo for jetstream
  • Loading branch information
oberocks authored Aug 22, 2023
2 parents 523ebf0 + fe9c75b commit c97b5c7
Show file tree
Hide file tree
Showing 13 changed files with 76 additions and 6 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ Next up, you can check out the install so far using (vite will give you a link f
npm run dev
```

> NOTE: You may need to delete Jetstream's node_modules directory and reinstall node.js dependencies with a `npm install` command to get vite to play nicely with Jetstream defaults!

## Installing VILT DS

Expand All @@ -68,4 +70,12 @@ Once the VILT DS package is installed, you can access and run the VILT DS instal
npx vilt-ds
```

After your base VILT DS files are installed, you'll need to run the following command:

```bash
sail artisan ziggy:generate
```

The `sail artisan ziggy:generate` command will generate a Javascript file with current routes in it. Typescript needs this information downstream, so we need to update this file when new routes are established.

For now, we can simply switch the ziggy generated file from a Javascript `.js` extension to a Typescript `.ts` extension, and move on with our project.

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

1 change: 1 addition & 0 deletions dist/helpers/remove-file.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default function (filenamePath: string): void;
9 changes: 9 additions & 0 deletions dist/helpers/remove-file.js

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

1 change: 1 addition & 0 deletions dist/helpers/remove-file.js.map

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

8 changes: 8 additions & 0 deletions dist/installers/install-vilt-ds-jetstream.js

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

2 changes: 1 addition & 1 deletion dist/installers/install-vilt-ds-jetstream.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions 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 package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@obewds/vilt-ds",
"version": "0.10.2",
"version": "0.11.0",
"description": "The official repository for the VILT Design System for the Vue.js, Inertia.js, Laravel, and Tailwind CSS web app stack that is turbocharged with Typescript and VueVentus.",
"license": "MIT",
"author": "Matt McT",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ return `<!-- ./resources/js/Pages/Profile/Partials/UpdateProfileInformationForm.
<div v-show="photoPreview" class="mt-2">
<span
class="block rounded-full w-20 h-20 bg-cover bg-no-repeat bg-center"
:style="'background-image: url(\'' + photoPreview + '\');'"
:style="'background-image: url(' + photoPreview + ');'"
/>
</div>
Expand Down
14 changes: 14 additions & 0 deletions src/helpers/remove-file.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// ./src/helpers/remove-file.ts

import fs from 'fs-extra'

import cliSuccessMessage from './cli-success-message.js'
import cwd from './cwd.js'

export default function (filenamePath:string): void {

fs.removeSync( cwd + filenamePath)

cliSuccessMessage('.' + filenamePath + ' file was deleted successfully!', false, false)

}
10 changes: 10 additions & 0 deletions src/installers/install-vilt-ds-jetstream.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// ./src/installers/install-vilt-ds-jetstream.ts

import installFile from '../helpers/install-file.js'
import removeFile from '../helpers/remove-file.js'

// import client side deps and package scripts/mods for VILT DS and VueVentus
import installJetstreamNpmDeps from '../installers/dependencies/install-jetstream-npm-deps.js'
Expand Down Expand Up @@ -245,4 +246,13 @@ export default function (): void {
// install suggested VS Code Extensions for VILT DS
installFile( '/.vscode/extensions.json', JSON.stringify(viltDsVscodeExtensions, null, 4) )

console.log(' ')

// delete javascript files now replaced by typescript files
removeFile( '/vite.config.js' )
removeFile( '/tailwind.config.js' )
removeFile( '/tailwind.config.js' )
removeFile( '/resources/js/bootstrap.js' )
removeFile( '/resources/js/app.js' )

}
17 changes: 17 additions & 0 deletions tests/helpers/remove-file.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// ./tests/helpers/remove-file.test.ts

import { describe, expect, test } from '@jest/globals'
import fs from 'fs-extra'
import cwd from '../../src/helpers/cwd.js'
import projectFileDoesExist from '../../src/helpers/project-file-does-exist.js'
import removeFile from '../../src/helpers/remove-file'

describe('./src/helpers/remove-file module', () => {

test('module can be imported successfully', () => {

expect(removeFile).toBeTruthy()

})

})

0 comments on commit c97b5c7

Please sign in to comment.