@form8ion/socket-security 1.0.0-beta.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/LICENSE ADDED
@@ -0,0 +1,27 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Matt Travi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and
7
+ associated documentation files (the "Software"), to deal in the Software without
8
+ restriction, including
9
+ without limitation the rights to use, copy, modify, merge, publish, distribute,
10
+ sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is furnished
12
+ to do so, subject to the
13
+ following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be included in all
16
+ copies or substantial
17
+ portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ IMPLIED, INCLUDING BUT NOT
21
+ LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
22
+ AND NONINFRINGEMENT. IN NO
23
+ EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24
+ OTHER LIABILITY, WHETHER
25
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
26
+ CONNECTION WITH THE SOFTWARE OR THE
27
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,109 @@
1
+ # socket-security
2
+
3
+ form8ion plugin for projects protected by Socket security
4
+
5
+ <!--status-badges start -->
6
+
7
+ [![Node CI Workflow Status][github-actions-ci-badge]][github-actions-ci-link]
8
+ [![Codecov][coverage-badge]][coverage-link]
9
+ ![SLSA Level 2][slsa-badge]
10
+
11
+ <!--status-badges end -->
12
+
13
+ ## Table of Contents
14
+
15
+ * [Usage](#usage)
16
+ * [Installation](#installation)
17
+ * [Example](#example)
18
+ * [Import](#import)
19
+ * [Execute](#execute)
20
+ * [Contributing](#contributing)
21
+ * [Dependencies](#dependencies)
22
+ * [Verification](#verification)
23
+
24
+ ## Usage
25
+
26
+ <!--consumer-badges start -->
27
+
28
+ <!--consumer-badges end -->
29
+
30
+ ### Installation
31
+
32
+ ```sh
33
+ $ npm install @form8ion/socket-security
34
+ ```
35
+
36
+ ### Example
37
+
38
+ #### Import
39
+
40
+ ```javascript
41
+ import {scaffold, lift} from '@form8ion/socket-security';
42
+ ```
43
+
44
+ #### Execute
45
+
46
+ ```javascript
47
+ (async () => {
48
+ const projectRoot = process.cwd();
49
+
50
+ await scaffold({projectRoot});
51
+
52
+ await lift({projectRoot});
53
+ })();
54
+ ```
55
+
56
+ ## Contributing
57
+
58
+ <!--contribution-badges start -->
59
+
60
+ [![Commitizen friendly][commitizen-badge]][commitizen-link]
61
+ [![Conventional Commits][commit-convention-badge]][commit-convention-link]
62
+ [![Renovate][renovate-badge]][renovate-link]
63
+ [![PRs Welcome][PRs-badge]][PRs-link]
64
+ [![semantic-release: angular][semantic-release-badge]][semantic-release-link]
65
+
66
+ <!--contribution-badges end -->
67
+
68
+ ### Dependencies
69
+
70
+ ```sh
71
+ $ nvm install
72
+ $ npm install
73
+ ```
74
+
75
+ ### Verification
76
+
77
+ ```sh
78
+ $ npm test
79
+ ```
80
+
81
+ [github-actions-ci-link]: https://github.com/form8ion/socket-security/actions?query=workflow%3A%22Node.js+CI%22+branch%3Amaster
82
+
83
+ [github-actions-ci-badge]: https://img.shields.io/github/actions/workflow/status/form8ion/socket-security/node-ci.yml.svg?branch=master&logo=github
84
+
85
+ [coverage-link]: https://codecov.io/github/form8ion/socket-security
86
+
87
+ [coverage-badge]: https://img.shields.io/codecov/c/github/form8ion/socket-security/master?logo=codecov
88
+
89
+ [slsa-badge]: https://slsa.dev/images/gh-badge-level2.svg
90
+
91
+ [commitizen-link]: http://commitizen.github.io/cz-cli/
92
+
93
+ [commitizen-badge]: https://img.shields.io/badge/commitizen-friendly-brightgreen.svg
94
+
95
+ [commit-convention-link]: https://conventionalcommits.org
96
+
97
+ [commit-convention-badge]: https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg
98
+
99
+ [renovate-link]: https://renovatebot.com
100
+
101
+ [renovate-badge]: https://img.shields.io/badge/renovate-enabled-brightgreen.svg?logo=renovate
102
+
103
+ [PRs-link]: https://makeapullrequest.com
104
+
105
+ [PRs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg
106
+
107
+ [semantic-release-link]: https://github.com/semantic-release/semantic-release
108
+
109
+ [semantic-release-badge]: https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release
package/example.js ADDED
@@ -0,0 +1,17 @@
1
+ // #### Import
2
+ // remark-usage-ignore-next
3
+ import stubbedFs from 'mock-fs';
4
+ import {scaffold, lift} from './lib/index.js';
5
+
6
+ // remark-usage-ignore-next
7
+ stubbedFs({'package.json': JSON.stringify({name: 'example-package'})});
8
+
9
+ // #### Execute
10
+
11
+ (async () => {
12
+ const projectRoot = process.cwd();
13
+
14
+ await scaffold({projectRoot});
15
+
16
+ await lift({projectRoot});
17
+ })();
package/lib/index.js ADDED
@@ -0,0 +1,25 @@
1
+ import { loadPackageJson } from '@form8ion/javascript-core';
2
+
3
+ /* eslint-disable-next-line no-empty-pattern */
4
+ function scaffold({}) {
5
+ return undefined;
6
+ }
7
+
8
+ async function lift({projectRoot}) {
9
+ const {name: packageName} = await loadPackageJson({projectRoot});
10
+
11
+ return {
12
+ badges: {
13
+ status: {
14
+ socket: {
15
+ img: `https://badge.socket.dev/npm/package/${packageName}/latest`,
16
+ link: `https://socket.dev/npm/package/${packageName}/overview`,
17
+ text: 'Socket'
18
+ }
19
+ }
20
+ }
21
+ };
22
+ }
23
+
24
+ export { lift, scaffold };
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../src/scaffolder.js","../src/lifter.js"],"sourcesContent":["/* eslint-disable-next-line no-empty-pattern */\nexport default function scaffold({}) {\n return undefined;\n}\n","import {loadPackageJson} from '@form8ion/javascript-core';\n\nexport default async function lift({projectRoot}) {\n const {name: packageName} = await loadPackageJson({projectRoot});\n\n return {\n badges: {\n status: {\n socket: {\n img: `https://badge.socket.dev/npm/package/${packageName}/latest`,\n link: `https://socket.dev/npm/package/${packageName}/overview`,\n text: 'Socket'\n }\n }\n }\n };\n}\n"],"names":[],"mappings":";;AAAA;AACe,SAAS,QAAQ,CAAC,EAAE,EAAE;AACrC,EAAE,OAAO,SAAS;AAClB;;ACDe,eAAe,IAAI,CAAC,CAAC,WAAW,CAAC,EAAE;AAClD,EAAE,MAAM,CAAC,IAAI,EAAE,WAAW,CAAC,GAAG,MAAM,eAAe,CAAC,CAAC,WAAW,CAAC,CAAC;;AAElE,EAAE,OAAO;AACT,IAAI,MAAM,EAAE;AACZ,MAAM,MAAM,EAAE;AACd,QAAQ,MAAM,EAAE;AAChB,UAAU,GAAG,EAAE,CAAC,qCAAqC,EAAE,WAAW,CAAC,OAAO,CAAC;AAC3E,UAAU,IAAI,EAAE,CAAC,+BAA+B,EAAE,WAAW,CAAC,SAAS,CAAC;AACxE,UAAU,IAAI,EAAE;AAChB;AACA;AACA;AACA,GAAG;AACH;;;;"}
package/package.json ADDED
@@ -0,0 +1,85 @@
1
+ {
2
+ "name": "@form8ion/socket-security",
3
+ "description": "form8ion plugin for projects protected by Socket security",
4
+ "license": "MIT",
5
+ "version": "1.0.0-beta.1",
6
+ "type": "module",
7
+ "author": "Matt Travi <npm@travi.org> (https://matt.travi.org)",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/form8ion/socket-security.git"
11
+ },
12
+ "bugs": "https://github.com/form8ion/socket-security/issues",
13
+ "homepage": "https://www.npmjs.com/package/@form8ion/socket-security",
14
+ "exports": "./lib/index.js",
15
+ "main": "./lib/index.js",
16
+ "sideEffects": false,
17
+ "scripts": {
18
+ "pretest": "run-s build",
19
+ "test": "npm-run-all --print-label --parallel lint:* --parallel test:*",
20
+ "lint:gherkin": "gplint --config .gplintrc.json",
21
+ "lint:js": "eslint . --cache",
22
+ "lint:js:fix": "run-s 'lint:js -- --fix'",
23
+ "lint:lockfile": "lockfile-lint",
24
+ "lint:md": "remark . --frail",
25
+ "lint:peer": "npm ls >/dev/null",
26
+ "lint:publish": "publint --strict",
27
+ "test:unit": "run-s 'test:unit:base -- --coverage'",
28
+ "test:unit:base": "NODE_ENV=test DEBUG=any vitest run src/",
29
+ "test:integration": "run-s 'test:integration:base -- --profile noWip'",
30
+ "pretest:integration:base": "run-s build",
31
+ "test:integration:base": "NODE_OPTIONS=--enable-source-maps DEBUG=any cucumber-js test/integration",
32
+ "test:integration:debug": "DEBUG=test run-s test:integration",
33
+ "test:integration:focus": "run-s 'test:integration:base -- --profile focus'",
34
+ "test:integration:wip": "run-s 'test:integration:base -- --profile wip'",
35
+ "test:integration:wip:debug": "DEBUG=test run-s 'test:integration:wip'",
36
+ "prebuild": "run-s clean",
37
+ "build": "npm-run-all --print-label --parallel build:*",
38
+ "build:js": "rollup --config",
39
+ "clean": "rimraf ./lib",
40
+ "pregenerate:md": "run-s build",
41
+ "generate:md": "remark . --output",
42
+ "prepack": "run-s build",
43
+ "prepare": "husky",
44
+ "watch": "run-s 'build:js -- --watch'"
45
+ },
46
+ "files": [
47
+ "example.js",
48
+ "lib/",
49
+ "src/"
50
+ ],
51
+ "publishConfig": {
52
+ "access": "public",
53
+ "provenance": true
54
+ },
55
+ "packageManager": "npm@11.16.0",
56
+ "devDependencies": {
57
+ "@cucumber/cucumber": "13.0.0",
58
+ "@form8ion/commitlint-config": "2.0.18",
59
+ "@form8ion/core": "4.11.2",
60
+ "@form8ion/eslint-config": "7.0.18",
61
+ "@form8ion/eslint-config-cucumber": "1.4.1",
62
+ "@form8ion/eslint-config-vitest": "1.1.0",
63
+ "@form8ion/remark-lint-preset": "6.0.7",
64
+ "@travi/any": "3.3.0",
65
+ "@vitest/coverage-v8": "4.1.9",
66
+ "cz-conventional-changelog": "3.3.0",
67
+ "gplint": "2.5.2",
68
+ "husky": "9.1.7",
69
+ "lockfile-lint": "5.0.0",
70
+ "mock-fs": "5.5.0",
71
+ "npm-run-all2": "9.0.2",
72
+ "publint": "0.3.21",
73
+ "remark-cli": "12.0.1",
74
+ "remark-toc": "9.0.0",
75
+ "remark-usage": "11.0.1",
76
+ "rimraf": "6.1.3",
77
+ "rollup": "4.62.2",
78
+ "rollup-plugin-auto-external": "2.0.0",
79
+ "vitest": "4.1.9",
80
+ "vitest-when": "0.10.0"
81
+ },
82
+ "dependencies": {
83
+ "@form8ion/javascript-core": "^13.0.0"
84
+ }
85
+ }
@@ -0,0 +1,7 @@
1
+ import {assert, describe, it} from 'vitest';
2
+
3
+ describe('canary', () => {
4
+ it('should pass', () => {
5
+ assert.isTrue(true);
6
+ });
7
+ });
package/src/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export {default as scaffold} from './scaffolder.js';
2
+ export {default as lift} from './lifter.js';
package/src/lifter.js ADDED
@@ -0,0 +1,17 @@
1
+ import {loadPackageJson} from '@form8ion/javascript-core';
2
+
3
+ export default async function lift({projectRoot}) {
4
+ const {name: packageName} = await loadPackageJson({projectRoot});
5
+
6
+ return {
7
+ badges: {
8
+ status: {
9
+ socket: {
10
+ img: `https://badge.socket.dev/npm/package/${packageName}/latest`,
11
+ link: `https://socket.dev/npm/package/${packageName}/overview`,
12
+ text: 'Socket'
13
+ }
14
+ }
15
+ }
16
+ };
17
+ }
@@ -0,0 +1,31 @@
1
+ import {loadPackageJson} from '@form8ion/javascript-core';
2
+
3
+ import {describe, it, expect, vi} from 'vitest';
4
+ import {when} from 'vitest-when';
5
+ import any from '@travi/any';
6
+
7
+ import lift from './lifter.js';
8
+
9
+ vi.mock('@form8ion/javascript-core');
10
+
11
+ describe('lifter', () => {
12
+ it('should define the badge based on the npm package name', async () => {
13
+ const projectRoot = any.string();
14
+ const packageName = any.word();
15
+ when(loadPackageJson).calledWith({projectRoot}).thenResolve({name: packageName});
16
+
17
+ const result = await lift({projectRoot});
18
+
19
+ expect(result).toEqual({
20
+ badges: {
21
+ status: {
22
+ socket: {
23
+ img: `https://badge.socket.dev/npm/package/${packageName}/latest`,
24
+ link: `https://socket.dev/npm/package/${packageName}/overview`,
25
+ text: 'Socket'
26
+ }
27
+ }
28
+ }
29
+ });
30
+ });
31
+ });
@@ -0,0 +1,4 @@
1
+ /* eslint-disable-next-line no-empty-pattern */
2
+ export default function scaffold({}) {
3
+ return undefined;
4
+ }