@frontegg/entitlements-javascript-commons 1.0.0-alpha.1

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.
package/.eslintignore ADDED
@@ -0,0 +1,6 @@
1
+ node_modules
2
+ dist
3
+ jest.config.js
4
+ tests
5
+ src/**/*.spec.ts
6
+ src/middlewares/*
package/.eslintrc.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "env": {
3
+ "browser": true,
4
+ "es2021": true
5
+ },
6
+ "extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"],
7
+ "parser": "@typescript-eslint/parser",
8
+ "parserOptions": {
9
+ "ecmaVersion": "latest",
10
+ "sourceType": "module"
11
+ },
12
+ "plugins": ["@typescript-eslint"],
13
+ "rules": {
14
+ "@typescript-eslint/no-explicit-any": ["error"]
15
+ }
16
+ }
@@ -0,0 +1,5 @@
1
+ # Lines starting with '#' are comments.
2
+ # Each line is a file pattern followed by one or more owners.
3
+
4
+ # These owners will be the default owners for everything in the repo.
5
+ * eran.kricheli@frontegg.com
@@ -0,0 +1,28 @@
1
+ name: Build & Test
2
+
3
+ on: workflow_call
4
+
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+
9
+ strategy:
10
+ matrix:
11
+ node-version: [14.x, 16.x, 17.x, 18.x]
12
+
13
+ steps:
14
+ - uses: actions/checkout@v3
15
+ - name: Use Node.js ${{ matrix.node-version }}
16
+ uses: actions/setup-node@v3
17
+ with:
18
+ node-version: ${{ matrix.node-version }}
19
+ cache: 'npm'
20
+
21
+ - name: Install dependencies
22
+ run: npm ci
23
+
24
+ - name: Build the lib
25
+ run: npm run build
26
+
27
+ - name: Run tests
28
+ run: npm run test:coverage
@@ -0,0 +1,21 @@
1
+ name: Lint
2
+
3
+ on: workflow_call
4
+
5
+ jobs:
6
+ lint:
7
+ runs-on: ubuntu-latest
8
+ steps:
9
+ - uses: actions/checkout@v3
10
+ - uses: actions/setup-node@v3
11
+ with:
12
+ node-version: 16
13
+ cache: 'npm'
14
+
15
+ - name: Install Dependencies
16
+ env:
17
+ CI: true
18
+ run: "npm ci"
19
+
20
+ - name: Run Eslint
21
+ run: npm run lint
@@ -0,0 +1,29 @@
1
+ name: Pre Release
2
+
3
+ on: workflow_call
4
+
5
+ jobs:
6
+ pre_release:
7
+ runs-on: ubuntu-latest
8
+ steps:
9
+ - uses: actions/checkout@v3
10
+
11
+ - uses: actions/setup-node@v3
12
+ with:
13
+ node-version: 18
14
+
15
+ - name: Install Dependencies
16
+ env:
17
+ CI: true
18
+ run: "npm ci"
19
+
20
+ - name: Test Release
21
+ env:
22
+ CI: true
23
+ GH_TOKEN: ${{ secrets.GH_ADMIN_REPO_TOKEN }}
24
+ GITHUB_HEAD_REF: $GITHUB_HEAD_REF
25
+ GITHUB_TOKEN: ${{ secrets.GH_ADMIN_REPO_TOKEN }}
26
+ NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
27
+ run: |
28
+ echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > /home/runner/work/_temp/.npmrc
29
+ npx semantic-release --dry-run --debug -b $GITHUB_HEAD_REF
@@ -0,0 +1,22 @@
1
+ name: On Pull Request
2
+
3
+ on:
4
+ pull_request:
5
+ types:
6
+ - opened
7
+ - synchronize
8
+ - reopened
9
+ - ready_for_review
10
+ branches: [ master, next ]
11
+
12
+ jobs:
13
+ call-lint:
14
+ uses: ./.github/workflows/_lint.yaml
15
+
16
+ call-build-and-test:
17
+ needs: call-lint
18
+ uses: ./.github/workflows/_build-and-test.yaml
19
+
20
+ call-pre-release:
21
+ needs: call-build-and-test
22
+ uses: ./.github/workflows/_pre-release.yaml
@@ -0,0 +1,45 @@
1
+ name: Publish
2
+
3
+ on:
4
+ push:
5
+ branches: [ master, ci ]
6
+
7
+ env:
8
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9
+ NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
10
+
11
+ permissions:
12
+ contents: write
13
+ issues: write
14
+ pull-requests: write
15
+
16
+ jobs:
17
+ publish:
18
+ name: Publish
19
+ runs-on: ubuntu-latest
20
+ steps:
21
+ - uses: actions/checkout@v3
22
+ with:
23
+ token: ${{ secrets.GITHUB_TOKEN }}
24
+ - name: Set git config
25
+ run: |
26
+ git config --global user.name "${{ github.actor }}"
27
+ git config --global user.email "${{ github.event.pusher.email }}"
28
+ env:
29
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30
+ - name: Use Node.js 18
31
+ uses: actions/setup-node@v3
32
+ with:
33
+ node-version: '18'
34
+ cache: 'npm'
35
+
36
+ - name: Install
37
+ if: steps.cache-modules.outputs.cache-hit != 'true'
38
+ run: npm install
39
+
40
+ - name: Build
41
+ if: steps.cache-modules.outputs.cache-hit != 'true'
42
+ run: npm run build
43
+
44
+ - name: Semantic Release
45
+ run: npx semantic-release
@@ -0,0 +1,7 @@
1
+ dist/
2
+
3
+ # Dependency directories
4
+ node_modules/
5
+
6
+ #ide
7
+ .idea/
package/.prettierrc ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "semi": true,
3
+ "singleQuote": true,
4
+ "arrowParens": "always",
5
+ "trailingComma": "all",
6
+ "printWidth": 120,
7
+ "tabWidth": 2
8
+ }
@@ -0,0 +1,78 @@
1
+ branches:
2
+ - master
3
+ - name: ci
4
+ prerelease: 'alpha'
5
+ tagFormat: "${version}"
6
+ ci: true
7
+ preset: "angular"
8
+ plugins:
9
+ - "@semantic-release/commit-analyzer"
10
+ - "@semantic-release/release-notes-generator"
11
+ - "@semantic-release/changelog"
12
+ - "@semantic-release/npm"
13
+ - "@semantic-release/git"
14
+ - "@semantic-release/github"
15
+
16
+ verifyConditions:
17
+ - "@semantic-release/git"
18
+ - "@semantic-release/github"
19
+
20
+ analyzeCommits:
21
+ - path: "@semantic-release/commit-analyzer"
22
+ releaseRules:
23
+ - type: "patch"
24
+ release: "patch"
25
+ - type: "minor"
26
+ release: "minor"
27
+ - type: "breaking"
28
+ release: "major"
29
+
30
+ generateNotes:
31
+ - path: "@semantic-release/release-notes-generator"
32
+ writerOpts:
33
+ groupBy: "type"
34
+ commitGroupsSort:
35
+ - "feat"
36
+ - "perf"
37
+ - "fix"
38
+ commitsSort: "header"
39
+ types:
40
+ - type: "feat"
41
+ - section: "Features"
42
+ # Tracked bug fix with a hotfix branch
43
+ - type: "hotfix"
44
+ - section: "Bug Fixes"
45
+ # Unimportant fix (CI testing, etc)
46
+ - type: "fix"
47
+ - hidden: true
48
+ - type: "chore"
49
+ - hidden: true
50
+ - type: "docs"
51
+ - hidden: true
52
+ - type: "doc"
53
+ - hidden: true
54
+ - type: "style"
55
+ - hidden: true
56
+ - type: "refactor"
57
+ - hidden: true
58
+ - type: "perf"
59
+ - hidden: true
60
+ - type: "test"
61
+ - hidden: true
62
+ presetConfig: true
63
+
64
+ prepare:
65
+ - path: "@semantic-release/changelog"
66
+ changelogFile: "docs/CHANGELOG.md"
67
+ - path: "@semantic-release/git"
68
+ assets: ["docs/CHANGELOG.md"]
69
+
70
+ publish:
71
+ - path: "@semantic-release/npm"
72
+ - path: "@semantic-release/github"
73
+
74
+ success:
75
+ - "@semantic-release/github"
76
+
77
+ fail:
78
+ - "@semantic-release/github"
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Frontegg
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ export declare const evaluateFeatureFlag: () => boolean;
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.evaluateFeatureFlag = void 0;
4
+ const evaluateFeatureFlag = () => {
5
+ return false;
6
+ };
7
+ exports.evaluateFeatureFlag = evaluateFeatureFlag;
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAO,MAAM,mBAAmB,GAAG,GAAY,EAAE;IAC/C,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAFW,QAAA,mBAAmB,uBAE9B"}
@@ -0,0 +1,6 @@
1
+ # 1.0.0-alpha.1 (2023-10-03)
2
+
3
+
4
+ ### Features
5
+
6
+ * create pipeline and release infra ([16fd6d1](https://github.com/frontegg/entitlements-javascript-commons/commit/16fd6d165cff4c3ae28e2392db2480d41dd591b1))
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@frontegg/entitlements-javascript-commons",
3
+ "version": "1.0.0-alpha.1",
4
+ "description": "",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "scripts": {
8
+ "build": "rm -rf dist && tsc",
9
+ "build:watch": "rm -rf dist && tsc --watch",
10
+ "lint": "eslint --ignore-path .eslintignore --ext .js,.ts .",
11
+ "format": "prettier --write \"**/*.+(js|ts|json)\"",
12
+ "test": "npm run build && jest",
13
+ "test:coverage": "npm test -- --coverage",
14
+ "test:watch": "npm run build && jest --watch",
15
+ "dev": "tsc --watch"
16
+ },
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git@github.com:frontegg/entitlements-javascript-commons.git"
20
+ },
21
+ "author": "Frontegg",
22
+ "license": "ISC",
23
+ "homepage": "https://github.com/frontegg/entitlements-javascript-commons",
24
+ "dependencies": {},
25
+ "devDependencies": {
26
+ "@semantic-release/changelog": "^6.0.1",
27
+ "@semantic-release/git": "^10.0.1",
28
+ "@types/jest": "^29.2.0",
29
+ "@types/sinon": "^10.0.15",
30
+ "@typescript-eslint/eslint-plugin": "^5.38.1",
31
+ "@typescript-eslint/parser": "^5.38.1",
32
+ "eslint": "^8.24.0",
33
+ "eslint-config-prettier": "^8.5.0",
34
+ "jest": "^28.1.3",
35
+ "jest-junit": "^14.0.1",
36
+ "jest-mock-extended": "^3.0.4",
37
+ "prettier": "^2.7.1",
38
+ "semantic-release": "^21.0.5",
39
+ "sinon": "^15.2.0",
40
+ "ts-jest": "^28.0.8",
41
+ "typescript": "^4.8.4"
42
+ }
43
+ }
@@ -0,0 +1,5 @@
1
+ describe('index.ts', () => {
2
+ it('should be true', () => {
3
+ expect(true).toBe(true);
4
+ });
5
+ });
package/src/index.ts ADDED
@@ -0,0 +1,3 @@
1
+ export const evaluateFeatureFlag = (): boolean => {
2
+ return false;
3
+ };
package/tsconfig.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "compilerOptions": {
3
+ "noImplicitAny": false,
4
+ "target": "ES2019",
5
+ "module": "commonjs",
6
+ "declaration": true,
7
+ "strictNullChecks": true,
8
+ "strictPropertyInitialization": true,
9
+ "outDir": "./dist",
10
+ "strict": true,
11
+ "sourceMap": true,
12
+ "skipLibCheck": true
13
+ },
14
+ "exclude": ["node_modules", "dist"],
15
+ "include": ["src/index.ts"]
16
+ }