@archora/forge-templates 1.2.0

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.
@@ -0,0 +1,9 @@
1
+ declare function createBarrelTemplate(exports: string[]): string;
2
+
3
+ type PermissionsTemplateInput = {
4
+ resourceName: string;
5
+ permissions: Record<'view' | 'create' | 'update' | 'delete', string>;
6
+ };
7
+ declare function createPermissionsTemplate(input: PermissionsTemplateInput): string;
8
+
9
+ export { type PermissionsTemplateInput, createBarrelTemplate, createPermissionsTemplate };
package/dist/index.js ADDED
@@ -0,0 +1,15 @@
1
+ // src/shared/barrelTemplate.ts
2
+ function createBarrelTemplate(exports) {
3
+ return exports.map((item) => `export * from './${item}.js'`).join("\n");
4
+ }
5
+
6
+ // src/resource/permissions.template.ts
7
+ function createPermissionsTemplate(input) {
8
+ const exportName = `${input.resourceName}Permissions`;
9
+ return `export const ${exportName} = ${JSON.stringify(input.permissions, null, 2)} as const
10
+ `;
11
+ }
12
+ export {
13
+ createBarrelTemplate,
14
+ createPermissionsTemplate
15
+ };
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@archora/forge-templates",
3
+ "version": "1.2.0",
4
+ "description": "Template support for Archora Forge generated frontend modules.",
5
+ "license": "SEE LICENSE IN LICENSE",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/archora-dev/archora-forge.git"
9
+ },
10
+ "bugs": {
11
+ "url": "https://github.com/archora-dev/archora-forge/issues"
12
+ },
13
+ "homepage": "https://github.com/archora-dev/archora-forge#readme",
14
+ "type": "module",
15
+ "main": "./dist/index.js",
16
+ "types": "./dist/index.d.ts",
17
+ "exports": {
18
+ ".": {
19
+ "types": "./dist/index.d.ts",
20
+ "import": "./dist/index.js"
21
+ }
22
+ },
23
+ "files": [
24
+ "dist"
25
+ ],
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "scripts": {
30
+ "build": "tsup src/index.ts --format esm --dts --clean",
31
+ "dev": "tsup src/index.ts --format esm --dts --watch",
32
+ "typecheck": "tsc --noEmit"
33
+ },
34
+ "devDependencies": {
35
+ "tsup": "^8.4.0",
36
+ "typescript": "^5.8.3"
37
+ }
38
+ }