slicejs-web-framework 3.4.3 → 3.4.4
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/.opencode/opencode.json +14 -14
- package/Slice/Components/Structural/ContextManager/ContextManager.js +422 -422
- package/Slice/Components/Structural/ContextManager/ContextManagerDebugger.js +468 -468
- package/Slice/Components/Structural/Controller/Controller.js +1271 -1198
- package/Slice/Components/Structural/Debugger/Debugger.js +1503 -1503
- package/Slice/Components/Structural/EventManager/EventManager.js +366 -366
- package/Slice/Components/Structural/Logger/Logger.js +225 -225
- package/Slice/Components/Structural/Router/Router.js +775 -775
- package/Slice/Components/Structural/StylesManager/StylesManager.js +82 -82
- package/Slice/Components/Structural/StylesManager/ThemeManager/ThemeManager.js +106 -106
- package/Slice/Slice.js +650 -627
- package/Slice/tests/build-singleton.test.js +244 -244
- package/Slice/tests/bundle-v2-runtime-contract.test.js +738 -738
- package/Slice/tests/context-patch-use.test.js +95 -95
- package/Slice/tests/fixtures/real-runtime-loader.mjs +21 -21
- package/Slice/tests/public-env-typed-accessors.test.js +66 -66
- package/api/index.js +281 -281
- package/api/utils/publicEnvResolver.js +123 -123
- package/package.json +44 -44
- package/slicejs-cli/.github/workflows/ci.yml +43 -0
- package/slicejs-cli/LICENSE +21 -0
- package/slicejs-cli/assets/Slice.js-logo.png +0 -0
- package/slicejs-cli/client.js +740 -0
- package/slicejs-cli/commands/Print.js +164 -0
- package/slicejs-cli/commands/Validations.js +92 -0
- package/slicejs-cli/commands/build/build.js +40 -0
- package/slicejs-cli/commands/buildProduction/buildProduction.js +577 -0
- package/slicejs-cli/commands/bundle/bundle.js +236 -0
- package/slicejs-cli/commands/createComponent/VisualComponentTemplate.js +55 -0
- package/slicejs-cli/commands/createComponent/createComponent.js +128 -0
- package/slicejs-cli/commands/deleteComponent/deleteComponent.js +81 -0
- package/slicejs-cli/commands/doctor/doctor.js +516 -0
- package/slicejs-cli/commands/getComponent/getComponent.js +695 -0
- package/slicejs-cli/commands/init/init.js +473 -0
- package/slicejs-cli/commands/listComponents/listComponents.js +172 -0
- package/slicejs-cli/commands/startServer/startServer.js +240 -0
- package/slicejs-cli/commands/startServer/watchServer.js +66 -0
- package/slicejs-cli/commands/types/types.js +583 -0
- package/slicejs-cli/commands/utils/LocalCliDelegation.js +53 -0
- package/slicejs-cli/commands/utils/PackageManager.js +148 -0
- package/slicejs-cli/commands/utils/PathHelper.js +75 -0
- package/slicejs-cli/commands/utils/VersionChecker.js +169 -0
- package/slicejs-cli/commands/utils/bundling/BundleGenerator.js +2525 -0
- package/slicejs-cli/commands/utils/bundling/DependencyAnalyzer.js +933 -0
- package/slicejs-cli/commands/utils/loadConfig.js +31 -0
- package/slicejs-cli/commands/utils/sliceScripts.js +48 -0
- package/slicejs-cli/commands/utils/updateManager.js +471 -0
- package/slicejs-cli/package.json +71 -0
- package/slicejs-cli/playwright.config.js +51 -0
- package/slicejs-cli/pnpm-lock.yaml +1629 -0
- package/slicejs-cli/tests/build-command-integration.test.js +87 -0
- package/slicejs-cli/tests/build-mangling-e2e.test.js +290 -0
- package/slicejs-cli/tests/build-production-e2e.test.js +140 -0
- package/slicejs-cli/tests/builder-edge-cases.test.js +322 -0
- package/slicejs-cli/tests/bundle-generate-e2e.test.js +115 -0
- package/slicejs-cli/tests/bundle-generator.test.js +691 -0
- package/slicejs-cli/tests/bundle-v2-register-output.test.js +470 -0
- package/slicejs-cli/tests/bundling-dependency-edges.test.js +127 -0
- package/slicejs-cli/tests/bundling-imports-unit.test.js +267 -0
- package/slicejs-cli/tests/client-launcher-contract.test.js +211 -0
- package/slicejs-cli/tests/commands-component-crud.test.js +128 -0
- package/slicejs-cli/tests/commands-doctor.test.js +152 -0
- package/slicejs-cli/tests/commands-version-checker.test.js +37 -0
- package/slicejs-cli/tests/component-registry-parse.test.js +34 -0
- package/slicejs-cli/tests/dependency-analyzer.test.js +24 -0
- package/slicejs-cli/tests/e2e/bundles.spec.js +91 -0
- package/slicejs-cli/tests/e2e/dependency-scenarios.spec.js +56 -0
- package/slicejs-cli/tests/e2e/fixtures/components/Service/FetchManager/FetchManager.js +136 -0
- package/slicejs-cli/tests/e2e/fixtures/components/Service/IndexedDbManager/IndexedDbManager.js +149 -0
- package/slicejs-cli/tests/e2e/fixtures/components/Service/LocalStorageManager/LocalStorageManager.js +45 -0
- package/slicejs-cli/tests/e2e/fixtures/components/Visual/Button/Button.css +106 -0
- package/slicejs-cli/tests/e2e/fixtures/components/Visual/Button/Button.html +5 -0
- package/slicejs-cli/tests/e2e/fixtures/components/Visual/Button/Button.js +158 -0
- package/slicejs-cli/tests/e2e/fixtures/components/Visual/Link/Link.js +33 -0
- package/slicejs-cli/tests/e2e/fixtures/components/Visual/Loading/Loading.css +56 -0
- package/slicejs-cli/tests/e2e/fixtures/components/Visual/Loading/Loading.html +83 -0
- package/slicejs-cli/tests/e2e/fixtures/components/Visual/Loading/Loading.js +164 -0
- package/slicejs-cli/tests/e2e/fixtures/components/Visual/MultiRoute/MultiRoute.js +167 -0
- package/slicejs-cli/tests/e2e/fixtures/components/Visual/Navbar/Navbar.css +116 -0
- package/slicejs-cli/tests/e2e/fixtures/components/Visual/Navbar/Navbar.html +44 -0
- package/slicejs-cli/tests/e2e/fixtures/components/Visual/Navbar/Navbar.js +180 -0
- package/slicejs-cli/tests/e2e/fixtures/components/Visual/NotFound/NotFound.js +20 -0
- package/slicejs-cli/tests/e2e/fixtures/components/Visual/Route/Route.js +181 -0
- package/slicejs-cli/tests/e2e/fixtures/components/registry.json +12 -0
- package/slicejs-cli/tests/e2e/fixtures/vendor-components.mjs +65 -0
- package/slicejs-cli/tests/e2e/navigation.spec.js +44 -0
- package/slicejs-cli/tests/e2e/render.spec.js +34 -0
- package/slicejs-cli/tests/e2e/serve.mjs +264 -0
- package/slicejs-cli/tests/e2e/shared-deps.spec.js +61 -0
- package/slicejs-cli/tests/e2e/unminified.spec.js +33 -0
- package/slicejs-cli/tests/e2e-serve.test.js +148 -0
- package/slicejs-cli/tests/fixtures/components.js +8 -0
- package/slicejs-cli/tests/fixtures/sliceConfig.json +74 -0
- package/slicejs-cli/tests/getcomponent.test.js +435 -0
- package/slicejs-cli/tests/helpers/setup.js +102 -0
- package/slicejs-cli/tests/init-command-contract.test.js +101 -0
- package/slicejs-cli/tests/init-e2e.test.js +82 -0
- package/slicejs-cli/tests/init-project-isolation.test.js +98 -0
- package/slicejs-cli/tests/local-cli-delegation.test.js +81 -0
- package/slicejs-cli/tests/package-manager.test.js +127 -0
- package/slicejs-cli/tests/path-helper.test.js +206 -0
- package/slicejs-cli/tests/perf-budget.test.js +84 -0
- package/slicejs-cli/tests/postinstall-command.test.js +103 -0
- package/slicejs-cli/tests/property-mangling-regression.test.js +182 -0
- package/slicejs-cli/tests/types-breakage.test.js +491 -0
- package/slicejs-cli/tests/types-generator-errors.test.js +361 -0
- package/slicejs-cli/tests/types-generator.test.js +348 -0
|
@@ -1,123 +1,123 @@
|
|
|
1
|
-
import { readFileSync, existsSync } from 'node:fs';
|
|
2
|
-
|
|
3
|
-
const PUBLIC_PREFIX = 'SLICE_PUBLIC_';
|
|
4
|
-
const SUSPICIOUS_TERMS = ['SECRET', 'TOKEN', 'PASSWORD', 'PRIVATE', 'API_KEY', 'ACCESS_KEY', 'CREDENTIAL'];
|
|
5
|
-
|
|
6
|
-
function parseEnvFile(envFilePath) {
|
|
7
|
-
if (!envFilePath || !existsSync(envFilePath)) {
|
|
8
|
-
return {};
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
let fileContent;
|
|
12
|
-
try {
|
|
13
|
-
fileContent = readFileSync(envFilePath, 'utf8').replace(/^\uFEFF/, '');
|
|
14
|
-
} catch (error) {
|
|
15
|
-
console.error(`Error reading env file ${envFilePath}:`, error);
|
|
16
|
-
return {};
|
|
17
|
-
}
|
|
18
|
-
const parsed = {};
|
|
19
|
-
const lines = fileContent.split(/\r?\n/);
|
|
20
|
-
|
|
21
|
-
for (const rawLine of lines) {
|
|
22
|
-
const line = rawLine.trim();
|
|
23
|
-
|
|
24
|
-
if (!line || line.startsWith('#')) {
|
|
25
|
-
continue;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const equalsIndex = line.indexOf('=');
|
|
29
|
-
if (equalsIndex === -1) {
|
|
30
|
-
continue;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
let key = line.slice(0, equalsIndex).trim();
|
|
34
|
-
if (!key) {
|
|
35
|
-
continue;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
if (key.startsWith('export ')) {
|
|
39
|
-
key = key.slice('export '.length).trim();
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
let value = line.slice(equalsIndex + 1).trim();
|
|
43
|
-
|
|
44
|
-
const quotedWithOptionalCommentMatch = value.match(/^(["'])(.*?)\1(?:\s+#.*)?$/);
|
|
45
|
-
|
|
46
|
-
if (quotedWithOptionalCommentMatch) {
|
|
47
|
-
value = quotedWithOptionalCommentMatch[2];
|
|
48
|
-
} else {
|
|
49
|
-
value = value.replace(/\s+#.*$/, '').trimEnd();
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
parsed[key] = value;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return parsed;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function warnSuspiciousKey(key, logger, warnedKeys) {
|
|
59
|
-
const upperKey = key.toUpperCase();
|
|
60
|
-
const isSuspicious = SUSPICIOUS_TERMS.some((term) => upperKey.includes(term));
|
|
61
|
-
|
|
62
|
-
if (isSuspicious && !warnedKeys.has(key) && logger && typeof logger.warn === 'function') {
|
|
63
|
-
logger.warn(`[slice-env] Suspicious public environment key detected: ${key}`);
|
|
64
|
-
warnedKeys.add(key);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function buildPublicPayload({ envFromFile, processEnv, logger }) {
|
|
69
|
-
const env = {};
|
|
70
|
-
const warnedKeys = new Set();
|
|
71
|
-
|
|
72
|
-
for (const [key, value] of Object.entries(envFromFile)) {
|
|
73
|
-
if (key.startsWith(PUBLIC_PREFIX)) {
|
|
74
|
-
env[key] = String(value ?? '');
|
|
75
|
-
warnSuspiciousKey(key, logger, warnedKeys);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
for (const [key, value] of Object.entries(processEnv || {})) {
|
|
80
|
-
if (key.startsWith(PUBLIC_PREFIX)) {
|
|
81
|
-
env[key] = String(value ?? '');
|
|
82
|
-
warnSuspiciousKey(key, logger, warnedKeys);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
return env;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export function resolvePublicEnv({ mode, envFilePath, processEnv = process.env, logger = console }) {
|
|
90
|
-
const envFromFile = parseEnvFile(envFilePath);
|
|
91
|
-
const env = buildPublicPayload({
|
|
92
|
-
envFromFile,
|
|
93
|
-
processEnv,
|
|
94
|
-
logger,
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
return {
|
|
98
|
-
mode,
|
|
99
|
-
env,
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export function createPublicEnvProvider({ mode, envFilePath, processEnv = process.env, logger = console }) {
|
|
104
|
-
if (mode === 'production') {
|
|
105
|
-
let cachedPayload;
|
|
106
|
-
|
|
107
|
-
return {
|
|
108
|
-
getPayload() {
|
|
109
|
-
if (!cachedPayload) {
|
|
110
|
-
cachedPayload = resolvePublicEnv({ mode, envFilePath, processEnv, logger });
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
return cachedPayload;
|
|
114
|
-
},
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
return {
|
|
119
|
-
getPayload() {
|
|
120
|
-
return resolvePublicEnv({ mode, envFilePath, processEnv, logger });
|
|
121
|
-
},
|
|
122
|
-
};
|
|
123
|
-
}
|
|
1
|
+
import { readFileSync, existsSync } from 'node:fs';
|
|
2
|
+
|
|
3
|
+
const PUBLIC_PREFIX = 'SLICE_PUBLIC_';
|
|
4
|
+
const SUSPICIOUS_TERMS = ['SECRET', 'TOKEN', 'PASSWORD', 'PRIVATE', 'API_KEY', 'ACCESS_KEY', 'CREDENTIAL'];
|
|
5
|
+
|
|
6
|
+
function parseEnvFile(envFilePath) {
|
|
7
|
+
if (!envFilePath || !existsSync(envFilePath)) {
|
|
8
|
+
return {};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
let fileContent;
|
|
12
|
+
try {
|
|
13
|
+
fileContent = readFileSync(envFilePath, 'utf8').replace(/^\uFEFF/, '');
|
|
14
|
+
} catch (error) {
|
|
15
|
+
console.error(`Error reading env file ${envFilePath}:`, error);
|
|
16
|
+
return {};
|
|
17
|
+
}
|
|
18
|
+
const parsed = {};
|
|
19
|
+
const lines = fileContent.split(/\r?\n/);
|
|
20
|
+
|
|
21
|
+
for (const rawLine of lines) {
|
|
22
|
+
const line = rawLine.trim();
|
|
23
|
+
|
|
24
|
+
if (!line || line.startsWith('#')) {
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const equalsIndex = line.indexOf('=');
|
|
29
|
+
if (equalsIndex === -1) {
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
let key = line.slice(0, equalsIndex).trim();
|
|
34
|
+
if (!key) {
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (key.startsWith('export ')) {
|
|
39
|
+
key = key.slice('export '.length).trim();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
let value = line.slice(equalsIndex + 1).trim();
|
|
43
|
+
|
|
44
|
+
const quotedWithOptionalCommentMatch = value.match(/^(["'])(.*?)\1(?:\s+#.*)?$/);
|
|
45
|
+
|
|
46
|
+
if (quotedWithOptionalCommentMatch) {
|
|
47
|
+
value = quotedWithOptionalCommentMatch[2];
|
|
48
|
+
} else {
|
|
49
|
+
value = value.replace(/\s+#.*$/, '').trimEnd();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
parsed[key] = value;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return parsed;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function warnSuspiciousKey(key, logger, warnedKeys) {
|
|
59
|
+
const upperKey = key.toUpperCase();
|
|
60
|
+
const isSuspicious = SUSPICIOUS_TERMS.some((term) => upperKey.includes(term));
|
|
61
|
+
|
|
62
|
+
if (isSuspicious && !warnedKeys.has(key) && logger && typeof logger.warn === 'function') {
|
|
63
|
+
logger.warn(`[slice-env] Suspicious public environment key detected: ${key}`);
|
|
64
|
+
warnedKeys.add(key);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function buildPublicPayload({ envFromFile, processEnv, logger }) {
|
|
69
|
+
const env = {};
|
|
70
|
+
const warnedKeys = new Set();
|
|
71
|
+
|
|
72
|
+
for (const [key, value] of Object.entries(envFromFile)) {
|
|
73
|
+
if (key.startsWith(PUBLIC_PREFIX)) {
|
|
74
|
+
env[key] = String(value ?? '');
|
|
75
|
+
warnSuspiciousKey(key, logger, warnedKeys);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
for (const [key, value] of Object.entries(processEnv || {})) {
|
|
80
|
+
if (key.startsWith(PUBLIC_PREFIX)) {
|
|
81
|
+
env[key] = String(value ?? '');
|
|
82
|
+
warnSuspiciousKey(key, logger, warnedKeys);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return env;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function resolvePublicEnv({ mode, envFilePath, processEnv = process.env, logger = console }) {
|
|
90
|
+
const envFromFile = parseEnvFile(envFilePath);
|
|
91
|
+
const env = buildPublicPayload({
|
|
92
|
+
envFromFile,
|
|
93
|
+
processEnv,
|
|
94
|
+
logger,
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
return {
|
|
98
|
+
mode,
|
|
99
|
+
env,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export function createPublicEnvProvider({ mode, envFilePath, processEnv = process.env, logger = console }) {
|
|
104
|
+
if (mode === 'production') {
|
|
105
|
+
let cachedPayload;
|
|
106
|
+
|
|
107
|
+
return {
|
|
108
|
+
getPayload() {
|
|
109
|
+
if (!cachedPayload) {
|
|
110
|
+
cachedPayload = resolvePublicEnv({ mode, envFilePath, processEnv, logger });
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return cachedPayload;
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return {
|
|
119
|
+
getPayload() {
|
|
120
|
+
return resolvePublicEnv({ mode, envFilePath, processEnv, logger });
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
}
|
package/package.json
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "slicejs-web-framework",
|
|
3
|
-
"version": "3.4.
|
|
4
|
-
"description": "",
|
|
5
|
-
"engines": {
|
|
6
|
-
"node": ">=20"
|
|
7
|
-
},
|
|
8
|
-
"scripts": {
|
|
9
|
-
"dev": "node ./node_modules/slicejs-cli/client.js dev",
|
|
10
|
-
"build": "node ./node_modules/slicejs-cli/client.js build",
|
|
11
|
-
"start": "node ./node_modules/slicejs-cli/client.js start",
|
|
12
|
-
"test": "echo \"Error: no test specified\" && exit 1",
|
|
13
|
-
"slice:init": "node ./node_modules/slicejs-cli/client.js init",
|
|
14
|
-
"slice:create": "node ./node_modules/slicejs-cli/client.js component create",
|
|
15
|
-
"slice:delete": "node ./node_modules/slicejs-cli/client.js component delete",
|
|
16
|
-
"slice:list": "node ./node_modules/slicejs-cli/client.js component list",
|
|
17
|
-
"slice:start": "node ./node_modules/slicejs-cli/client.js start",
|
|
18
|
-
"format": "prettier --write \"**/*.js\"",
|
|
19
|
-
"run": "node ./node_modules/slicejs-cli/client.js dev",
|
|
20
|
-
"slice:modify": "node ./node_modules/slicejs-cli/client.js modify"
|
|
21
|
-
},
|
|
22
|
-
"keywords": [],
|
|
23
|
-
"author": "",
|
|
24
|
-
"license": "ISC",
|
|
25
|
-
"type": "module",
|
|
26
|
-
"exports": {
|
|
27
|
-
".": "./Slice/Slice.js",
|
|
28
|
-
"./api/framework/express.js": "./api/framework/express.js"
|
|
29
|
-
},
|
|
30
|
-
"types": "./types/index.d.ts",
|
|
31
|
-
"dependencies": {
|
|
32
|
-
"express": "^4.19.2"
|
|
33
|
-
},
|
|
34
|
-
"devDependencies": {
|
|
35
|
-
"prettier": "3.3.3"
|
|
36
|
-
},
|
|
37
|
-
"prettier": {
|
|
38
|
-
"trailingComma": "es5",
|
|
39
|
-
"tabWidth": 3,
|
|
40
|
-
"semi": true,
|
|
41
|
-
"singleQuote": true,
|
|
42
|
-
"printWidth": 120
|
|
43
|
-
}
|
|
44
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "slicejs-web-framework",
|
|
3
|
+
"version": "3.4.4",
|
|
4
|
+
"description": "",
|
|
5
|
+
"engines": {
|
|
6
|
+
"node": ">=20"
|
|
7
|
+
},
|
|
8
|
+
"scripts": {
|
|
9
|
+
"dev": "node ./node_modules/slicejs-cli/client.js dev",
|
|
10
|
+
"build": "node ./node_modules/slicejs-cli/client.js build",
|
|
11
|
+
"start": "node ./node_modules/slicejs-cli/client.js start",
|
|
12
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
13
|
+
"slice:init": "node ./node_modules/slicejs-cli/client.js init",
|
|
14
|
+
"slice:create": "node ./node_modules/slicejs-cli/client.js component create",
|
|
15
|
+
"slice:delete": "node ./node_modules/slicejs-cli/client.js component delete",
|
|
16
|
+
"slice:list": "node ./node_modules/slicejs-cli/client.js component list",
|
|
17
|
+
"slice:start": "node ./node_modules/slicejs-cli/client.js start",
|
|
18
|
+
"format": "prettier --write \"**/*.js\"",
|
|
19
|
+
"run": "node ./node_modules/slicejs-cli/client.js dev",
|
|
20
|
+
"slice:modify": "node ./node_modules/slicejs-cli/client.js modify"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [],
|
|
23
|
+
"author": "",
|
|
24
|
+
"license": "ISC",
|
|
25
|
+
"type": "module",
|
|
26
|
+
"exports": {
|
|
27
|
+
".": "./Slice/Slice.js",
|
|
28
|
+
"./api/framework/express.js": "./api/framework/express.js"
|
|
29
|
+
},
|
|
30
|
+
"types": "./types/index.d.ts",
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"express": "^4.19.2"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"prettier": "3.3.3"
|
|
36
|
+
},
|
|
37
|
+
"prettier": {
|
|
38
|
+
"trailingComma": "es5",
|
|
39
|
+
"tabWidth": 3,
|
|
40
|
+
"semi": true,
|
|
41
|
+
"singleQuote": true,
|
|
42
|
+
"printWidth": 120
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master, main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
timeout-minutes: 20
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
|
|
15
|
+
- uses: pnpm/action-setup@v4
|
|
16
|
+
with:
|
|
17
|
+
version: 11
|
|
18
|
+
|
|
19
|
+
- uses: actions/setup-node@v4
|
|
20
|
+
with:
|
|
21
|
+
node-version: 22
|
|
22
|
+
cache: pnpm
|
|
23
|
+
|
|
24
|
+
- name: Install dependencies
|
|
25
|
+
run: pnpm install --frozen-lockfile
|
|
26
|
+
|
|
27
|
+
- name: Install Playwright browser
|
|
28
|
+
run: pnpm exec playwright install --with-deps chromium
|
|
29
|
+
|
|
30
|
+
# Serialized to avoid resource contention between the build-heavy
|
|
31
|
+
# integration tests under parallel runners.
|
|
32
|
+
- name: Unit & integration tests
|
|
33
|
+
run: node --test --test-concurrency=1
|
|
34
|
+
|
|
35
|
+
- name: Browser E2E tests
|
|
36
|
+
run: pnpm exec playwright test
|
|
37
|
+
|
|
38
|
+
- uses: actions/upload-artifact@v4
|
|
39
|
+
if: ${{ !cancelled() }}
|
|
40
|
+
with:
|
|
41
|
+
name: playwright-report
|
|
42
|
+
path: playwright-report/
|
|
43
|
+
retention-days: 7
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Victor Jose Kneider Alnahi and Julio Antonio Graterol Bracho
|
|
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.
|
|
Binary file
|