@friggframework/devtools 1.1.1-canary.290.235af37.0 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/index.js +2 -6
  3. package/package.json +7 -8
  4. package/test/index.js +11 -0
  5. package/{test-environment → test}/mock-api.js +1 -1
  6. package/eslint-config/CHANGELOG.md +0 -17
  7. package/eslint-config/README.md +0 -3
  8. package/eslint-config/bump3.txt +0 -0
  9. package/eslint-config/index.js +0 -38
  10. package/prettier-config/.eslintrc.json +0 -3
  11. package/prettier-config/CHANGELOG.md +0 -17
  12. package/prettier-config/LICENSE.md +0 -9
  13. package/prettier-config/README.md +0 -3
  14. package/prettier-config/bump3.txt +0 -0
  15. package/prettier-config/index.js +0 -6
  16. package/test-environment/.eslintrc.json +0 -3
  17. package/test-environment/Authenticator.js +0 -74
  18. package/test-environment/LICENSE.md +0 -9
  19. package/test-environment/bump3.txt +0 -0
  20. package/test-environment/index.js +0 -24
  21. package/test-environment/jest-global-setup.js +0 -6
  22. package/test-environment/jest-global-teardown.js +0 -3
  23. package/test-environment/jest-preset.js +0 -14
  24. package/test-environment/mongodb.js +0 -22
  25. package/test-environment/override-environment.js +0 -11
  26. /package/{eslint-config/.eslintrc.json → .eslintrc.json} +0 -0
  27. /package/{test-environment → test}/CHANGELOG.md +0 -0
  28. /package/{eslint-config → test}/LICENSE.md +0 -0
  29. /package/{test-environment → test}/README.md +0 -0
  30. /package/{test-environment → test}/auther-definition-method-tester.js +0 -0
  31. /package/{test-environment → test}/auther-definition-tester.js +0 -0
  32. /package/{test-environment → test}/integration-validator.js +0 -0
  33. /package/{test-environment → test}/mock-api-readme.md +0 -0
  34. /package/{test-environment → test}/mock-integration.js +0 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,35 @@
