malinajs 0.7.1-alpha → 0.7.2-a4

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/CHANGELOG.md CHANGED
@@ -1,4 +1,21 @@
1
1
 
2
+ ## 0.7.x
3
+ * refactoring, optimization, fixes
4
+ * export function
5
+ * manual event delegation @click|root
6
+ * able to delay destroying block (for animations)
7
+ * be able to off autosubscribe for import: !no-autosubscribe
8
+ * destructuring array/object for each
9
+ * functions mount, mountStatic
10
+ * each, index variable is not included by default
11
+ * reference to element is removed on destroying
12
+ * config.useGroupReferencing
13
+ * action can return destroy function (not only object)
14
+ * each-else
15
+ * else-if
16
+ * refactoring $onMount
17
+ * optional deep checking for passed props: prop={value} prop|deep={value}
18
+
2
19
  ## 0.6.x
3
20
 
4
21
  * style's attribute "global"
package/malina-esbuild.js CHANGED
@@ -11,11 +11,9 @@ process.argv.includes('-w') ? process.env.WATCH = 1 : null;
11
11
 
12
12
  const esbuildConfigPath = path.join(process.cwd(),'esbuild.config.js');
13
13
  const derverConfigPath = path.join(process.cwd(),'derver.config.js');
14
- const malinaConfigPath = path.join(process.cwd(),'malina.config.js');
15
14
 
16
15
  const esbuildConfig = fs.existsSync(esbuildConfigPath) ? require(esbuildConfigPath) : {};
17
16
  const derverConfig = fs.existsSync(derverConfigPath) ? require(derverConfigPath) : {};
18
- const malinaConfig = fs.existsSync(malinaConfigPath) ? require(malinaConfigPath) : {};
19
17
 
20
18
  // Executable
21
19
 
@@ -60,16 +58,26 @@ function malinaPlugin(options={}){
60
58
 
61
59
  const cssModules = new Map();
62
60
 
63
- options = {
64
- ...malinaConfig,
65
- ...options
66
- }
67
-
68
61
  if(options.displayVersion !== false) console.log('! Malina.js', malina.version);
69
-
62
+
70
63
  return {
71
64
  name: 'malina-plugin',
72
- setup(build) {
65
+ setup(build) {
66
+ build.onResolve({ filter: /^malinajs$/ }, async (args) => {
67
+ const runtime = await build.resolve('malinajs/runtime.js', {resolveDir: args.resolveDir});
68
+ return {
69
+ path: runtime.path,
70
+ sideEffects: false
71
+ };
72
+ });
73
+
74
+ build.onResolve({ filter: /\.(xht|ma|html)$/ }, (arg) => {
75
+ return {
76
+ path: path.resolve(arg.resolveDir,arg.path),
77
+ sideEffects: false
78
+ }
79
+ });
80
+
73
81
  build.onLoad(
74
82
  { filter: /\.(xht|ma|html)$/ },
75
83
  async (args) => {
@@ -77,13 +85,14 @@ function malinaPlugin(options={}){
77
85
  let source = await fsp.readFile(args.path, 'utf8');
78
86
 
79
87
  let ctx = await malina.compile(source,{
88
+ path: args.path,
80
89
  name: args.path.match(/([^/\\]+)\.\w+$/)[1],
81
90
  ...options
82
91
  });
83
92
 
84
93
  let code = ctx.result;
85
94
 
86
- if(!options.css && ctx.css.result){
95
+ if(ctx.css.result){
87
96
  const cssPath = args.path.replace(/\.\w+$/, ".malina.css").replace(/\\/g, "/");
88
97
  cssModules.set(cssPath,ctx.css.result);
89
98
  code += `\nimport "${cssPath}";`
@@ -112,6 +121,7 @@ async function esbuild(options={}){
112
121
  outfile: 'public/bundle.js',
113
122
  minify: true,
114
123
  bundle: true,
124
+ platform: 'node',
115
125
  plugins: [malinaPlugin()],
116
126
  ...esbuildConfig,
117
127
  ...options