@newlogic-digital/core 2.0.0-alpha.1 → 2.0.0-alpha.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/index.js +38 -11
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -63,11 +63,21 @@ const defaultOptions = {
63
63
  outputDir: resolve(process.cwd(), 'public/email'),
64
64
  appDir: resolve(process.cwd(), 'app/Templates/Emails')
65
65
  },
66
- vituum: {},
66
+ vituum: {
67
+ pages: {
68
+ dir: './src/views'
69
+ }
70
+ },
67
71
  posthtml: {},
68
- juice: {},
72
+ juice: {
73
+ paths: ['src/views/email']
74
+ },
69
75
  tailwindcss: {},
70
- send: {},
76
+ send: {
77
+ host: 'smtp.newlogic.cz',
78
+ from: 'noreply@newlogic.cz',
79
+ user: 'noreply@newlogic.cz'
80
+ },
71
81
  latte: {
72
82
  renderTransformedHtml: (filename) => dirname(filename).endsWith('email'),
73
83
  globals: {
@@ -85,7 +95,7 @@ const defaultOptions = {
85
95
  },
86
96
  code: 'node_modules/@newlogic-digital/core/latte/CodeFilter.php'
87
97
  },
88
- ignoredPaths: ['**/views/email/**/!(*.test).latte']
98
+ ignoredPaths: ['**/views/email/**/!(*.test).latte', '**/emails/!(*.test).latte']
89
99
  }
90
100
  }
91
101
 
@@ -116,18 +126,35 @@ const plugin = (options = {}) => {
116
126
  userConfig.plugins = plugins.concat(...userConfig.plugins)
117
127
  }
118
128
 
119
- if (
120
- userConfig?.server?.https !== false &&
129
+ const isHttps = userConfig?.server?.https !== false &&
121
130
  fs.existsSync(join(os.homedir(), `.ssh/${options.cert}.pem`)) &&
122
131
  fs.existsSync(join(os.homedir(), `.ssh/${options.cert}-key.pem`))
123
- ) {
124
- userConfig.server = Object.assign(userConfig.server ?? {}, {
125
- https: {
132
+
133
+ userConfig.build = Object.assign({
134
+ manifest: true,
135
+ emptyOutDir: false,
136
+ modulePreload: false,
137
+ outDir: resolve(userConfig.root ?? process.cwd(), 'public'),
138
+ rollupOptions: {
139
+ input: [
140
+ './src/views/**/*.{json,latte,twig,liquid,njk,hbs,pug,html}',
141
+ '!./src/views/**/*.{latte,twig,liquid,njk,hbs,pug,html}.json'
142
+ ]
143
+ }
144
+ }, userConfig.build ?? {})
145
+
146
+ userConfig.server = Object.assign({
147
+ host: true,
148
+ fsServe: {
149
+ strict: false
150
+ },
151
+ https: isHttps
152
+ ? {
126
153
  key: fs.readFileSync(join(os.homedir(), `.ssh/${options.cert}-key.pem`)),
127
154
  cert: fs.readFileSync(join(os.homedir(), `.ssh/${options.cert}.pem`))
128
155
  }
129
- })
130
- }
156
+ : false
157
+ }, userConfig.server ?? {})
131
158
  }
132
159
  }
133
160
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@newlogic-digital/core",
3
3
  "type": "module",
4
- "version": "2.0.0-alpha.1",
4
+ "version": "2.0.0-alpha.2",
5
5
  "main": "index.js",
6
6
  "author": "New Logic Studio s.r.o.",
7
7
  "description": "Set of tools that can be used to create modern web applications",