@barbapapazes/content-creation 0.15.0 → 0.15.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/dist/cli.d.mts +1 -0
- package/dist/cli.mjs +1 -1
- package/dist/index.d.mts +68 -0
- package/dist/index.mjs +1 -0
- package/package.json +9 -1
package/dist/cli.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import e from"node:process";import{intro as t,isCancel as n,log as r,multiselect as i,outro as a,select as o,text as s}from"@clack/prompts";import{cac as c}from"cac";import{addDays as l,format as u,parse as d,setHours as f,setMinutes as p,setSeconds as m}from"date-fns";import{existsSync as h,mkdirSync as g,readFileSync as _,readdirSync as v,statSync as y,writeFileSync as b}from"node:fs";import{dirname as ee,isAbsolute as x,join as S,resolve as C}from"node:path";import w from"gray-matter";import{homedir as T}from"node:os";import{loadConfig as E}from"c12";var te=`0.15.
|
|
2
|
+
import e from"node:process";import{intro as t,isCancel as n,log as r,multiselect as i,outro as a,select as o,text as s}from"@clack/prompts";import{cac as c}from"cac";import{addDays as l,format as u,parse as d,setHours as f,setMinutes as p,setSeconds as m}from"date-fns";import{existsSync as h,mkdirSync as g,readFileSync as _,readdirSync as v,statSync as y,writeFileSync as b}from"node:fs";import{dirname as ee,isAbsolute as x,join as S,resolve as C}from"node:path";import w from"gray-matter";import{homedir as T}from"node:os";import{loadConfig as E}from"c12";var te=`0.15.1`;const D={linkedin:{mainFile:`linkedin.md`,additionalFiles:[`linkedin-script.md`]},x:{mainFile:`x.md`},youtube:{mainFile:`youtube-script.md`,additionalFiles:[`youtube-description.md`]},instagram:{mainFile:`instagram-script.md`,additionalFiles:[`instagram-description.md`]}},O={thematic:[],templatesDir:void 0,templates:{},scheduling:{}};function k(t,n){return t?x(t)?t:C(T(),t):n?ee(n):e.cwd()}function A(e,t){let n={};if(e?.footerPath){let r=C(t,e.footerPath);h(r)&&(n.footerPath=r)}return n}function j(e,t){let n={};if(e?.templatePath){let r=C(t,e.templatePath);h(r)&&(n.templatePath=r)}return n}async function M(){let{config:t,configFile:n}=await E({name:`content-creation`,defaults:O,globalRc:!0,dotenv:!0}),r=k(t.templatesDir,n),i={linkedin:A(t.templates?.linkedin,r),youtube:j(t.templates?.youtube,r),instagram:j(t.templates?.instagram,r)},a={automationEndpoint:t.scheduling?.automationEndpoint||e.env.AUTOMATION_ENDPOINT,cfAccessClientId:t.scheduling?.cfAccessClientId||e.env.CF_ACCESS_CLIENT_ID,cfAccessClientSecret:t.scheduling?.cfAccessClientSecret||e.env.CF_ACCESS_CLIENT_SECRET};return{thematic:t.thematic||[],templatesDir:t.templatesDir||``,templates:i,scheduling:a}}function N(){return`
|
|
3
3
|
|
|
4
4
|
---
|
|
5
5
|
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
//#region src/types.d.ts
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Template configuration for LinkedIn
|
|
5
|
+
*/
|
|
6
|
+
interface LinkedInTemplateConfig {
|
|
7
|
+
/**
|
|
8
|
+
* Path to a template file for the footer (resolved relative to templatesDir or config file location)
|
|
9
|
+
*/
|
|
10
|
+
footerPath?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Template configuration for YouTube/Instagram
|
|
14
|
+
*/
|
|
15
|
+
interface VideoTemplateConfig {
|
|
16
|
+
/**
|
|
17
|
+
* Path to a template file for the description blueprint (resolved relative to templatesDir or config file location)
|
|
18
|
+
*/
|
|
19
|
+
templatePath?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Scheduling configuration
|
|
23
|
+
*/
|
|
24
|
+
interface SchedulingConfig {
|
|
25
|
+
/**
|
|
26
|
+
* Automation endpoint URL
|
|
27
|
+
*/
|
|
28
|
+
automationEndpoint?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Cloudflare Access Client ID
|
|
31
|
+
*/
|
|
32
|
+
cfAccessClientId?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Cloudflare Access Client Secret
|
|
35
|
+
*/
|
|
36
|
+
cfAccessClientSecret?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Configuration for content-creation
|
|
40
|
+
*/
|
|
41
|
+
interface Config {
|
|
42
|
+
/**
|
|
43
|
+
* List of thematic areas
|
|
44
|
+
* @default []
|
|
45
|
+
*/
|
|
46
|
+
thematic?: string[];
|
|
47
|
+
/**
|
|
48
|
+
* Base directory for external template files
|
|
49
|
+
*/
|
|
50
|
+
templatesDir?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Templates configuration per content type
|
|
53
|
+
*/
|
|
54
|
+
templates?: {
|
|
55
|
+
linkedin?: LinkedInTemplateConfig;
|
|
56
|
+
youtube?: VideoTemplateConfig;
|
|
57
|
+
instagram?: VideoTemplateConfig;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Scheduling configuration
|
|
61
|
+
*/
|
|
62
|
+
scheduling?: SchedulingConfig;
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region src/index.d.ts
|
|
66
|
+
declare function defineConfig(config: Config): Config;
|
|
67
|
+
//#endregion
|
|
68
|
+
export { defineConfig };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){return e}export{e as defineConfig};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@barbapapazes/content-creation",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.15.
|
|
4
|
+
"version": "0.15.1",
|
|
5
5
|
"author": "Estéban Soubiran <esteban@soubiran.dev>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"funding": "https://github.com/sponsors/Barbapapazes",
|
|
@@ -12,6 +12,14 @@
|
|
|
12
12
|
"directory": "packages/@barbapapazes/content-creation"
|
|
13
13
|
},
|
|
14
14
|
"bugs": "https://github.com/Barbapapazes/platform/issues",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.mts",
|
|
18
|
+
"import": "./dist/index.mjs"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"main": ".dist/index.mjs",
|
|
22
|
+
"types": "./dist/index.d.mts",
|
|
15
23
|
"bin": {
|
|
16
24
|
"content-creation": "./dist/cli.mjs"
|
|
17
25
|
},
|