@navikt/aksel 5.7.2 → 5.7.4
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.
|
@@ -98,9 +98,9 @@ function getMigrationNames() {
|
|
|
98
98
|
exports.getMigrationNames = getMigrationNames;
|
|
99
99
|
function getMigrationString() {
|
|
100
100
|
let str = "";
|
|
101
|
-
Object.entries(exports.migrations).forEach(([version,
|
|
101
|
+
Object.entries(exports.migrations).forEach(([version, vMigrations]) => {
|
|
102
102
|
str += `\n${chalk_1.default.underline(version)}\n`;
|
|
103
|
-
|
|
103
|
+
vMigrations.forEach((migration) => {
|
|
104
104
|
str += `${chalk_1.default.blue(migration.value)}: ${migration.description}\n`;
|
|
105
105
|
});
|
|
106
106
|
});
|
|
@@ -11,9 +11,9 @@ function transformer(file, api) {
|
|
|
11
11
|
const root = j(file.source);
|
|
12
12
|
function addMigrationTag(node) {
|
|
13
13
|
const attributes = node.openingElement.attributes;
|
|
14
|
-
const isMigrated = attributes.find((
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const isMigrated = attributes.find((attr) => attr.type === "JSXAttribute" &&
|
|
15
|
+
attr.name.name === "data-version" &&
|
|
16
|
+
attr.value.value === "v1");
|
|
17
17
|
if (!isMigrated) {
|
|
18
18
|
attributes.push(j.jsxAttribute(j.jsxIdentifier("data-version"), j.literal("v1")));
|
|
19
19
|
}
|
|
@@ -21,7 +21,7 @@ function transformer(file, api) {
|
|
|
21
21
|
/* https://github.com/mui/material-ui/blob/master/packages/mui-codemod/src/v5.0.0/variant-prop.js */
|
|
22
22
|
function addExplicitStandardProp(node) {
|
|
23
23
|
const attributes = node.openingElement.attributes;
|
|
24
|
-
const variant = attributes.find((
|
|
24
|
+
const variant = attributes.find((attr) => attr.type === "JSXAttribute" && attr.name.name === "size");
|
|
25
25
|
if (!variant) {
|
|
26
26
|
attributes.unshift(j.jsxAttribute(j.jsxIdentifier("size"), j.literal("small")));
|
|
27
27
|
addMigrationTag(node);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const imports_1 = require("../../../utils/imports");
|
|
4
|
-
const translate_token_1 = require("../../../utils/translate-token");
|
|
5
3
|
const tokens_map_mjs_1 = require("../../../tokens-map.mjs");
|
|
4
|
+
const imports_1 = require("../../../utils/imports");
|
|
6
5
|
const lineterminator_1 = require("../../../utils/lineterminator");
|
|
6
|
+
const translate_token_1 = require("../../../utils/translate-token");
|
|
7
7
|
/**
|
|
8
8
|
* @param {import('jscodeshift').FileInfo} file
|
|
9
9
|
* @param {import('jscodeshift').API} api
|
|
@@ -18,9 +18,9 @@ function transformer(file, api) {
|
|
|
18
18
|
if (!jsImport) {
|
|
19
19
|
return src;
|
|
20
20
|
}
|
|
21
|
-
tokens_map_mjs_1.tokens.forEach((
|
|
22
|
-
const name = (0, translate_token_1.translateToken)(
|
|
23
|
-
const out = (0, translate_token_1.translateToken)(
|
|
21
|
+
tokens_map_mjs_1.tokens.forEach((token) => {
|
|
22
|
+
const name = (0, translate_token_1.translateToken)(token[0], "js");
|
|
23
|
+
const out = (0, translate_token_1.translateToken)(token[1], "js");
|
|
24
24
|
let foundName = "";
|
|
25
25
|
(0, imports_1.getImportSpecifier)(j, root, name, "@navikt/ds-tokens/dist/tokens").forEach((x) => (foundName = x.node.imported.name));
|
|
26
26
|
if (name === foundName) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@navikt/aksel",
|
|
3
|
-
"version": "5.7.
|
|
3
|
+
"version": "5.7.4",
|
|
4
4
|
"description": "Aksel command line interface. Handles css-imports, codemods and more",
|
|
5
5
|
"author": "Aksel | NAV designsystem team",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"homepage": "https://aksel.nav.no/grunnleggende/kode/kommandolinje",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@navikt/ds-css": "5.7.
|
|
32
|
+
"@navikt/ds-css": "5.7.4",
|
|
33
33
|
"axios": "1.3.6",
|
|
34
34
|
"chalk": "4.1.0",
|
|
35
35
|
"clipboardy": "^2.3.0",
|