Merge pull request #5 from dredgy/npm_scripts

Npm scripts
This commit is contained in:
dredgy
2022-02-14 19:04:54 +10:00
committed by GitHub
60 changed files with 241 additions and 20 deletions

5
.gitignore vendored
View File

@@ -6,6 +6,7 @@
/tables/*
/Properties/
/.idea/
/wwwroot/scripts/js/
/wwwroot/styles/css/*
/wwwroot/scripts/*.js
/wwwroot/scripts/*.js.map
/wwwroot/styles/*
/Folder.DotSettings.user

View File

@@ -10,8 +10,8 @@ open DredgeFramework
let currentTheme = "restaurant"
let getHTMLForFile file =
let stylePath = $"/styles/css/{file}"
let scriptPath = $"/scripts/js/{file}"
let stylePath = $"/styles/{file}"
let scriptPath = $"/scripts/{file}"
let fileExtension = file |> getFileExtension
let scriptFileExists = File.Exists ("wwwroot"+stylePath) || File.Exists("wwwroot"+scriptPath)
match scriptFileExists with
@@ -26,7 +26,7 @@ let getHTMLForFile file =
let ParseScriptsAndStylesheets files html =
let defaultScriptsAndStyles = ["dark.theme.css"; "../external/jquery.js" ; "dredgepos.core.js"; "keyboards.js";]
let defaultScriptsAndStyles = ["dark.theme.css"; "./external/jquery.js" ; "dredgepos.core.js"; "keyboards.js";]
let scriptsAndStylesheets = defaultScriptsAndStyles @ files
let scriptAndStylesheetHTML =
@@ -89,7 +89,7 @@ let ParseLanguageVariablesWithReplacements (string: string) =
))
let getTemplateFilePath templateName =
"wwwroot/themes/"+ currentTheme + "/" + templateName + ".tpl.htm"
"views/"+ currentTheme + "/" + templateName + ".tpl.htm"
let templateExists templateName =
templateName

View File

@@ -46,6 +46,207 @@
<Content Remove="node_modules\**" />
<Content Remove="wwwroot\scripts\ts\test.ts" />
<Content Remove="languages\**" />
<Content Include="sass\dark.theme.sass">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="sass\dredgepos.authenticate.sass">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="sass\dredgepos.core.sass">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="sass\dredgepos.floorplan.sass">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="sass\dredgepos.keyboards.sass">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="sass\dredgepos.orderScreen.sass">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="typescript\dredgepos.authenticate.ts">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="typescript\dredgepos.core.ts">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="typescript\dredgepos.floorplan.ts">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="typescript\dredgepos.orderScreen.ts">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="typescript\dredgepos.tables.ts">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="typescript\keyboards.ts">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="typescript\types.ts">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="typescript\typings\currency.d.ts">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="typescript\typings\konva.d.ts">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\alert.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\authenticate.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\backupPayentsplitter.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\button.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\buttonWithImage.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\categories\BeerPage1.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\categories\BeerPage2.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\categories\DessertsPage1.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\categories\MainsPage1.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\categories\StartersPage1.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\categories\WinePage1.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\categoryButton.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\categoryMenu.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\components\posButton.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\decoratorItem.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\decoratorRow.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\floorplan.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\keyboards.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\orderBox.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\orderBoxTable.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\orderScreen.tpl - Copy.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\orderScreen.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\orderScreen\button_image.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\orderScreen\change_cover_number_button.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\orderScreen\cover_selector.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\orderScreen\grid_button.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\orderScreen\grid_container.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\orderScreen\page.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\orderScreen\page_group.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\orderScreen\page_group_button.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\paymentSplitter.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\popupBoxItems.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\roomButton.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\virtualKeyboard.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\virtualNumpad.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Folder Include="wwwroot\styles" />
</ItemGroup>
<ItemGroup>
@@ -78,12 +279,10 @@
<Content Include="xslt\orderHtmltoXML.xslt" />
<Content Include="xslt\htmlToEscPos.xslt" />
<Content Include=".gitignore" />
<Folder Include="wwwroot\fonts" />
<Folder Include="wwwroot\styles\css" />
</ItemGroup>
<ItemGroup>
<_ContentIncludedByDefault Remove="wwwroot\themes\default\index.tpl.html" />
<_ContentIncludedByDefault Remove="wwwroot\themes\default\index.tpl.html" />
<_ContentIncludedByDefault Remove="wwwroot\themes\default\scripts\global.js" />
<_ContentIncludedByDefault Remove="wwwroot\themes\default\scripts\index.js" />
<_ContentIncludedByDefault Remove="wwwroot\themes\default\styles\global.css" />

16
DredgePos.sln Normal file
View File

@@ -0,0 +1,16 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "DredgePos", "DredgePos.fsproj", "{3C52169C-8E40-472B-B87B-82F43F96BFB0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3C52169C-8E40-472B-B87B-82F43F96BFB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3C52169C-8E40-472B-B87B-82F43F96BFB0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3C52169C-8E40-472B-B87B-82F43F96BFB0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3C52169C-8E40-472B-B87B-82F43F96BFB0}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

View File

@@ -119,7 +119,7 @@ let loadFloorplan (ctx: HttpContext) : HttpHandler =
"decorator", Entities.Floorplan_Decorations.Controller.generateDecorator()
]
let styles = ["dredgepos.floorplan.css"]
let scripts = ["../external/konva.min.js" ; "dredgepos.floorplan.js"]
let scripts = ["./external/konva.min.js" ; "dredgepos.floorplan.js"]
let currentClerk = recordToMap <| Authenticate.Model.getCurrentClerk ctx
let arrays = map ["clerk", currentClerk]

View File

@@ -81,7 +81,7 @@ let loadOrderScreen (ctx: HttpContext) (tableNumber: int) : HttpHandler =
]
let styles = ["dredgepos.orderScreen.css"]
let scripts = ["dredgepos.tables.js";"../external/currency.min.js";"dredgepos.orderScreen.js"; ]
let scripts = ["dredgepos.tables.js";"./external/currency.min.js";"dredgepos.orderScreen.js"; ]
let currentClerk = recordToMap <| Authenticate.Model.getCurrentClerk ctx
let arrays = map ["clerk", currentClerk]

5
package-lock.json generated
View File

@@ -578,6 +578,11 @@
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
"integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o="
},
"tsc": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/tsc/-/tsc-2.0.4.tgz",
"integrity": "sha512-fzoSieZI5KKJVBYGvwbVZs/J5za84f2lSTLPYf6AGiIf43tZ3GNrI1QzTLcjtyDDP4aLxd46RTZq1nQxe7+k5Q=="
},
"typescript": {
"version": "4.4.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz",

View File

@@ -7,9 +7,15 @@
"currency.js": "^2.0.4",
"konva": "^8.2.2",
"sass": "^1.43.4",
"tsc": "^2.0.4",
"typescript": "^4.4.4"
},
"description": "",
"license": "",
"repository": ""
"repository": "",
"scripts": {
"sass": "sass sass:wwwroot/styles",
"typescript": "tsc",
"build" : "npm run sass && npm run typescript"
}
}

View File

@@ -7,12 +7,12 @@
"noImplicitAny":true,
"removeComments":false,
"preserveConstEnums":true,
"outDir":"../js",
"outDir":"wwwroot/scripts",
"target":"ES2016",
"sourceMap":true,
"moduleResolution": "node"
},
"include":[
"*"
"typescript"
]
}

View File

@@ -1,6 +0,0 @@
{
"name": "ts",
"version": "1.0.0",
"dependencies": {
}
}