Skip to content

Commit c8ecc40

Browse files
committed
repo updates to match main repo
1 parent 8bff8a7 commit c8ecc40

69 files changed

Lines changed: 12932 additions & 12536 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
Tenant to Deploy to:
1+
Tenant to Deploy to:
22

33
# Description
44

55
Please include a description of the new feature/changes/bug fix
66
Please include screenshots if relevant.
77

88
# PR Creation Checklist:
9+
910
- [ ] PR title includes a descriptive title
1011
- [ ] Added a label: `breaking` or `non-breaking`
1112
- [ ] Added a label: `bug-fix`, `new-plugin`, `internal` or `enhancement`

.github/workflows/enforce-labels.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ jobs:
1717
- name: Enforce second set of labels
1818
uses: yogevbd/enforce-label-action@2.2.2
1919
with:
20-
REQUIRED_LABELS_ANY: 'bug-fix,internal,enhancement,new-plugin'
21-
REQUIRED_LABELS_ANY_DESCRIPTION: "Select at least one label ['bug-fix','internal','enhancement','new-plugin']"
20+
REQUIRED_LABELS_ANY: 'bug,new-plugin,enhancement,automated-test,internal'
21+
REQUIRED_LABELS_ANY_DESCRIPTION: "Select at least one label ['bug','new-plugin','enhancement', 'automated-test', 'internal']"

.github/workflows/unit-test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,23 @@ jobs:
2828
$pattern = '(?<=\/[v][0-9]\/).*'
2929
$changes = git diff --name-only origin/main... ./plugins
3030
$pluginsToTest = $changes -replace $pattern | Sort-Object -Unique
31+
$pluginsToTest = $pluginsToTest | Where-Object { Test-Path -PathType Leaf (Join-Path "." $_ "metadata.json") } # Don't try to test deleted plugins
3132
3233
if ( $null -eq $pluginsToTest ) {
3334
Write-Output "Nothing to Test as no changes were found in plugins folder..."
3435
exit 0
3536
}
3637
elseif ( $pluginsToTest.Count -eq 1 ) {
38+
Write-Output "Testing only one Plugin"
3739
$pluginName = ($pluginsToTest.TrimEnd('/')) -replace "plugins/" -replace "/", "-"
38-
Write-Output "Only Testing $pluginsToTest"
39-
npm test -- --ci --path="./$pluginsToTest" --pluginName="$pluginName"
40-
Write-Output "Tested $pluginsToTest"
40+
pnpm run test --ci --path="./$pluginsToTest" --pluginName="$pluginName"
4141
}
4242
else {
4343
Write-Output "Testing $($pluginsToTest.Count) Plugins..."
4444
foreach ( $plugin in $pluginsToTest ) {
4545
Write-Output "Testing $plugin"
4646
$pluginName = ($plugin.TrimEnd('/')) -replace "plugins/" -replace "/", "-"
47-
npm test -- --ci --path="./$plugin" --pluginName="$pluginName"
47+
pnpm run test --ci --path="./$plugin" --pluginName="$pluginName"
4848
Write-Output "Tested $plugin"
4949
}
5050
}

.gitignore

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
.idea/**/contentModel.xml
1818
/plugins/package.json
1919
/plugins/package-lock.json
20+
/plugins/pnpm-workspace.yaml
21+
/plugins/pnpm-lock.yaml
22+
2023

2124
# Sensitive or high-churn files
2225
.idea/**/dataSources/
@@ -501,8 +504,6 @@ PublishScripts/
501504
*.nupkg
502505
# NuGet Symbol Packages
503506
*.snupkg
504-
# The packages folder can be ignored because of Package Restore
505-
**/[Pp]ackages/*
506507
# except build/, which is used as an MSBuild target.
507508
!**/[Pp]ackages/build/
508509
# Uncomment if necessary however generally it will be regenerated when needed
@@ -679,26 +680,28 @@ serverless.yml
679680
wrappedHandler.js
680681
handlerCloud.js
681682
handlerOnPrem.js
683+
graphDump.json
682684

