Skip to content

Commit e341144

Browse files
FedeMarchiniHotovoaarongoinRichardDzurussudiptatjeupharis
authored
Road to R23 🚀 (#9)
* some cleanup and bringing over hidden files * bringing over the deploy workflow * adding CI/CD workflows * updating to use npm cache instead of yarn * Bringing in Richard's updates! * Some missed cleanup, missing dev dependencies, and fixed build. * hard pinned package versions (#2) * adding husky pre-commit hook for linting * # Feature (4156): P3) Bug with deploying a client function after it a… (#1) * # Feature (4156): P3) Bug with deploying a client function after it as deployed as a server function - Refactoring npm client - Verification added for checking existing function by name and context - color updated * Fixing bug where client was not resolving dependencies correctly * adding missing dependency for testing, and fixing issue where some names in the generated schemas were not being wrapped in quotes * Handling x-poly-refs contained with function arguments that are themselves function types (fixes webhook types and more) * improve logging of failed api function calls (#4) * improve logging of failed api function calls * Update templates/api-index.js.hbs Co-authored-by: Aaron Goin <aarongoin@users.noreply.github.com> * onward --------- Co-authored-by: Aaron Goin <aarongoin@users.noreply.github.com> * P2) (MS) npm client: add direct execute option and MTLS option (#3) * adds direct execute and mtls options support * reversed unintended change * fixed metric names + http agent to be created only once * version increment * lost my logging in code review, lets go agane (#6) * P3) VSCode Extension: Add a Refresh Button to Tree View #4107 (#5) * # Feature (4107): P3) VSCode Extension: Add a Refresh Button to Tree View - load config now can return value - Add or Update config function added * # Feature (4107): P3) VSCode Extension: Add a Refresh Button to Tree View - load config now can return value - Add or Update config function added - Version updated * 4372 update contexts info from terminal (#8) * # Feature (4107): P3) VSCode Extension: Add a Refresh Button to Tree View - load config now can return value - Add or Update config function added - if contexts is empty then it will not save in .config.env --------- Co-authored-by: Aaron Goin <aarongoin@users.noreply.github.com> Co-authored-by: Richard <github.agonize754@passmail.net> Co-authored-by: SudiptaTJ <sudipta.kumar@techjays.com> Co-authored-by: Dan Fellin <dan@polyapi.io>
1 parent 4d531fe commit e341144

Some content is hidden

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

56 files changed

+6625
-6402
lines changed

‎.eslintignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
index.js
2+
index.d.ts

‎.eslintrc.js‎

Lines changed: 267 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,267 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser',
3+
parserOptions: {
4+
project: 'tsconfig.json',
5+
tsconfigRootDir: '.',
6+
sourceType: 'module',
7+
},
8+
plugins: ['@typescript-eslint/eslint-plugin'],
9+
extends: [
10+
'plugin:@typescript-eslint/recommended',
11+
'plugin:prettier/recommended',
12+
],
13+
root: true,
14+
env: {
15+
node: true,
16+
jest: true,
17+
},
18+
ignorePatterns: ['.eslintrc.js', 'scripts/*'],
19+
rules: {
20+
'no-var': 'warn',
21+
'object-shorthand': ['warn', 'properties'],
22+
23+
'accessor-pairs': ['error', { setWithoutGet: true, enforceForClassMembers: true }],
24+
'array-bracket-spacing': ['error', 'never'],
25+
'array-bracket-newline': ['error', { multiline: true }],
26+
'array-callback-return': ['error', {
27+
allowImplicit: false,
28+
checkForEach: false,
29+
}],
30+
'arrow-spacing': ['error', { before: true, after: true }],
31+
'block-spacing': ['error', 'always'],
32+
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
33+
'camelcase': ['error', {
34+
allow: ['^UNSAFE_'],
35+
properties: 'never',
36+
ignoreGlobals: true,
37+
}],
38+
'comma-dangle': ['error', {
39+
arrays: 'always-multiline',
40+
objects: 'always-multiline',
41+
imports: 'always-multiline',
42+
exports: 'always-multiline',
43+
functions: 'always-multiline',
44+
}],
45+
'comma-spacing': ['error', { before: false, after: true }],
46+
'comma-style': ['error', 'last'],
47+
'computed-property-spacing': ['error', 'never', { enforceForClassMembers: true }],
48+
'constructor-super': 'error',
49+
'curly': ['error', 'multi-line'],
50+
'default-case-last': 'error',
51+
'dot-location': ['error', 'property'],
52+
'eol-last': 'error',
53+
'eqeqeq': ['error', 'always', { null: 'ignore' }],
54+
'func-call-spacing': ['error', 'never'],
55+
'func-style': ['error', 'expression', { allowArrowFunctions: true }],
56+
'generator-star-spacing': ['error', { before: true, after: true }],
57+
'indent': ['error', 2, {
58+
SwitchCase: 1,
59+
VariableDeclarator: 1,
60+
outerIIFEBody: 1,
61+
MemberExpression: 1,
62+
FunctionDeclaration: { parameters: 1, body: 1 },
63+
FunctionExpression: { parameters: 1, body: 1 },
64+
CallExpression: { arguments: 1 },
65+
ArrayExpression: 1,
66+
ObjectExpression: 1,
67+
ImportDeclaration: 1,
68+
flatTernaryExpressions: false,
69+
ignoreComments: false,
70+
ignoredNodes: [
71+
'TemplateLiteral *',
72+
'JSXElement',
73+
'JSXElement > *',
74+
'JSXAttribute',
75+
'JSXIdentifier',
76+
'JSXNamespacedName',
77+
'JSXMemberExpression',
78+
'JSXSpreadAttribute',
79+
'JSXExpressionContainer',
80+
'JSXOpeningElement',
81+
'JSXClosingElement',
82+
'JSXFragment',
83+
'JSXOpeningFragment',
84+
'JSXClosingFragment',
85+
'JSXText',
86+
'JSXEmptyExpression',
87+
'JSXSpreadChild',
88+
'PropertyDefinition[decorators]'
89+
],
90+
offsetTernaryExpressions: true,
91+
}],
92+
'key-spacing': ['error', { beforeColon: false, afterColon: true }],
93+
'keyword-spacing': ['error', { before: true, after: true }],
94+
'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],
95+
'multiline-ternary': ['error', 'always-multiline'],
96+
'new-cap': ['error', { newIsCap: true, capIsNew: false, properties: true }],
97+
'new-parens': 'error',
98+
'no-array-constructor': 'error',
99+
'no-async-promise-executor': 'error',
100+
'no-caller': 'error',
101+
'no-case-declarations': 'error',
102+
'no-class-assign': 'error',
103+
'no-compare-neg-zero': 'error',
104+
'no-cond-assign': 'error',
105+
'no-const-assign': 'error',
106+
'no-constant-condition': ['error', { checkLoops: false }],
107+
'no-control-regex': 'error',
108+
'no-debugger': 'error',
109+
'no-delete-var': 'error',
110+
'no-dupe-args': 'error',
111+
'no-dupe-class-members': 'error',
112+
'no-dupe-keys': 'error',
113+
'no-duplicate-case': 'error',
114+
'no-useless-backreference': 'error',
115+
'no-empty': ['error', { allowEmptyCatch: true }],
116+
'no-empty-character-class': 'error',
117+
'no-empty-pattern': 'error',
118+
'no-eval': 'error',
119+
'no-ex-assign': 'error',
120+
'no-extend-native': 'error',
121+
'no-extra-bind': 'error',
122+
'no-extra-boolean-cast': 'error',
123+
'no-extra-parens': ['error', 'functions'],
124+
'no-fallthrough': 'error',
125+
'no-floating-decimal': 'error',
126+
'no-func-assign': 'error',
127+
'no-global-assign': 'error',
128+
'no-implied-eval': 'error',
129+
'no-import-assign': 'error',
130+
'no-invalid-regexp': 'error',
131+
'no-irregular-whitespace': 'error',
132+
'no-iterator': 'error',
133+
'no-labels': ['error', { allowLoop: false, allowSwitch: false }],
134+
'no-lone-blocks': 'error',
135+
'no-loss-of-precision': 'error',
136+
'no-misleading-character-class': 'error',
137+
'no-useless-catch': 'error',
138+
'no-mixed-operators': ['error', {
139+
groups: [
140+
['==', '!=', '===', '!==', '>', '>=', '<', '<='],
141+
['&&', '||'],
142+
['in', 'instanceof'],
143+
],
144+
allowSamePrecedence: true,
145+
}],
146+
'no-mixed-spaces-and-tabs': 'error',
147+
'no-multi-spaces': 'error',
148+
'no-multi-str': 'error',
149+
'no-multiple-empty-lines': ['error', { max: 1, maxBOF: 0, maxEOF: 0 }],
150+
'no-new': 'error',
151+
'no-new-func': 'error',
152+
'no-new-object': 'error',
153+
'no-new-symbol': 'error',
154+
'no-new-wrappers': 'error',
155+
'no-obj-calls': 'error',
156+
'no-octal': 'error',
157+
'no-octal-escape': 'error',
158+
'no-proto': 'error',
159+
'no-redeclare': ['error', { builtinGlobals: false }],
160+
'no-regex-spaces': 'error',
161+
'no-return-assign': ['error', 'except-parens'],
162+
'no-self-assign': ['error', { props: true }],
163+
'no-self-compare': 'error',
164+
'no-sequences': 'error',
165+
'no-shadow-restricted-names': 'error',
166+
'no-sparse-arrays': 'error',
167+
'no-tabs': 'error',
168+
'no-template-curly-in-string': 'error',
169+
'no-this-before-super': 'error',
170+
'no-throw-literal': 'error',
171+
'no-trailing-spaces': 'error',
172+
'no-undef': 'error',
173+
'no-undef-init': 'error',
174+
'no-unexpected-multiline': 'error',
175+
'no-unmodified-loop-condition': 'error',
176+
'no-unneeded-ternary': ['error', { defaultAssignment: false }],
177+
'no-unreachable': 'error',
178+
'no-unreachable-loop': 'error',
179+
'no-unsafe-finally': 'error',
180+
'no-unsafe-negation': 'error',
181+
'no-unused-expressions': ['error', {
182+
allowShortCircuit: true,
183+
allowTernary: true,
184+
allowTaggedTemplates: true,
185+
}],
186+
'no-unused-vars': ['error', {
187+
args: 'none',
188+
caughtErrors: 'none',
189+
ignoreRestSiblings: true,
190+
vars: 'all',
191+
}],
192+
'no-useless-call': 'error',
193+
'no-useless-computed-key': 'error',
194+
'no-useless-rename': 'error',
195+
'no-useless-return': 'error',
196+
'no-void': ['error', { allowAsStatement: true }],
197+
'no-whitespace-before-property': 'error',
198+
'no-with': 'error',
199+
'object-curly-newline': ['error', { multiline: true, consistent: true }],
200+
'object-curly-spacing': ['error', 'always'],
201+
'object-property-newline': ['error', { allowMultiplePropertiesPerLine: true }],
202+
'one-var': ['error', { initialized: 'never' }],
203+
'operator-linebreak': ['error', 'after', { overrides: { '?': 'before', ':': 'before', '|>': 'before' } }],
204+
'padded-blocks': ['error', { blocks: 'never', switches: 'never', classes: 'never' }],
205+
'prefer-const': ['error', { destructuring: 'all' }],
206+
'prefer-promise-reject-errors': 'error',
207+
'prefer-regex-literals': ['error', { disallowRedundantWrapping: true }],
208+
'quote-props': ['error', 'as-needed'],
209+
'quotes': ['error', 'single', { avoidEscape: true, allowTemplateLiterals: false }],
210+
'rest-spread-spacing': ['error', 'never'],
211+
'semi': ['error', 'always'],
212+
'semi-spacing': ['error', { before: false, after: true }],
213+
'space-before-blocks': ['error', 'always'],
214+
'space-before-function-paren': ['error', {
215+
'anonymous': 'always',
216+
'named': 'never',
217+
'asyncArrow': 'always',
218+
}],
219+
'space-in-parens': ['error', 'never'],
220+
'space-infix-ops': 'error',
221+
'space-unary-ops': ['error', { words: true, nonwords: false }],
222+
'spaced-comment': ['error', 'always', {
223+
line: { markers: ['*package', '!', '/', ',', '='] },
224+
block: { balanced: true, markers: ['*package', '!', ',', ':', '::', 'flow-include'], exceptions: ['*'] },
225+
}],
226+
'symbol-description': 'error',
227+
'template-curly-spacing': ['error', 'never'],
228+
'template-tag-spacing': ['error', 'never'],
229+
'unicode-bom': ['error', 'never'],
230+
'use-isnan': ['error', {
231+
enforceForSwitchCase: true,
232+
enforceForIndexOf: true,
233+
}],
234+
'valid-typeof': ['error', { requireStringLiterals: true }],
235+
'wrap-iife': ['error', 'any', { functionPrototypeMethods: true }],
236+
'yield-star-spacing': ['error', 'both'],
237+
238+
'@typescript-eslint/interface-name-prefix': 'off',
239+
'@typescript-eslint/explicit-function-return-type': 'off',
240+
'@typescript-eslint/explicit-module-boundary-types': 'off',
241+
'@typescript-eslint/no-explicit-any': 'off',
242+
'@typescript-eslint/no-non-null-assertion': 'off',
243+
'@typescript-eslint/no-unused-vars': 'error',
244+
'prettier/prettier': [
245+
0,
246+
{
247+
'endOfLine': 'auto',
248+
},
249+
],
250+
"@typescript-eslint/naming-convention": [
251+
"error",
252+
{
253+
"selector": [
254+
"classProperty",
255+
"typeProperty",
256+
"classMethod",
257+
"objectLiteralMethod",
258+
"typeMethod",
259+
"accessor",
260+
"enumMember"
261+
],
262+
"format": ["strictCamelCase"],
263+
"modifiers": ["requiresQuotes"]
264+
}
265+
]
266+
},
267+
};
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Docker Image & NPM publish CI/CD
2+
on:
3+
push:
4+
branches:
5+
- develop
6+
7+
jobs:
8+
develop:
9+
name: Build and deploy NPM package.
10+
runs-on: ubuntu-latest
11+
environment: dev
12+
permissions:
13+
contents: read
14+
packages: write
15+
16+
if: ${{ github.ref == 'refs/heads/develop' }}
17+
18+
env:
19+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
20+
21+
steps:
22+
- uses: actions/checkout@v3
23+
24+
- name: Setup Node
25+
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # 4.0.2
26+
with:
27+
node-version: '20'
28+
registry-url: 'https://registry.npmjs.org'
29+
cache: 'npm'
30+
31+
- uses: dorny/paths-filter@v2
32+
id: changes
33+
with:
34+
filters: |
35+
client:
36+
- 'package.json'
37+
38+
- if: steps.changes.outputs.client == 'true'
39+
name: Publish package
40+
run: |
41+
VERSION=$(node -p "require('./package.json').version")
42+
echo $VERSION
43+
REMOTEVERSION=$(npm view polyapi --json | jq -r '.["dist-tags"].develop')
44+
echo $REMOTEVERSION
45+
46+
if [[ "$VERSION" == "$REMOTEVERSION" ]]; then
47+
echo "Local NPM version is the same as remote"
48+
else
49+
npm install --include=dev
50+
npm publish --tag develop
51+
fi

0 commit comments

Comments
 (0)