Skip to content

Starting to yeet the template files out of the vsce. #1442

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

Merged
merged 13 commits into from
Dec 31, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions tools/vscode-extension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ The panel will have the ability to install the tools on the most popular platfor

### Changelog

- 0.3.0
- Overhauled template system.
- 0.2.8
- Adding main page button to update submodules.
- Creating categories for templates.
Expand Down
1 change: 1 addition & 0 deletions tools/vscode-extension/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ PSXDevPanel.viewType = 'psxDev'
exports.activate = (context) => {
tools.setExtensionUri(context.extensionUri)
tools.setGlobalStorageUri(context.globalStorageUri)
templates.setExtensionUri(context.extensionUri)
pcsxRedux.setGlobalStorageUri(context.globalStorageUri)
globalStorageUri = context.globalStorageUri

Expand Down
11 changes: 8 additions & 3 deletions tools/vscode-extension/media/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ import {
const hr2 = document.createElement('hr')
templatesDiv.appendChild(hr2)
const intro = document.createElement('h3')
intro.textContent = 'Fill in your project details above, then select a template category below, and finally select a template to create a new project.'
intro.textContent =
'Fill in your project details above, then select a template category below, and finally select a template to create a new project. If the create button is disabled, you need to install the required tools first.'
templatesDiv.appendChild(intro)
const categories = {}
for (const [key, template] of Object.entries(templates)) {
Expand Down Expand Up @@ -131,7 +132,8 @@ import {
templateDiv.appendChild(spaceTextNode1)
const templateInstallRequiredTools =
document.createElement('vscode-button')
templateInstallRequiredTools.textContent = 'Install required tools'
templateInstallRequiredTools.textContent =
'Install required tools'
templateInstallRequiredTools.appearance = 'secondary'
templateInstallRequiredTools.addEventListener('click', () => {
vscode.postMessage({
Expand All @@ -150,7 +152,10 @@ import {
templateInstallRecommendedTools.addEventListener('click', () => {
vscode.postMessage({
command: 'installTools',
tools: [...template.recommendedTools, ...template.requiredTools]
tools: [
...template.recommendedTools,
...template.requiredTools
]
})
})
templateDiv.appendChild(templateInstallRecommendedTools)
Expand Down
3 changes: 2 additions & 1 deletion tools/vscode-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "psx-dev",
"displayName": "PSX.Dev",
"description": "PlayStation 1 development made easy",
"version": "0.2.8",
"version": "0.3.0",
"engines": {
"vscode": "^1.75.0"
},
Expand Down Expand Up @@ -107,6 +107,7 @@
"dmg": "^0.1.0",
"fs-extra": "^11.1.0",
"JSONStream": "^1.3.5",
"mustache": "^4.2.0",
"open-file-explorer": "^1.0.2",
"simple-git": "^3.16.1",
"unzipper": "^0.10.11",
Expand Down
6 changes: 3 additions & 3 deletions tools/vscode-extension/pcsx-redux.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const updateInfo = {

let globalStorageUri

function isSupported() {
function isSupported () {
let supported = false
if (process.arch === 'x64') supported = true
if (process.platform === 'darwin' && process.arch === 'arm64') {
Expand All @@ -55,7 +55,7 @@ function isSupported() {
return supported
}

function binaryPath() {
function binaryPath () {
switch (process.platform) {
case 'win32':
return vscode.Uri.joinPath(
Expand All @@ -79,7 +79,7 @@ function binaryPath() {
}
}

function checkLocalFile(filename) {
function checkLocalFile (filename) {
return new Promise((resolve) => {
fs.access(filename, fs.constants.F_OK, (err) => {
resolve(!err)
Expand Down
Loading