Compare commits

..

5 commits

8 changed files with 169 additions and 9 deletions

View file

@ -4,6 +4,9 @@
"service": "silverstripe", "service": "silverstripe",
"workspaceFolder": "/vscode/src/mantra", "workspaceFolder": "/vscode/src/mantra",
"extensions": [ "extensions": [
"ms-vscode.vscode-typescript-tslint-plugin" "felixfbecker.php-pack",
"ms-vscode.vscode-typescript-tslint-plugin",
"msjsdiag.debugger-for-chrome",
"neilbrayfield.php-docblocker"
] ]
} }

View file

@ -8,6 +8,7 @@ services:
- 8080:80 - 8080:80
- 3000:3000 - 3000:3000
- 3001:3001 - 3001:3001
- 9000:9000
volumes: volumes:
- ..:/vscode/src/mantra - ..:/vscode/src/mantra
- ../test/website:/var/www/html - ../test/website:/var/www/html

View file

@ -5,8 +5,11 @@
// List of extensions which should be recommended for users of this workspace. // List of extensions which should be recommended for users of this workspace.
"recommendations": [ "recommendations": [
"adrianhumphreys.silverstripe", "adrianhumphreys.silverstripe",
"felixfbecker.php-pack",
"ms-vscode.vscode-typescript-tslint-plugin", "ms-vscode.vscode-typescript-tslint-plugin",
"ms-vscode-remote.remote-containers" "ms-vscode-remote.remote-containers",
"msjsdiag.debugger-for-chrome",
"neilbrayfield.php-docblocker"
], ],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace. // List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": [ "unwantedRecommendations": [

38
.vscode/launch.json vendored Normal file
View file

@ -0,0 +1,38 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}/test/website/public",
"pathMapping": {
"/_resources/themes/mantra": "${workspaceFolder}"
},
"preLaunchTask": "Watch Debug",
"postDebugTask": "Stop Debug"
},
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000,
"pathMappings": {
"/var/www/html": "${workspaceFolder}/test/website"
}
}
],
"compounds": [
{
"name": "Debug Theme",
"configurations": [
"Launch Chrome",
"Listen for XDebug"
]
}
]
}

85
.vscode/tasks.json vendored Normal file
View file

@ -0,0 +1,85 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Debug",
"type": "npm",
"script": "build",
"group": "build",
"problemMatcher": "$tsc"
},
{
"label": "Release",
"type": "npm",
"script": "release",
"group": "build",
"problemMatcher": "$tsc"
},
{
"label": "Watch Debug",
"type": "npm",
"script": "watch",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never"
}
},
{
"label": "Watch Release",
"type": "npm",
"script": "watch-release",
"group": "build",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never"
}
},
{
"label": "Stop Debug",
"type": "npm",
"script": "stop",
"problemMatcher": [],
"presentation": {
"reveal": "never"
}
},
{
"label": "Stop Release",
"type": "npm",
"script": "stop-release",
"problemMatcher": [],
"presentation": {
"reveal": "never"
}
},
{
"label": "Rebuild",
"type": "npm",
"script": "rebuild",
"problemMatcher": "$tsc"
},
{
"label": "Rebuild Release",
"type": "npm",
"script": "rebuild-release",
"problemMatcher": "$tsc"
},
{
"label": "Lint",
"type": "npm",
"script": "lint",
"problemMatcher": "$tslint5",
"presentation": {
"reveal": "never"
}
}
]
}

View file

@ -24,10 +24,28 @@
], ],
"homepage": "https://github.com/manuth/mantra#readme", "homepage": "https://github.com/manuth/mantra#readme",
"scripts-descriptions": { "scripts-descriptions": {
"initialize": "Initializes the project." "build": "Builds the project.",
"release": "Performs a release-build.",
"rebuild": "Rebuilds the project.",
"rebuild-release": "Rebuilds the project in release-mode.",
"watch": "Builds the project in watch-mode.",
"watch-release": "Performs a release-build in watch-mode.",
"stop": "Stops building the project in watch-mode.",
"stop-release": "Stops performing the release-build in watch-mode.",
"clean": "Cleans the project",
"lint": "Lints the project."
}, },
"scripts": { "scripts": {
"initialize": "npm run initialize" "build": "npm run build",
"release": "npm run release",
"rebuild": "npm run rebuild",
"rebuild-release": "npm run rebuild-release",
"watch": "npm run watch",
"watch-release": "npm run watch-release",
"stop": "npm run stop",
"stop-release": "npm run stop-release",
"clean": "npm run clean",
"lint": "npm run lint"
}, },
"require": {}, "require": {},
"require-dev": { "require-dev": {
@ -54,7 +72,7 @@
"scripts-dev": { "scripts-dev": {
"post-install-cmd": [ "post-install-cmd": [
"npm install", "npm install",
"@initialize", "@rebuild",
"composer --working-dir=./test/website install" "composer --working-dir=./test/website install"
] ]
} }

View file

@ -85,9 +85,9 @@ function ParseArgs(args: string[])
let settings = new Settings(options["target"]); let settings = new Settings(options["target"]);
/** /**
* Initializes the project. * Cleans the project.
*/ */
export async function Initialize() export async function Clean()
{ {
let directories = [ let directories = [
"javascript", "javascript",
@ -109,7 +109,7 @@ export async function Initialize()
await require("create-symlink")(settings.RootPath(), settings.TestThemePath(), { type: "junction" }); await require("create-symlink")(settings.RootPath(), settings.TestThemePath(), { type: "junction" });
} }
Initialize.description = "Initializes the project."; Clean.description = "Cleans the project.";
/** /**
* Builds the project in watched mode. * Builds the project in watched mode.

View file

@ -1,7 +1,19 @@
{ {
"private": true, "private": true,
"scripts": { "scripts": {
"initialize": "gulp Initialize" "build": "gulp Build -t Debug",
"release": "gulp Build -t Release",
"rebuild": "npm run clean && npm run build",
"rebuild-release": "npm run clean && npm run release",
"watch": "gulp Watch -t Debug",
"watch-release": "gulp Watch -t Release",
"stop": "gulp Stop -t Debug",
"stop-release": "gulp Stop -t Release",
"clean": "gulp Clean",
"lint": "npm run lint-gulp && npm run lint-project",
"lint-gulp": "tslint -p . -t verbose",
"lint-project": "tslint -p ./src/App -t verbose",
"prepare": "npm run rebuild"
}, },
"dependencies": {}, "dependencies": {},
"devDependencies": { "devDependencies": {