683685
# Test files
684686
testConfig.json
685687
env-testConfig.json
686688
testDatastreamConfig.json
687689
junit.xml
688-
pluginUnitTests/test_output/
690+
**/test_output/
689691
testDatastreamLocally.js
690692
datastream_test_results/
693+
oauth_test_results/
691694
testResults.datastreamResults.json
692695
**/testPluginLocally.js
693696
**/testResults.json
694697
**/importResults.json
695698
**/datastreamResults.json
696-
pluginsIntegrationTestUtils/reports/html/
697-
pluginsIntegrationTestUtils/reports/junit/
698-
pluginsIntegrationTestUtils/configs/env-Config.json
699-
pluginsIntegrationTestUtils/configs/env-testConfig.json
699+
packages/@squaredup/integration-test-utilities/reports/**
700+
env-Config.json
700701
testTargetNodeConfig.json
701702
testDataSourceConfig.json
703+
plugins/**/allure-*/
702704

703705
# CI files
704706
PluginsToUpload/*
707+
PluginsToPackage/*

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node-linker=hoisted
2+
engine-strict=true

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
**/node_modules
22
package*.json
3+
pnpm-lock.yaml

.prettierrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
"singleQuote": true,
55
"tabWidth": 4,
66
"trailingComma": "none",
7-
"endOfLine": "auto"
7+
"endOfLine": "auto",
8+
"plugins": ["prettier-plugin-organize-imports"]
89
}

.vscode/extensions.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
// List of extensions which should be recommended for users of this workspace.
66
"recommendations": [
77
"dbaeumer.vscode-eslint",
8+
"orta.vscode-jest",
89
"esbenp.prettier-vscode",
910
"streetsidesoftware.code-spell-checker"
10-
]
11+
],
12+
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
13+
"unwantedRecommendations": ["amatiasq.sort-imports"]
1114
}

.vscode/settings.json

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,22 @@
33
"prettier.ignorePath": ".prettierignore",
44
"editor.defaultFormatter": "esbenp.prettier-vscode",
55
"prettier.requireConfig": true,
6-
"eslint.workingDirectories": [{ "directory": "." }],
76
"[javascript]": {
87
"editor.defaultFormatter": "esbenp.prettier-vscode"
9-
}
8+
},
9+
"eslint.workingDirectories": [{ "directory": "." }],
10+
"json.schemas": [
11+
{
12+
"fileMatch": [
13+
"**/data_streams.json"
14+
],
15+
"url": "./packages/@squaredup/schema/data_streams.schema.json"
16+
},
17+
{
18+
"fileMatch": [
19+
"**/*.dash.json"
20+
],
21+
"url": "./packages/@squaredup/schema/oob.schema.json"
22+
}
23+
]
1024
}

README.md

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Javascript (NodeJS) is currently the implementation language/runtime with fulles
3636
## Structure of a plugin
3737

3838
A plugin is a directory in this repo of the form `plugins/`_plugin-name_`/v1` containing certain key files:
39+
3940
- `metadata.json` - a file containing high-level information about the plugin (for example: the execution location of the plugin, or the information that appears in the Data Source Gallery, above).
4041
- `ui.json` - a file describing the configuration that must be shown to a user who is in the process of adding the plugin to their tenant to connect with an instance of the back end system.
4142
- `custom_types.json` (Optional) - a file containing information about non-standard object types that will be imported by the plugin into the Data Mesh.
@@ -46,40 +47,70 @@ A plugin is a directory in this repo of the form `plugins/`_plugin-name_`/v1` co
4647

