@transferwise/neptune-css 0.0.0-experimental-db01d2f → 0.0.0-experimental-d024c8c

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.
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Thu, 23 Feb 2023 10:44:58 GMT
3
+ // Generated on Thu, 27 Apr 2023 22:20:02 GMT
4
4
 
5
5
  @color-dark-content-primary: #e2e6e8;
6
6
  @color-dark-content-secondary: #c9cbce;
@@ -219,7 +219,7 @@
219
219
  @font-family-display: 'Wise Sans', 'Inter', sans-serif;
220
220
 
221
221
  // Do not edit directly
222
- // Generated on Thu, 23 Feb 2023 10:44:58 GMT
222
+ // Generated on Thu, 27 Apr 2023 22:20:01 GMT
223
223
 
224
224
  @color-base-blue-light: #00b9ff;
225
225
  @color-base-blue-mid: #00a2dd;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 23 Feb 2023 10:44:58 GMT
3
+ * Generated on Thu, 27 Apr 2023 22:20:02 GMT
4
4
  */
5
5
 
6
6
  :root {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@transferwise/neptune-css",
3
3
  "description": "Neptune CSS library",
4
- "version": "0.0.0-experimental-db01d2f",
4
+ "version": "0.0.0-experimental-d024c8c",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -20,22 +20,15 @@
20
20
  "files": [
21
21
  "dist",
22
22
  "src",
23
- "scripts",
24
- "upgrades/scripts"
23
+ "scripts"
25
24
  ],
26
25
  "dependencies": {
27
- "@transferwise/neptune-tokens": "^8.4.0",
28
- "inquirer": "^8.2.0",
29
- "inquirer-file-tree-selection-prompt": "^1.0.13",
30
- "replace-in-file": "6.3.5"
26
+ "@transferwise/neptune-tokens": "^8.5.0"
31
27
  },
32
28
  "devDependencies": {
33
29
  "yargs": "^17.1.1",
34
30
  "@transferwise/less-config": "3.0.6"
35
31
  },
36
- "bin": {
37
- "neptune-css-upgrade-util": "scripts/neptune-css-upgrader.js"
38
- },
39
32
  "publishConfig": {
40
33
  "access": "public"
41
34
  },
@@ -1,106 +0,0 @@
1
- #!/usr/bin/env node
2
- /* eslint-disable no-console, compat/compat */
3
-
4
- const { exec } = require('child_process');
5
- const path = require('path');
6
-
7
- const inquirer = require('inquirer');
8
- const inquirerFileTreeSelection = require('inquirer-file-tree-selection-prompt');
9
-
10
- inquirer.registerPrompt('file-tree-selection', inquirerFileTreeSelection);
11
-
12
- const IGNORE_PATTERN = '**/node_modules/*';
13
- const EXTENSIONS = {
14
- LESS: 'less',
15
- CSS: 'css',
16
- BOTH: 'less,css',
17
- };
18
-
19
- const fetchSettings = () => {
20
- const questions = [
21
- {
22
- name: 'upgradeScript',
23
- type: 'file-tree-selection',
24
- root: path.join(__dirname, '../upgrades/scripts'),
25
- message: '✨ Which upgrade would you like to run?',
26
- },
27
- {
28
- type: 'list',
29
- name: 'extension',
30
- message: '✨ What file extensions should I look at?',
31
- choices: Object.values(EXTENSIONS),
32
- },
33
- {
34
- name: 'files',
35
- type: 'file-tree-selection',
36
- onlyShowDir: true,
37
- root: process.cwd(),
38
- message: '✨ And what directory would you like to transform?',
39
- },
40
- ];
41
- return inquirer.prompt(questions);
42
- };
43
-
44
- const fetchOptions = () => {
45
- const questions = [
46
- {
47
- name: 'dry',
48
- type: 'confirm',
49
- message: '✨ Dry run? (no changes are made to files)',
50
- },
51
- {
52
- name: 'verbose',
53
- type: 'confirm',
54
- message: '✨ Extra logging?',
55
- default: false,
56
- },
57
- ];
58
- return inquirer.prompt(questions);
59
- };
60
-
61
- const okToProceed = () => {
62
- const questions = [
63
- {
64
- name: 'confirm',
65
- type: 'confirm',
66
- message: 'Does everything look ok?',
67
- },
68
- ];
69
- return inquirer.prompt(questions);
70
- };
71
-
72
- const run = async () => {
73
- const { upgradeScript, extension, files } = await fetchSettings();
74
- const { dry, verbose } = await fetchOptions();
75
-
76
- console.log(`✨ Please review the following:`);
77
- console.log(`✨ Upgrade script: ${upgradeScript}`);
78
- console.log(`✨ File extension(s): ${extension}`);
79
- console.log(`✨ Directory: ${files}`);
80
- console.log(`✨ Dry run: ${dry}`);
81
-
82
- const { confirm } = await okToProceed();
83
-
84
- const config = `--files=${files} --extensions=${extension} --ignore=${IGNORE_PATTERN}`;
85
- const options = `${dry ? '--dry' : ''} ${verbose ? '--verbose' : ''}`;
86
-
87
- const handleOutput = (error, stdout, stderr) => {
88
- if (error) {
89
- console.log(stderr);
90
- return;
91
- }
92
- console.log(stdout);
93
- };
94
-
95
- const command = `node ${upgradeScript} ${config} ${options}`;
96
-
97
- if (confirm) {
98
- console.log('🚀 Running codemod, please wait a few seconds...');
99
- console.log(command);
100
- exec(command, handleOutput);
101
- } else {
102
- console.log('👋 Exiting');
103
- }
104
- };
105
-
106
- run();
@@ -1,61 +0,0 @@
1
- #!/usr/bin/env node
2
- /* eslint-disable no-console, compat/compat */
3
-
4
- const replace = require('replace-in-file');
5
- const { argv } = require('yargs');
6
-
7
- const mappings = {
8
- 'color-text-primary': 'color-content-primary',
9
- 'color-text-secondary': 'color-content-secondary',
10
- 'color-text-link': 'color-content-accent',
11
- 'color-text-link-hover': 'color-content-accent-hover',
12
- 'color-text-link-active': 'color-content-accent-active',
13
- 'color-text-positive': 'color-content-positive',
14
- 'color-text-negative': 'color-content-negative',
15
- 'color-text-warning': 'color-content-warning',
16
- 'color-text-inactive': 'color-content-disabled',
17
- 'color-text-important': 'color-content-primary',
18
- 'color-control-accent': 'color-interactive-accent',
19
- 'color-control-accent-hover': 'color-interactive-accent-hover',
20
- 'color-control-accent-active': 'color-interactive-accent-active',
21
- 'color-control-positive': 'color-interactive-positive',
22
- 'color-control-positive-hover': 'color-interactive-positive-hover',
23
- 'color-control-positive-active': 'color-interactive-positive-active',
24
- 'color-control-negative': 'color-interactive-negative',
25
- 'color-control-negative-hover': 'color-interactive-negative-hover',
26
- 'color-control-negative-active': 'color-interactive-negative-active',
27
- 'color-control-warning': 'color-interactive-warning',
28
- 'color-control-warning-hover': 'color-interactive-warning-hover',
29
- 'color-control-warning-active': 'color-interactive-warning-active',
30
- 'color-border-focus': 'color-accent',
31
- 'color-border-positive': 'color-positive',
32
- 'color-border-warning': 'color-warning',
33
- 'color-border-negative': 'color-negative',
34
- };
35
-
36
- // Special case mappings that are not exchanging variable for variable
37
- const from = [new RegExp('@color-text-control', 'g'), /var\(--color-text-control\)/g];
38
- const to = ['#fff', '#fff'];
39
-
40
- Object.keys(mappings).forEach((value) => {
41
- from.push(new RegExp(`@${value}`, 'g'));
42
- from.push(new RegExp(`--${value}`, 'g'));
43
- });
44
-
45
- Object.values(mappings).forEach((value) => {
46
- to.push(`@${value}`);
47
- to.push(`--${value}`);
48
- });
49
-
50
- const { files, dry, verbose, extensions, ignore } = argv;
51
-
52
- const options = {
53
- files: `${files}/**/*.{${extensions}}`,
54
- from,
55
- to,
56
- dry: !!dry,
57
- verbose: !!verbose,
58
- ignore,
59
- };
60
-
61
- replace(options);