@odoo/owl 2.5.1 → 2.6.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odoo/owl",
3
- "version": "2.5.1",
3
+ "version": "2.6.0",
4
4
  "description": "Odoo Web Library (OWL)",
5
5
  "main": "dist/owl.cjs.js",
6
6
  "module": "dist/owl.es.js",
@@ -32,7 +32,10 @@
32
32
  "check-formatting": "prettier {src/*.ts,src/**/*.ts,tests/*.ts,tests/**/*.ts,doc/*.md,doc/**/*.md,tools/devtools/**/*.js} --check",
33
33
  "lint": "eslint src/**/*.ts tests/**/*.ts",
34
34
  "release": "node tools/release.js",
35
- "compile_templates": "node tools/compile_xml.js"
35
+ "compile_templates": "node tools/compile_owl_templates.mjs"
36
+ },
37
+ "bin": {
38
+ "compile_owl_templates": "tools/compile_owl_templates.mjs"
36
39
  },
37
40
  "repository": {
38
41
  "type": "git",
@@ -46,6 +49,7 @@
46
49
  "homepage": "https://github.com/odoo/owl#readme",
47
50
  "devDependencies": {
48
51
  "@types/jest": "^27.0.1",
52
+ "@types/jsdom": "^21.1.7",
49
53
  "@types/node": "^14.11.8",
50
54
  "@typescript-eslint/eslint-plugin": "5.48.1",
51
55
  "@typescript-eslint/parser": "5.48.1",
@@ -97,5 +101,8 @@
97
101
  "prettier": {
98
102
  "printWidth": 100,
99
103
  "endOfLine": "auto"
104
+ },
105
+ "dependencies": {
106
+ "jsdom": "^25.0.1"
100
107
  }
101
108
  }
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env node
2
+
3
+ // this is the "compile_owl_templates" command that owl makes available when
4
+ // installed as a node_module.
5
+ import { existsSync, mkdirSync, writeFileSync } from "fs";
6
+ import { dirname } from "path";
7
+ import { compileTemplates } from "../dist/compile_templates.mjs";
8
+ import { parseArgs } from "util";
9
+
10
+ const { values, positionals } = parseArgs({
11
+ allowPositionals: true,
12
+ options: {
13
+ output: {
14
+ type: "string",
15
+ short: "o",
16
+ default: "templates.js",
17
+ },
18
+ },
19
+ });
20
+
21
+ if (positionals.length) {
22
+ const result = await compileTemplates(positionals);
23
+ const outputPath = values.output;
24
+ const dir = dirname(outputPath);
25
+ if (!existsSync(dir)) {
26
+ mkdirSync(dir, { recursive: true });
27
+ }
28
+ writeFileSync(outputPath, result);
29
+ } else {
30
+ console.log("Please provide a path");
31
+ }