♻️(tokens) transform cunningham.dist.js to cunningham.ts

As of now configuration file can use the .ts extension so it
seemed more homogeneous as the bin own source code is using
Typescript.
This commit is contained in:
Nathan Vasse
2023-01-12 15:00:45 +01:00
committed by NathanVss
parent 3e10a58482
commit b0f5b94834
6 changed files with 4 additions and 13 deletions

View File

@@ -22,7 +22,7 @@
"scripts": {
"lint": "eslint . 'src/**/*.{ts,tsx}'",
"dev": "nodemon --watch 'src/bin' --ext '*' --exec 'yarn build'",
"build-bin": "cd src/bin && tsc -p tsconfig.json && tsc-alias && cp ./cunningham.dist.js ../../dist/bin && chmod +x ../../dist/bin/Main.js",
"build-bin": "cd src/bin && tsc -p tsconfig.json && tsc-alias && chmod +x ../../dist/bin/Main.js",
"build-lib": "cp dist/cunningham-tokens.ts src/lib && cd src/lib && tsc -p tsconfig.json",
"build": "yarn build-bin && yarn build-default-theme && yarn build-lib && cd ../.. && ln -sf ../../packages/tokens/dist/bin/Main.js node_modules/.bin/cunningham",
"build-default-theme": "./dist/bin/Main.js -o dist -s html -g css,js,ts",

View File

@@ -44,7 +44,7 @@ const registerTypescriptLoader = () => {
};
const getDistConfig = async () => {
const config = await import("./cunningham.dist.js");
const config = await import("./cunningham");
return config.default;
};

View File

@@ -1,4 +1,4 @@
module.exports = {
export default {
theme: {
colors: {
primary: "#002d7f",

View File

@@ -11,15 +11,6 @@ jest.mock("../Paths", () => ({
workPath: () => __dirname,
}));
jest.mock("../cunningham.dist.js", () => ({
theme: {
colors: {
primary: "#055FD2",
secondary: "#DA0000",
},
},
}));
const runBin = async (args: string) => {
const exec = util.promisify(child_process.exec);
const promise = exec(

View File

@@ -1 +1 @@
jest.mock("../cunningham.dist.js");
jest.mock("../cunningham");