@navita/engine 0.0.7 → 0.0.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/index.d.ts CHANGED
@@ -11,6 +11,7 @@ type UsedIdCache = {
11
11
  [key in CacheKeys]?: (string | number)[];
12
12
  };
13
13
  type Options = {
14
+ context?: string;
14
15
  enableSourceMaps?: boolean;
15
16
  enableDebugIdentifiers?: boolean;
16
17
  };
package/index.js CHANGED
@@ -154,7 +154,8 @@ function printSourceMap(sourceMapReferences, content) {
154
154
  return content;
155
155
  }
156
156
  const sourceMap$1 = new sourceMap.SourceMapGenerator({
157
- file: "navita.css"
157
+ file: "navita.css",
158
+ skipValidation: true
158
159
  });
159
160
  const references = entries.flatMap(([filePath, references])=>references.map((reference)=>({
160
161
  filePath,
@@ -752,10 +753,11 @@ class Engine {
752
753
  const { name } = path.parse(filePath);
753
754
  const extraClass = this.options.enableDebugIdentifiers ? `${name}_${identifier}` : '';
754
755
  const selector = '.' + classList.toString().split(' ').concat(extraClass).filter(Boolean).join('.');
755
- if (index === 0 || !this.sourceMapReferences[filePath]) {
756
- this.sourceMapReferences[filePath] = [];
756
+ const newFilePath = path.relative(this.options.context || process.cwd(), filePath);
757
+ if (index === 0 || !this.sourceMapReferences[newFilePath]) {
758
+ this.sourceMapReferences[newFilePath] = [];
757
759
  }
758
- this.sourceMapReferences[filePath][index] = {
760
+ this.sourceMapReferences[newFilePath][index] = {
759
761
  selector,
760
762
  line,
761
763
  column
package/index.mjs CHANGED
@@ -152,7 +152,8 @@ function printSourceMap(sourceMapReferences, content) {
152
152
  return content;
153
153
  }
154
154
  const sourceMap = new SourceMapGenerator({
155
- file: "navita.css"
155
+ file: "navita.css",
156
+ skipValidation: true
156
157
  });
157
158
  const references = entries.flatMap(([filePath, references])=>references.map((reference)=>({
158
159
  filePath,
@@ -750,10 +751,11 @@ class Engine {
750
751
  const { name } = path.parse(filePath);
751
752
  const extraClass = this.options.enableDebugIdentifiers ? `${name}_${identifier}` : '';
752
753
  const selector = '.' + classList.toString().split(' ').concat(extraClass).filter(Boolean).join('.');
753
- if (index === 0 || !this.sourceMapReferences[filePath]) {
754
- this.sourceMapReferences[filePath] = [];
754
+ const newFilePath = path.relative(this.options.context || process.cwd(), filePath);
755
+ if (index === 0 || !this.sourceMapReferences[newFilePath]) {
756
+ this.sourceMapReferences[newFilePath] = [];
755
757
  }
756
- this.sourceMapReferences[filePath][index] = {
758
+ this.sourceMapReferences[newFilePath][index] = {
757
759
  selector,
758
760
  line,
759
761
  column
package/package.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "name": "@navita/engine",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
+ "description": "Navitas CSS-in-JS engine",
5
+ "keywords": [
6
+ "css-in-js",
7
+ "engine",
8
+ "navita"
9
+ ],
4
10
  "private": false,
5
11
  "sideEffects": false,
6
12
  "exports": {