4748
1. **Clone the Repository:**
4849
First, clone the repository to your local machine:
50+
4951
```bash
5052
git clone https://github.com/squaredup/squaredup-plugin-public.git
5153
cd squaredup-plugin-public
5254
```
55+
5356
2. **Create a New Branch:**
5457
You will need to create a new branch for your changes:
58+
5559
```bash
5660
git checkout -b add-new-plugin # Replace Branch Name
5761
```
62+
5863
3. **Creating the Plugin Folder:**
5964
The suggested way to write a new plugin is to make a copy of the `examplePlugins/hybrid/v1` directory in your `plugins/`_plugin-name_`/v1` directory.
65+
6066
```bash
6167
# Replace 'ExamplePlugin' with your plugin name
6268
mkdir -p 'plugins/ExamplePlugin/v1'
6369
cp -r 'examplePlugins/hybrid/v1/*' 'plugins/ExamplePlugin/v1/'
6470
```
71+
6572
4. **Tailoring the Example Plugin:**
6673
You will need to tailor the configuration and code to interact with the specific back end as Required.
6774
This process is described in more detail in [Writing a New Plugin](docs/writingANewPlugin.md).
68-
5. **Testing the Plugin:** There are two main ways to test your plugin.
69-
1. Using the SquaredUp Test/Validation Script (`validate.js` at the root of this repo):
75+
5. **Using `pnpm` to Install Dependencies:**
76+
`pnpm` is used for dependency management instead of `npm`. Check [pnpm](https://pnpm.io/pnpm-cli) to learn more about `pnpm`
77+
Ensure `pnpm` is installed by running `pnpm -version`. If its not installed it can be installed by running the following command:
78+
79+
```bash
80+
npm install --location=global pnpm@9
81+
```
82+
83+
| **Description** | **Command** | **Notes** |
84+
| ------------------------------- | --------------------------- | -------------------------------------- |
85+
| Install all packages | `pnpm i` | e.g. after merging main |
86+
| Install all packages without changing the lockfile | `pnpm fast` | use `pnpm -w fast` if not in root |
87+
| Install packages for certain package only | `pnpm -F "examplehybrid-v1" i` | `examplehybrid-v1` is from `package.json`'s name field |
88+
| Install packages for certain package without changing the lockfile | `pnpm -F "examplehybrid-v1" i --frozen-lockfile` | `examplehybrid-v1` is from `package.json`'s name field |
89+
| Add a package to Azure v1 | `pnpm add myPackage -F "azure-v1"` | `azure-v1` is from `package.json`'s name field |
90+
91+
6. **Testing the Plugin:** There are two main ways to test your plugin.
92+
1. Using the SquaredUp Test/Validation Script (`validate.js` in `scripts\plugins-validator`):
93+
7094
```bash
71-
npm ci
72-
npm run validate
95+
pnpm run -w validate
7396
```
97+
7498
2. Using the SquaredUp Unit Test Framework which can be executed by running:
99+
75100
```bash
76-
npm ci
101+
# If running from the plugins directory
102+
pnpm run unitTest
103+
# If running from the root of the repo
77104
# Replace 'ExamplePlugin' with your plugin name
78-
npm test -- --pluginName="ExamplePlugin" --pluginPath="plugins/ExamplePlugin/v1"
105+
pnpm run test -- --pluginName="ExamplePlugin" --pluginPath="plugins/ExamplePlugin/v1"
106+
# OR
107+
# Replace example-plugin-v1 with name from package.json of the plugin you are interested in
108+
pnpm run -F "example-plugin-v1" unitTest
79109
```
110+
80111
You should aim to do as much testing as possible with the `validate.js` script as the turn-around time is much quicker.
81112
This process is described in more detail in [Testing a Plugin](docs/testingAPlugin.md).
82-
6. **Installation**
113+
7. **Installation**
83114
The plugin is only installed when a Pull Request has been submitted. During PR creation you will be
84115
asked for your Tenant (Organization) Name which can be retrieved from the [settings page](https://app.squaredup.com/settings/organization).
85116
This will be used for restricting the plugin to the specified tenant only.

0 commit comments

Comments
 (0)