mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-13 17:22:15 -05:00
Boilerplate for SQL Bindings Extension (#18624)
* boilerplate for sql bindings extension * edit gulpfile task as it was trying to find specific menus within package.json
This commit is contained in:
@@ -129,16 +129,19 @@ gulp.task('package-external-extensions', task.series(
|
||||
const packageManifestPath = path.join(packageDir, 'package.json');
|
||||
const json = require('gulp-json-editor');
|
||||
const packageJsonStream = gulp.src(packageManifestPath) // Create stream for the original package.json
|
||||
.pipe(json(data => { // And now use gulp-json-editor to modify the contents
|
||||
.pipe(json(data => {
|
||||
// And now use gulp-json-editor to modify the contents
|
||||
const updateData = JSON.parse(fs.readFileSync(vscodeManifestFullPath)); // Read in the set of values to replace from package.vscode.json
|
||||
Object.keys(updateData).forEach(key => {
|
||||
data[key] = updateData[key];
|
||||
});
|
||||
// Remove ADS-only menus. This is a subset of the menus listed in https://github.com/microsoft/azuredatastudio/blob/main/src/vs/workbench/api/common/menusExtensionPoint.ts
|
||||
// More can be added to the list as needed.
|
||||
['objectExplorer/item/context', 'dataExplorer/context', 'dashboard/toolbar'].forEach(menu => {
|
||||
delete data.contributes.menus[menu];
|
||||
});
|
||||
if(data.contributes?.menus){
|
||||
// Remove ADS-only menus. This is a subset of the menus listed in https://github.com/microsoft/azuredatastudio/blob/main/src/vs/workbench/api/common/menusExtensionPoint.ts
|
||||
// More can be added to the list as needed.
|
||||
['objectExplorer/item/context', 'dataExplorer/context', 'dashboard/toolbar'].forEach(menu => {
|
||||
delete data.contributes.menus[menu];
|
||||
});
|
||||
}
|
||||
return data;
|
||||
}, { beautify: false }))
|
||||
.pipe(gulp.dest(packageDir));
|
||||
|
||||
@@ -135,6 +135,7 @@ const extensionsFilter = filter([
|
||||
'**/schema-compare.xlf',
|
||||
'**/server-report.xlf',
|
||||
'**/sql-assessment.xlf',
|
||||
'**/sql-bindings.xlf',
|
||||
'**/sql-database-projects.xlf',
|
||||
'**/sql-migration.xlf',
|
||||
'**/xml-language-features.xlf'
|
||||
|
||||
@@ -231,6 +231,7 @@ const externalExtensions = [
|
||||
'schema-compare',
|
||||
'server-report',
|
||||
'sql-assessment',
|
||||
'sql-bindings',
|
||||
'sql-database-projects',
|
||||
'sql-migration'
|
||||
];
|
||||
|
||||
@@ -267,6 +267,7 @@ const externalExtensions = [
|
||||
'schema-compare',
|
||||
'server-report',
|
||||
'sql-assessment',
|
||||
'sql-bindings',
|
||||
'sql-database-projects',
|
||||
'sql-migration'
|
||||
];
|
||||
|
||||
@@ -48,6 +48,7 @@ exports.dirs = [
|
||||
'extensions/server-report',
|
||||
'extensions/simple-browser',
|
||||
'extensions/sql-assessment',
|
||||
'extensions/sql-bindings',
|
||||
'extensions/sql-database-projects',
|
||||
'extensions/sql-migration',
|
||||
'extensions/vscode-test-resolver',
|
||||
|
||||
13
extensions/sql-bindings/.eslintrc.json
Normal file
13
extensions/sql-bindings/.eslintrc.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"parserOptions": {
|
||||
"project": "./extensions/sql-bindings/tsconfig.json"
|
||||
},
|
||||
"rules": {
|
||||
"@typescript-eslint/no-floating-promises": [
|
||||
"error",
|
||||
{
|
||||
"ignoreVoid": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
1
extensions/sql-bindings/.gitignore
vendored
Normal file
1
extensions/sql-bindings/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
*.vsix
|
||||
21
extensions/sql-bindings/.vscode/launch.json
vendored
Normal file
21
extensions/sql-bindings/.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
// 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": [
|
||||
// This task is meant for running the VS Code version of the extension. See VSCODE_DEVELOPMENT.md for more information
|
||||
{
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"name": "Launch Extension in VS Code",
|
||||
"runtimeExecutable": "${execPath}",
|
||||
"args": [
|
||||
"--extensionDevelopmentPath=${workspaceFolder}"
|
||||
],
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/out/**/*.js"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
9
extensions/sql-bindings/.vscodeignore
Normal file
9
extensions/sql-bindings/.vscodeignore
Normal file
@@ -0,0 +1,9 @@
|
||||
src
|
||||
out
|
||||
tsconfig.json
|
||||
.gitignore
|
||||
coverage
|
||||
coverConfig.json
|
||||
extension.webpack.config.js
|
||||
*.vsix
|
||||
yarn.lock
|
||||
29
extensions/sql-bindings/README.md
Normal file
29
extensions/sql-bindings/README.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# Microsoft SQL Bindings for Azure Data Studio and VS Code
|
||||
|
||||
## Overview
|
||||
|
||||
Microsoft SQL Bindings for Azure Data Studio and VS Code enables users to develop Azure Functions with Azure SQL bindings
|
||||
|
||||
### VS Code
|
||||
|
||||
This extension is bundled into the `SQL Server (MSSQL)` extension for VS Code and will be installed automatically when that extension is updated or installed.
|
||||
|
||||
### Azure Data Studio
|
||||
|
||||
This extension is provided as a separate extension in the marketplace.
|
||||
|
||||
Please report issues and feature requests [here.](https://github.com/microsoft/azuredatastudio/issues)
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
||||
|
||||
## Privacy Statement
|
||||
|
||||
The [Microsoft Enterprise and Developer Privacy Statement](https://privacy.microsoft.com/privacystatement) describes the privacy statement of this software.
|
||||
|
||||
## License
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
Licensed under the [Source EULA](https://raw.githubusercontent.com/Microsoft/azuredatastudio/main/LICENSE.txt).
|
||||
11
extensions/sql-bindings/VSCODE_DEVELOPMENT.md
Normal file
11
extensions/sql-bindings/VSCODE_DEVELOPMENT.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# VS Code Extension Development
|
||||
|
||||
For working on the VS Code version of the package follow these steps for local development/testing.
|
||||
|
||||
1. Copy the values from [package.vscode.json](./package.vscode.json) into [package.json](./package.json) (overwriting the properties with the same name there)
|
||||
2. Compile Azure Data Studio as normal and wait for it to finish
|
||||
3. Run `code <PathToAzureDataStudioSource>/extensions/sql-bindings` from the command line to open a new VS Code instance at the `sql-bindings` folder
|
||||
4. Run the `Launch Extension in VS Code` launch target from the `Run and Debug` view
|
||||
5. This should launch an `Extension Development Host` version of VS Code that is running the extension from sources.
|
||||
|
||||
If you have the compilation running as watch then once you make changes you can just reload the window to pick up the latest changes being made.
|
||||
20
extensions/sql-bindings/coverConfig.json
Normal file
20
extensions/sql-bindings/coverConfig.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"enabled": true,
|
||||
"relativeSourcePath": "..",
|
||||
"relativeCoverageDir": "../../coverage",
|
||||
"ignorePatterns": [
|
||||
"**/node_modules/**",
|
||||
"**/test/**",
|
||||
"extension.js"
|
||||
],
|
||||
"reports": [
|
||||
"cobertura",
|
||||
"lcov",
|
||||
"json"
|
||||
],
|
||||
"verbose": false,
|
||||
"remapOptions": {
|
||||
"basePath": "..",
|
||||
"useAbsolutePaths": true
|
||||
}
|
||||
}
|
||||
17
extensions/sql-bindings/extension.webpack.config.js
Normal file
17
extensions/sql-bindings/extension.webpack.config.js
Normal file
@@ -0,0 +1,17 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
//@ts-check
|
||||
|
||||
'use strict';
|
||||
|
||||
const withDefaults = require('../shared.webpack.config');
|
||||
|
||||
module.exports = withDefaults({
|
||||
context: __dirname,
|
||||
entry: {
|
||||
extension: './src/extension.ts'
|
||||
}
|
||||
});
|
||||
32
extensions/sql-bindings/package.json
Normal file
32
extensions/sql-bindings/package.json
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"name": "sql-bindings",
|
||||
"displayName": "%displayName%",
|
||||
"description": "%description%",
|
||||
"version": "0.0.1",
|
||||
"publisher": "Microsoft",
|
||||
"preview": true,
|
||||
"engines": {
|
||||
"vscode": "^1.30.1",
|
||||
"azdata": ">=1.35.0"
|
||||
},
|
||||
"license": "https://raw.githubusercontent.com/Microsoft/azuredatastudio/main/LICENSE.txt",
|
||||
"icon": "",
|
||||
"aiKey": "AIF-37eefaf0-8022-4671-a3fb-64752724682e",
|
||||
"activationEvents": [
|
||||
"*"
|
||||
],
|
||||
"main": "./out/extension",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Microsoft/azuredatastudio.git"
|
||||
},
|
||||
"extensionDependencies": [
|
||||
"Microsoft.mssql"
|
||||
],
|
||||
"capabilities": {
|
||||
"virtualWorkspaces": false,
|
||||
"untrustedWorkspaces": {
|
||||
"supported": true
|
||||
}
|
||||
}
|
||||
}
|
||||
4
extensions/sql-bindings/package.nls.json
Normal file
4
extensions/sql-bindings/package.nls.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"%displayName%": "SQL Bindings",
|
||||
"%description%": "Enables users to develop and publish Azure Functions with Azure SQL bindings"
|
||||
}
|
||||
7
extensions/sql-bindings/package.vscode.json
Normal file
7
extensions/sql-bindings/package.vscode.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "sql-bindings-vscode",
|
||||
"publisher": "ms-mssql",
|
||||
"extensionDependencies": [
|
||||
"ms-mssql.mssql"
|
||||
]
|
||||
}
|
||||
10
extensions/sql-bindings/src/extension.ts
Normal file
10
extensions/sql-bindings/src/extension.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
export function activate(): void {
|
||||
}
|
||||
|
||||
export function deactivate(): void {
|
||||
}
|
||||
15
extensions/sql-bindings/tsconfig.json
Normal file
15
extensions/sql-bindings/tsconfig.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"extends": "../tsconfig.base.json",
|
||||
"compileOnSave": true,
|
||||
"compilerOptions": {
|
||||
"outDir": "./out",
|
||||
"lib": [
|
||||
"es6",
|
||||
"es2015.promise",
|
||||
"dom"
|
||||
]
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
]
|
||||
}
|
||||
4
extensions/sql-bindings/yarn.lock
Normal file
4
extensions/sql-bindings/yarn.lock
Normal file
@@ -0,0 +1,4 @@
|
||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user