@notifiles/sdk 1.1.7 → 1.1.9

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@notifiles/sdk",
3
3
  "type": "module",
4
- "version": "1.1.7",
4
+ "version": "1.1.9",
5
5
  "description": "",
6
6
  "author": {
7
7
  "name": "adoucoure",
@@ -22,7 +22,7 @@ export default async (props) => {
22
22
  }
23
23
 
24
24
  const postPath = fsPath.join(path, 'email.js')
25
- const postPath2 = fsPath.join(path, 'email.tsx')
25
+ const postPath2 = fsPath.join(path, 'email.react-email.tsx')
26
26
 
27
27
  return ((await checkFileExists(postPath))
28
28
  || (await checkFileExists(postPath2)))
@@ -21,6 +21,6 @@ export default async (props) => {
21
21
  return false
22
22
  }
23
23
 
24
- const manifestPath = fsPath.join(path, 'manifest.yaml')
24
+ const manifestPath = fsPath.join(path, 'notifiles.config.js')
25
25
  return checkFileExists(manifestPath)
26
26
  }
@@ -9,7 +9,7 @@ export default ({ path }) => {
9
9
  return false
10
10
  }
11
11
 
12
- const targetPath = `${path}/manifest.yaml`
12
+ const targetPath = `${path}/notifiles.config.js`
13
13
  const exists = fs.existsSync(targetPath)
14
14
  return exists
15
15
  } catch (e) {
@@ -1,7 +1,7 @@
1
- import { execa } from 'execa'
2
- import fs from 'fs'
3
- import translate from './translate.js'
4
- import htmlToHast from '../../../../lib/remark/htmlToHast.js'
1
+ import { execa } from 'execa';
2
+ import fs from 'fs';
3
+ import translate from './translate.js';
4
+ import htmlToHast from '../../../../lib/remark/htmlToHast.js';
5
5
 
6
6
  export default async (props) => {
7
7
 
@@ -11,8 +11,26 @@ export default async (props) => {
11
11
  code,
12
12
  language } = entry
13
13
 
14
- const { stdout } = await execa`npx react-email@2.1.4 export --pretty --plainText --dir ${path} --outDir ${path}/.build/temp/email/${code}/text`;
15
- const { stdoutB } = await execa`npx react-email@2.1.4 export --pretty --dir ${path} --outDir ${path}/.build/temp/email/${code}/html`;
14
+
15
+ // const a = await fs.promises.readFile(`${path}/email.react-email.tsx`, 'utf8')
16
+ // // const a = (await import(`${path}/email.react-email.tsx`))
17
+ // const component = React.createElement()
18
+ // const html_ = await renderAsync(a, {
19
+ // pretty: true,
20
+ // })
21
+
22
+
23
+ const { stdout } = await execa`npx react-email@2.1.4 export
24
+ --pretty
25
+ --plainText
26
+ --dir ${path}
27
+ --outDir ${path}/.build/temp/email/${code}/text`
28
+
29
+ const { stdoutB } = await execa`npx react-email@2.1.4 export
30
+ --pretty
31
+ --dir ${path}
32
+ --outDir ${path}/.build/temp/email/${code}/html`
33
+
16
34
 
17
35
  await fs.promises.cp(
18
36
  `${path}/.build/temp/email/${code}/html/email.html`,
@@ -2,6 +2,7 @@
2
2
  "id": "codevalidation",
3
3
  "groupId": "",
4
4
  "dependsOnUser": true,
5
+ "status": "published",
5
6
  "agent": {
6
7
  "type": "manual",
7
8
  "params": {}
@@ -4,7 +4,7 @@ import checkFileExists from '../../lib/fs/checkFileExists.js'
4
4
  import createActivityIfNeeded from '../lib/activity/createFileIfNeeded.js'
5
5
  import createManifestIfNeeded from '../lib/manifest/createFileIfNeeded.js'
6
6
  import createi18nIfNeeded from '../lib/i18n/createFileIfNeeded.js'
7
- import emailTemplate from './templates/email.tsx.js'
7
+ import emailTemplate from './templates/email.react-email.tsx.js'
8
8
  import emailTemplateMaster from './templates/email.mastered.js'
9
9
  import textmessageTemplate from './templates/textmessage.js'
10
10
  import pushnotificationTemplate from './templates/pushnotification.js'
@@ -51,7 +51,7 @@ export default async ({
51
51
  data: i18n
52
52
  })
53
53
 
54
- const emailPath = fsPath.join(folderPath, "email.tsx")
54
+ const emailPath = fsPath.join(folderPath, "email.react-email.tsx")
55
55
  const email = (emailType === 'mastered') ? await emailTemplateMaster({}) : await emailTemplate({})
56
56
  await fs.promises.writeFile(emailPath, email, 'utf8')
57
57
  await fs.promises.writeFile(fsPath.join(folderPath, "email.subject.txt"), "", 'utf8')
@@ -1,5 +1,5 @@
1
1
 
2
- test('creates a new template', async () => {
2
+ test.skip('creates a new template', async () => {
3
3
  const fsPath = (await import('path')).default
4
4
  let path = `${fsPath.resolve(process.env.TEST_MOCK_FOLDER)}`
5
5
  const operation = (await import('./index.js')).default