1
+ # v2.0.0 (Sat Mar 30 2024)
2
+
3
+ #### 💥 Breaking Change
4
+
5
+ - revert HEAD to a corrected v1-connectwise release [#283](https://github.com/friggframework/frigg/pull/283) ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
6
+
7
+ #### 🚀 Enhancement
8
+
9
+ - Package redo [#294](https://github.com/friggframework/frigg/pull/294) ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
10
+
11
+ #### 🐛 Bug Fix
12
+
13
+ - delete all node_modules and regenerate lock file to potentially address known bug ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
14
+ - add back the direct dependency on eslint as this might be leading to a deploy issue ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
15
+ - create test, eslint-config and prettier-config packages as base shared dependencies ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
16
+ - slight fix to mock integration module instantiation [#290](https://github.com/friggframework/frigg/pull/290) ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
17
+ - slight fix to mock integration module instantiation ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
18
+ - Publish ([@seanspeaks](https://github.com/seanspeaks))
19
+ - Bump node and npm version for the whole repo (Fix CI) [#274](https://github.com/friggframework/frigg/pull/274) ([@seanspeaks](https://github.com/seanspeaks))
20
+ - Revert main to last release [#284](https://github.com/friggframework/frigg/pull/284) ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
21
+ - Revert "set test environment STAGE to dev" ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
22
+ - Add stage to test env [#282](https://github.com/friggframework/frigg/pull/282) ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
23
+ - set test environment STAGE to dev ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
24
+ - Bump independent versions \[skip ci\] ([@seanspeaks](https://github.com/seanspeaks))
25
+
26
+ #### Authors: 2
27
+
28
+ - [@MichaelRyanWebber](https://github.com/MichaelRyanWebber)
29
+ - Sean Matthews ([@seanspeaks](https://github.com/seanspeaks))
30
+
31
+ ---
32
+
1
33
  # v1.1.0 (Wed Mar 20 2024)
2
34
 
3
35
  #### 🚀 Enhancement
package/index.js CHANGED
@@ -1,9 +1,5 @@
1
- const eslintConfig = require('./eslint-config')
2
- const prettierConfig = require('./prettier-config')
3
- const testEnvironment = require('./test-environment/index');
1
+ const test = require('./test');
4
2
 
5
3
  module.exports = {
6
- eslintConfig,
7
- prettierConfig,
8
- ...testEnvironment
4
+ ...test
9
5
  }
package/package.json CHANGED
@@ -1,22 +1,21 @@
1
1
  {
2
2
  "name": "@friggframework/devtools",
3
3
  "prettier": "@friggframework/prettier-config",
4
- "version": "1.1.1-canary.290.235af37.0",
4
+ "version": "1.1.2",
5
5
  "dependencies": {
6
6
  "@babel/eslint-parser": "^7.18.9",
7
- "@friggframework/core": "1.1.1-canary.290.235af37.0",
7
+ "@friggframework/core": "^1.1.2",
8
+ "@friggframework/test": "^1.1.2",
8
9
  "eslint": "^8.22.0",
9
10
  "eslint-config-prettier": "^8.5.0",
10
11
  "eslint-plugin-json": "^3.1.0",
11
12
  "eslint-plugin-markdown": "^3.0.0",
12
13
  "eslint-plugin-no-only-tests": "^3.0.0",
13
- "eslint-plugin-yaml": "^0.5.0",
14
- "jest-runner-groups": "^2.2.0",
15
- "mongodb-memory-server": "^8.9.0"
14
+ "eslint-plugin-yaml": "^0.5.0"
16
15
  },
17
16
  "devDependencies": {
18
- "jest": "^28.1.3",
19
- "prettier": "^2.7.1"
17
+ "@friggframework/eslint-config": "^1.1.2",
18
+ "@friggframework/prettier-config": "^1.1.2"
20
19
  },
21
20
  "scripts": {
22
21
  "lint:fix": "prettier --write --loglevel error . && eslint . --fix",
@@ -37,5 +36,5 @@
37
36
  "publishConfig": {
38
37
  "access": "public"
39
38
  },
40
- "gitHead": "235af376318b3ef47b887619aa0f5619a80f1b7a"
39
+ "gitHead": "5fc6ed2784d179402b458164b5b054b7b7140971"
41
40
  }
package/test/index.js ADDED
@@ -0,0 +1,11 @@
1
+ const {testDefinitionRequiredAuthMethods} = require('./auther-definition-method-tester');
2
+ const {createMockIntegration, createMockApiObject} = require('./mock-integration');
3
+ const { testAutherDefinition } = require('./auther-definition-tester');
4
+
5
+
6
+ module.exports = {
7
+ createMockIntegration,
8
+ createMockApiObject,
9
+ testDefinitionRequiredAuthMethods,
10
+ testAutherDefinition,
11
+ };
@@ -1,5 +1,5 @@
1
1
  const nock = require('nock');
2
- const Authenticator = require('./Authenticator');
2
+ const { Authenticator } = require('@friggframework/test');
3
3
  const { join: joinPath } = require('path');
4
4
  const { parse: parseUrl } = require('url');
5
5
  const { mkdir, readFile, rename, rm, writeFile } = require('fs/promises');
@@ -1,17 +0,0 @@
1
- # v1.0.8 (Mon Jan 09 2023)
2
-
3
- #### 🐛 Bug Fix
4
-
5
- - Merge remote-tracking branch 'origin/main' into gitbook-updates [#48](https://github.com/friggframework/frigg/pull/48) ([@seanspeaks](https://github.com/seanspeaks))
6
- - Bump independent versions \[skip ci\] ([@seanspeaks](https://github.com/seanspeaks))
7
- - Merge remote-tracking branch 'origin/main' into simplify-mongoose-models ([@seanspeaks](https://github.com/seanspeaks))
8
- - Add READMEs for all packages and api-modules [#20](https://github.com/friggframework/frigg/pull/20) ([@seanspeaks](https://github.com/seanspeaks))
9
- - Add READMEs for all packages and api-modules ([@seanspeaks](https://github.com/seanspeaks))
10
-
11
- #### ⚠️ Pushed to `main`
12
-
13
- - Refactored for more conventional naming (at least for packages) ([@seanspeaks](https://github.com/seanspeaks))
14
-
15
- #### Authors: 1
16
-
17
- - Sean Matthews ([@seanspeaks](https://github.com/seanspeaks))
@@ -1,3 +0,0 @@
1
- # eslint-config
2
-
3
- This package exports the default `eslint-config` settings used in [Frigg](https://friggframework.org). You can find its documentation [on Frigg's website](https://docs.friggframework.org/packages/eslint-config).
File without changes
@@ -1,38 +0,0 @@
1
- module.exports = {
2
- env: {
3
- commonjs: true,
4
- es2020: true,
5
- jest: true,
6
- },
7
- extends: ['prettier', 'plugin:markdown/recommended'],
8
- parser: '@babel/eslint-parser',
9
- parserOptions: {
10
- ecmaVersion: 11,
11
- requireConfigFile: false,
12
- },
13
- plugins: ['no-only-tests'],
14
- ignorePatterns: ['coverage/', '.nyc_output/'],
15
- overrides: [
16
- {
17
- files: ['*.json'],
18
- plugins: ['json'],
19
- extends: ['plugin:json/recommended'],
20
- },
21
- {
22
- files: ['*.yaml', '*.yml'],
23
- plugins: ['yaml'],
24
- extends: ['plugin:yaml/recommended'],
25
- },
26
- ],
27
- rules: {
28
- 'no-only-tests/no-only-tests': ['error', { fix: false }],
29
- 'no-unused-vars': [
30
- 'warn',
31
- { vars: 'all', args: 'after-used', ignoreRestSiblings: false },
32
- ],
33
- 'no-console': ['warn'],
34
- camelcase: ['warn'],
35
- 'no-mixed-requires': ['warn'],
36
- 'no-warning-comments': ['warn'],
37
- },
38
- };
@@ -1,3 +0,0 @@
1
- {
2
- "extends": "@friggframework/eslint-config"
3
- }
@@ -1,17 +0,0 @@
1
- # v1.0.6 (Mon Jan 09 2023)
2
-
3
- #### 🐛 Bug Fix
4
-
5
- - Merge remote-tracking branch 'origin/main' into gitbook-updates [#48](https://github.com/friggframework/frigg/pull/48) ([@seanspeaks](https://github.com/seanspeaks))
6
- - Bump independent versions \[skip ci\] ([@seanspeaks](https://github.com/seanspeaks))
7
- - Merge remote-tracking branch 'origin/main' into simplify-mongoose-models ([@seanspeaks](https://github.com/seanspeaks))
8
- - Add READMEs for all packages and api-modules [#20](https://github.com/friggframework/frigg/pull/20) ([@seanspeaks](https://github.com/seanspeaks))
9
- - Add READMEs for all packages and api-modules ([@seanspeaks](https://github.com/seanspeaks))
10
-
11
- #### ⚠️ Pushed to `main`
12
-
13
- - Refactored for more conventional naming (at least for packages) ([@seanspeaks](https://github.com/seanspeaks))
14
-
15
- #### Authors: 1
16
-
17
- - Sean Matthews ([@seanspeaks](https://github.com/seanspeaks))
@@ -1,9 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 Left Hook Inc.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
-
7
- The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
8
-
9
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,3 +0,0 @@
1
- # prettier-config
2
-
3
- This package exports the `prettier-config` default used in [Frigg](https://friggframework.org). You can find its documentation [on Frigg's website](https://docs.friggframework.org/packages/prettier-config).
File without changes
@@ -1,6 +0,0 @@
1
- module.exports = {
2
- semi: true,
3
- tabWidth: 4,
4
- singleQuote: true,
5
- useTabs: false,
6
- };
@@ -1,3 +0,0 @@
1
- {
2
- "extends": "@friggframework/eslint-config"
3
- }
@@ -1,74 +0,0 @@
1
- // "use strict";
2
- const http = require('http');
3
- const url = require('url');
4
- const open = require('open');
5
-
6
- class Authenticator {
7
- static searchParamsToDictionary(params) {
8
- const entries = params.entries();
9
- const result = {};
10
- for (const entry of entries) {
11
- const [key, value] = entry;
12
- result[key] = value;
13
- }
14
- return result;
15
- }
16
-
17
- static async oauth2(authorizeUrl, port = 3000, browserName = undefined) {
18
- return new Promise((resolve, reject) => {
19
- const server = http
20
- .createServer(async (req, res) => {
21
- try {
22
- const qs = new url.URL(
23
- req.url,
24
- `http://localhost:${port}`
25
- ).searchParams;
26
-
27
- // gets the last parameter in the slash
28
- const urlPostfix = req.url.split('?')[0];
29
-
30
- const params =
31
- Authenticator.searchParamsToDictionary(qs);
32
-
33
- res.end(
34
- `<h1 style="position: absolute;top: 50%;left: 50%;transform: translate(-50%, -50%);">Feel free to close the Brow Brow now</h1>
35
- <style>@media (prefers-color-scheme: dark) {
36
- body {
37
- color: #b0b0b0;
38
- background-color: #101010;
39
- }
40
- </style>`
41
- );
42
- server.close();
43
- resolve({
44
- base: urlPostfix,
45
- data: params,
46
- });
47
- } catch (e) {
48
- reject(e);
49
- }
50
- })
51
- .listen(port, () => {
52
- const options = browserName ? {app: {name: browserName }} : undefined
53
- // open the browser to the authorize url to start the workflow
54
- open(authorizeUrl, options).then((childProcess) => {
55
- childProcess.unref();
56
- clearTimeout(timeoutId);
57
- });
58
- });
59
-
60
- const timeoutId = setTimeout(() => {
61
- if (server.listening) {
62
- try {
63
- server.close();
64
- } finally {
65
- throw new Error(
66
- 'Authenticator timed out before authentication completed in the browser.'
67
- );
68
- }
69
- }
70
- }, 59_000);
71
- });
72
- }
73
- }
74
- module.exports = Authenticator;
@@ -1,9 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 Left Hook Inc.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
-
7
- The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
8
-
9
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
File without changes
@@ -1,24 +0,0 @@
1
- const { TestMongo } = require('./mongodb');
2
- const {
3
- overrideEnvironment,
4
- restoreEnvironment,
5
- } = require('./override-environment');
6
- const globalTeardown = require('./jest-global-teardown');
7
- const globalSetup = require('./jest-global-setup');
8
- const {testDefinitionRequiredAuthMethods} = require('./auther-definition-method-tester');
9
- const {createMockIntegration, createMockApiObject} = require('./mock-integration');
10
- const { testAutherDefinition } = require('./auther-definition-tester');
11
- const Authenticator = require('./Authenticator')
12
-
13
- module.exports = {
14
- TestMongo,
15
- overrideEnvironment,
16
- restoreEnvironment,
17
- globalTeardown,
18
- globalSetup,
19
- createMockIntegration,
20
- createMockApiObject,
21
- testDefinitionRequiredAuthMethods,
22
- testAutherDefinition,
23
- Authenticator
24
- };
@@ -1,6 +0,0 @@
1
- const { TestMongo } = require('./mongodb');
2
-
3
- module.exports = async function () {
4
- global.testMongo = new TestMongo();
5
- await global.testMongo.start();
6
- };
@@ -1,3 +0,0 @@
1
- module.exports = async function () {
2
- await global.testMongo.stop();
3
- };
@@ -1,14 +0,0 @@
1
- module.exports = {
2
- collectCoverage: true,
3
- testTimeout: 20_000,
4
- runner: 'groups',
5
- coverageReporters: ['text'],
6
- coverageThreshold: {
7
- global: {
8
- statements: 80,
9
- branches: 80,
10
- functions: 80,
11
- lines: 80,
12
- },
13
- },
14
- };
@@ -1,22 +0,0 @@
1
- const { MongoMemoryServer } = require('mongodb-memory-server');
2
-
3
- class TestMongo {
4
- #mongoServer;
5
-
6
- // Start the in-memory mongo instance and set env variable for the app to use in its connection.
7
- async start() {
8
- this.#mongoServer = await MongoMemoryServer.create();
9
- process.env.MONGO_URI = this.#mongoServer.getUri();
10
- console.log('Started in memory mongo server', process.env.MONGO_URI);
11
- }
12
-
13
- async stop() {
14
- await this.#mongoServer.stop();
15
- process.env.MONGO_URI = undefined;
16
- this.#mongoServer = undefined;
17
- }
18
- }
19
-
20
- module.exports = {
21
- TestMongo,
22
- };
@@ -1,11 +0,0 @@
1
- const originalEnv = process.env;
2
-
3
- function overrideEnvironment(overrideByKey) {
4
- process.env = { ...process.env, ...overrideByKey };
5
- }
6
-
7
- function restoreEnvironment() {
8
- process.env = originalEnv;
9
- }
10
-
11
- module.exports = { overrideEnvironment, restoreEnvironment };
File without changes
File without changes
File without changes
File without changes
File without changes