@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 +6 -0
- package/.eslintrc.json +16 -0
- package/.github/CODEOWNERS +5 -0
- package/.github/workflows/_build-and-test.yaml +28 -0
- package/.github/workflows/_lint.yaml +21 -0
- package/.github/workflows/_pre-release.yaml +29 -0
- package/.github/workflows/on-pull-request.yaml +22 -0
- package/.github/workflows/publish.yaml +45 -0
- package/.prettierignore +7 -0
- package/.prettierrc +8 -0
- package/.releaserc.yaml +78 -0
- package/LICENSE +21 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/docs/CHANGELOG.md +6 -0
- package/package.json +43 -0
- package/src/index.spec.ts +5 -0
- package/src/index.ts +3 -0
- package/tsconfig.json +16 -0
package/.eslintignore
ADDED
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,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
|
package/.prettierignore
ADDED
package/.prettierrc
ADDED
package/.releaserc.yaml
ADDED
|
@@ -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.
|
package/dist/index.d.ts
ADDED
|
@@ -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"}
|
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
|
+
}
|
package/src/index.ts
ADDED
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
|
+
}
|