next-yak 0.0.35 → 0.0.39

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.
Files changed (45) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +1 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/loaders/cssloader.cjs +649 -0
  6. package/dist/loaders/cssloader.cjs.map +1 -0
  7. package/dist/loaders/cssloader.d.cts +3 -0
  8. package/dist/loaders/cssloader.d.ts +3 -0
  9. package/dist/loaders/cssloader.js +616 -0
  10. package/dist/loaders/cssloader.js.map +1 -0
  11. package/dist/loaders/tsloader.cjs +844 -0
  12. package/dist/loaders/tsloader.cjs.map +1 -0
  13. package/dist/loaders/tsloader.d.cts +6 -0
  14. package/dist/loaders/tsloader.d.ts +6 -0
  15. package/dist/loaders/tsloader.js +820 -0
  16. package/dist/loaders/tsloader.js.map +1 -0
  17. package/{withYak → dist/withYak}/index.cjs +14 -7
  18. package/dist/withYak/index.cjs.map +1 -0
  19. package/{withYak → dist/withYak}/index.d.cts +2 -2
  20. package/dist/withYak/index.d.ts +37 -0
  21. package/dist/withYak/index.js +68 -0
  22. package/dist/withYak/index.js.map +1 -0
  23. package/loaders/__tests__/classifier.test.ts +99 -93
  24. package/loaders/__tests__/cssloader.test.ts +1 -1
  25. package/loaders/__tests__/getCssName.test.ts +1 -1
  26. package/loaders/__tests__/tsloader.test.ts +1 -1
  27. package/loaders/{babel-yak-plugin.cjs → babel-yak-plugin.ts} +69 -68
  28. package/loaders/{cssloader.cjs → cssloader.ts} +73 -97
  29. package/loaders/lib/{appendCssUnitToExpressionValue.cjs → appendCssUnitToExpressionValue.ts} +7 -10
  30. package/loaders/lib/{getConstantValues.cjs → getConstantValues.ts} +10 -17
  31. package/loaders/lib/{getCssName.cjs → getCssName.ts} +19 -31
  32. package/loaders/lib/{getStyledComponentName.cjs → getStyledComponentName.ts} +7 -10
  33. package/loaders/lib/{getYakImports.cjs → getYakImports.ts} +4 -10
  34. package/loaders/lib/{hash.cjs → hash.ts} +3 -5
  35. package/loaders/lib/{localIdent.cjs → localIdent.ts} +5 -7
  36. package/loaders/lib/{quasiClassifier.cjs → quasiClassifier.ts} +7 -16
  37. package/loaders/lib/{replaceQuasiExpressionTokens.cjs → replaceQuasiExpressionTokens.ts} +27 -26
  38. package/loaders/lib/{stripCssComments.cjs → stripCssComments.ts} +3 -9
  39. package/loaders/{tsloader.cjs → tsloader.ts} +11 -15
  40. package/package.json +12 -21
  41. package/runtime/__tests__/attrs.test.tsx +4 -14
  42. package/runtime/__tests__/styled.test.tsx +25 -6
  43. package/runtime/styled.tsx +5 -5
  44. package/withYak/index.ts +43 -34
  45. package/withYak/index.cjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../loaders/lib/stripCssComments.ts","../../loaders/lib/quasiClassifier.ts","../../loaders/lib/replaceQuasiExpressionTokens.ts","../../loaders/lib/hash.ts","../../loaders/lib/localIdent.ts","../../loaders/lib/getStyledComponentName.ts","../../loaders/lib/appendCssUnitToExpressionValue.ts","../../loaders/lib/getCssName.ts","../../loaders/lib/getConstantValues.ts","../../loaders/babel-yak-plugin.ts","../../loaders/tsloader.ts","../../loaders/lib/getYakImports.ts"],"sourcesContent":["// from https://github.com/sindresorhus/strip-css-comments/tree/main\nexport default function stripCssComments(cssString: string) {\n let isInsideString: string | false = false;\n let currentCharacter = \"\";\n let comment = \"\";\n let returnValue = \"\";\n\n for (let index = 0; index < cssString.length; index++) {\n currentCharacter = cssString[index];\n\n if (\n cssString[index - 1] !== \"\\\\\" &&\n (currentCharacter === '\"' || currentCharacter === \"'\")\n ) {\n if (isInsideString === currentCharacter) {\n isInsideString = false;\n } else if (!isInsideString) {\n isInsideString = currentCharacter;\n }\n }\n\n // Find beginning of `/*` type comment\n if (\n !isInsideString &&\n currentCharacter === \"/\" &&\n cssString[index + 1] === \"*\"\n ) {\n let index2 = index + 2;\n\n // Iterate over comment\n for (; index2 < cssString.length; index2++) {\n // Find end of comment\n if (cssString[index2] === \"*\" && cssString[index2 + 1] === \"/\") {\n if (cssString[index2 + 2] === \"\\n\") {\n index2++;\n } else if (cssString[index2 + 2] + cssString[index2 + 3] === \"\\r\\n\") {\n index2 += 2;\n }\n comment = \"\";\n break;\n }\n // Store comment text\n comment += cssString[index2];\n }\n // Resume iteration over CSS string from the end of the comment\n index = index2 + 1;\n continue;\n }\n returnValue += currentCharacter;\n }\n return returnValue;\n}\n","import stripCssComments from \"./stripCssComments.js\";\n\n/**\n * Checks a quasiValue and returns its type\n *\n * - empty: no expressions, no text\n * - unknownSelector: starts with a `{` e.g. `{ opacity: 0.5; }` or `,` e.g. `, bar { ... }`\n * - insideCssValue: does not end with a `{` or `}` or `;` e.g. `color: `\n */\nexport default function quasiClassifier(\n quasiValue: string,\n currentNestingScopes: string[]\n) {\n // TODO - for better performance we could move the comment skipping logic\n // directly in the for loop below instead of calling stripCssComments\n const trimmedCssString = stripCssComments(quasiValue).trim();\n if (trimmedCssString === \"\") {\n return {\n empty: true,\n unknownSelector: false,\n insideCssValue: false,\n currentNestingScopes,\n };\n }\n let isInsideString: '\"' | \"'\" | false = false;\n let currentCharacter = \"\";\n let newNestingLevel = [...currentNestingScopes];\n let currentSelector = \"\";\n for (let index = 0; index < trimmedCssString.length; index++) {\n currentCharacter = trimmedCssString[index];\n if (\n trimmedCssString[index - 1] !== \"\\\\\" &&\n (currentCharacter === '\"' || currentCharacter === \"'\")\n ) {\n if (isInsideString === currentCharacter) {\n isInsideString = false;\n } else if (!isInsideString) {\n isInsideString = currentCharacter;\n }\n }\n if (isInsideString) {\n continue;\n }\n if (currentCharacter === \"{\") {\n const selector = currentSelector.trim();\n if (selector !== \"\") {\n newNestingLevel.push(selector);\n }\n // after an opening bracket a new selector might start e.g.:\n // .class {\n // .nested-class {\n currentSelector = \"\";\n } else if (currentCharacter === \"}\") {\n newNestingLevel.pop();\n // after a closing bracket a new selector might start e.g.:\n // .class {\n // color: red;\n // }\n // .other-class {\n currentSelector = \"\";\n } else if (currentCharacter === \";\") {\n // after a semi-colon a nested selector might start e.g.:\n // .class {\n // color: red;\n // .nested-class {\n currentSelector = \"\";\n } else {\n currentSelector += currentCharacter;\n }\n }\n\n return {\n empty: false,\n unknownSelector: trimmedCssString[0] === \"{\" || trimmedCssString[0] === \",\",\n insideCssValue:\n currentCharacter !== \"{\" &&\n currentCharacter !== \"}\" &&\n currentCharacter !== \";\",\n currentNestingScopes: newNestingLevel,\n };\n}\n","import type { NodePath, types as babelTypes } from \"@babel/core\";\n\n/**\n * Replace tokens with predefined values e.g.\n *\n * ```js\n * css`\n * color: red;\n * ${query.xs} {\n * color: blue;\n * }\n * `\n *\n * ```\n * becomes\n * ```js\n * css`\n * color: red;\n * @media (min-width: 0px) {\n * color: blue;\n * }\n * `\n * ```\n */\nexport default function replaceTokensInQuasiExpressions(\n quasi: babelTypes.TemplateLiteral,\n replacer: (name: string) => unknown,\n t: typeof babelTypes\n) {\n // Iterate over the expressions in reverse order\n // so removing items won't affect the index of the next item\n for (let i = quasi.expressions.length - 1; i >= 0; i--) {\n const expression = quasi.expressions[i];\n // break the expression into parts\n // e.g. x.y.z -> [\"x\", \"y\", \"z\"]\n const parts = getExpressionParts(expression, t);\n // find the replacement for the expression\n const replacement = parts && replacer(parts[0]);\n // if it is a nested value, find the value of the expression\n // e.g. x.y.z -> find the value of z\n const replacementValue =\n replacement && getReplacementValue(replacement, parts);\n if (replacementValue !== false && replacementValue !== null) {\n replaceExpressionAndMergeQuasis(quasi, i, replacementValue);\n }\n }\n}\n\n/**\n * Replace tokens with predefined values\n */\nfunction replaceExpressionAndMergeQuasis(\n quasi: babelTypes.TemplateLiteral,\n expressionIndex: number,\n replacement: unknown\n) {\n const stringReplacement =\n typeof replacement === \"string\"\n ? replacement\n : replacement == null\n ? \"\"\n : JSON.stringify(replacement);\n quasi.expressions.splice(expressionIndex, 1);\n quasi.quasis[expressionIndex].value.raw +=\n stringReplacement + quasi.quasis[expressionIndex + 1].value.raw;\n quasi.quasis[expressionIndex].value.cooked +=\n stringReplacement + quasi.quasis[expressionIndex + 1].value.cooked;\n quasi.quasis.splice(expressionIndex + 1, 1);\n}\n\n/**\n * Find the replacement for the expression\n *\n * searches for:\n * - `x` -> [\"x\"]\n * - `x.y` -> [\"x\", \"y\"]\n * - `x[0]` -> [\"x\", 0]\n * - `x()` -> [\"x\"]\n * - `x.y()` -> [\"x\", \"y\"]\n * - (1 + 2) -> null\n */\nfunction getExpressionParts(\n expression: babelTypes.Expression | babelTypes.TSType,\n t: typeof babelTypes\n) {\n let currentExpression = expression;\n /** @type {string[]} */\n const tokens = [];\n while (currentExpression) {\n // e.g. x\n if (t.isIdentifier(currentExpression)) {\n tokens.unshift(currentExpression.name);\n break;\n }\n // e.g. x.y\n if (t.isMemberExpression(currentExpression)) {\n if (\n currentExpression.computed === false &&\n t.isIdentifier(currentExpression.property)\n ) {\n tokens.unshift(currentExpression.property.name);\n } else if (t.isStringLiteral(currentExpression.property)) {\n tokens.unshift(currentExpression.property.value);\n } else if (t.isNumericLiteral(currentExpression.property)) {\n tokens.unshift(String(currentExpression.property.value));\n } else {\n return null;\n }\n currentExpression = currentExpression.object;\n } else if (t.isCallExpression(currentExpression)) {\n if (!t.isExpression(currentExpression.callee)) {\n return null;\n }\n currentExpression = currentExpression.callee;\n } else {\n return null;\n }\n }\n return tokens;\n}\n\n/**\n * Get the value of the replacement\n *\n * e.g. for `replacement.x.y[0]` and `replacement = { x: { y: [42] } }`\n * parts = [\"replacement\", \"x\", \"y\", 0]\n * --> 42\n */\nfunction getReplacementValue(replacement: any, parts: string[]) {\n let currentReplacement = replacement;\n for (let i = 1; i < parts.length; i++) {\n const part = parts[i];\n if (currentReplacement == null || typeof currentReplacement !== \"object\") {\n return false;\n }\n currentReplacement = currentReplacement[part];\n }\n return currentReplacement;\n}\n","/**\n * JS Implementation of MurmurHash2\n *\n * @author <a href=\"mailto:gary.court@gmail.com\">Gary Court</a>\n * @see http://github.com/garycourt/murmurhash-js\n * @author <a href=\"mailto:aappleby@gmail.com\">Austin Appleby</a>\n * @see http://sites.google.com/site/murmurhash/\n *\n * @param str ASCII only\n * @return Base 36 encoded hash result\n */\nexport default function murmurhash2_32_gc(str: string) {\n let l = str.length;\n let h = l;\n let i = 0;\n let k;\n\n while (l >= 4) {\n k =\n (str.charCodeAt(i) & 0xff) |\n ((str.charCodeAt(++i) & 0xff) << 8) |\n ((str.charCodeAt(++i) & 0xff) << 16) |\n ((str.charCodeAt(++i) & 0xff) << 24);\n\n k =\n (k & 0xffff) * 0x5bd1e995 + ((((k >>> 16) * 0x5bd1e995) & 0xffff) << 16);\n k ^= k >>> 24;\n k =\n (k & 0xffff) * 0x5bd1e995 + ((((k >>> 16) * 0x5bd1e995) & 0xffff) << 16);\n\n h =\n ((h & 0xffff) * 0x5bd1e995 +\n ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16)) ^\n k;\n\n l -= 4;\n ++i;\n } // forgive existing code\n\n /* eslint-disable no-fallthrough */ switch (l) {\n case 3:\n h ^= (str.charCodeAt(i + 2) & 0xff) << 16;\n case 2:\n h ^= (str.charCodeAt(i + 1) & 0xff) << 8;\n case 1:\n h ^= str.charCodeAt(i) & 0xff;\n h =\n (h & 0xffff) * 0x5bd1e995 +\n ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16);\n }\n /* eslint-enable no-fallthrough */\n\n h ^= h >>> 13;\n h = (h & 0xffff) * 0x5bd1e995 + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16);\n h ^= h >>> 15;\n\n return (h >>> 0).toString(36);\n}\n","/**\n * Generates local names used in the generated CSS.\n * It is also used in the js code to reference the generated CSS.\n *\n * E.g.:\n * ```ts\n * localIdent(\"myVariableName\", 1, \"selector\") // \".myVariableName_1\"\n * localIdent(\"myVariableName\", 1, \"className\") // \"myVariableName_1\"\n * localIdent(\"myVariableName\", 1, \"keyframes\") // \"@keyframes myVariableName_1\"\n * localIdent(\"myVariableName\", 1, \"animation\") // \"myVariableName_1\"\n * ```\n */\nexport default function localIdent(\n variableName: string,\n i: number | null,\n kind: \"selector\" | \"className\" | \"keyframes\" | \"animation\"\n) {\n switch (kind) {\n case \"selector\":\n return `.${variableName}${i === null ? \"\" : `_${i}`}`;\n case \"className\":\n case \"animation\":\n return `${variableName}${i === null ? \"\" : `_${i}`}`;\n case \"keyframes\":\n return `@keyframes ${variableName}${i === null ? \"\" : `_${i}`}`;\n default:\n throw new Error(\"unknown kind\");\n }\n}\n","import type { NodePath, types as babelTypes } from \"@babel/core\";\n\n/**\n * Try to get the name of a styled component from a call or member expression\n *\n * e.g. const MyButton = styled.div`...` -> \"MyButton\"\n * e.g. const FancyButton = styled(MyButton)`...` -> \"FancyButton\"\n */\nconst getStyledComponentName = (\n taggedTemplateExpressionPath: NodePath<babelTypes.TaggedTemplateExpression>\n) => {\n const variableDeclaratorPath = taggedTemplateExpressionPath.findParent(\n (path) => path.isVariableDeclarator()\n );\n if (\n !variableDeclaratorPath ||\n !(\"id\" in variableDeclaratorPath.node) ||\n variableDeclaratorPath.node.id?.type !== \"Identifier\"\n ) {\n throw new Error(\n \"Could not find variable declaration for styled component at \" +\n taggedTemplateExpressionPath.node.loc\n );\n }\n return variableDeclaratorPath.node.id.name;\n};\n\nexport default getStyledComponentName;\n","import type { types as babelTypes } from \"@babel/core\";\n\n/**\n * Extracts the css unit from a css string and checks if it is a valid CSS unit\n */\nconst appendCssUnitToExpressionValue = (\n cssUnit: string,\n expression: babelTypes.Expression,\n runtimeInternalHelpers: Set<string>,\n t: typeof babelTypes\n) => {\n if (expression.type === \"ArrowFunctionExpression\") {\n if (expression.body.type !== \"BlockStatement\") {\n const newBody = t.binaryExpression(\n \"+\",\n t.parenthesizedExpression(expression.body),\n t.stringLiteral(cssUnit)\n );\n\n const newArrowFunction = t.arrowFunctionExpression(\n expression.params,\n newBody\n );\n return newArrowFunction;\n }\n } else if (\n expression.type === \"NumericLiteral\" ||\n expression.type === \"BinaryExpression\" ||\n expression.type === \"Identifier\"\n ) {\n const cssUnitLiteral = t.stringLiteral(cssUnit);\n const binaryExpression = t.binaryExpression(\n \"+\",\n expression,\n cssUnitLiteral\n );\n return binaryExpression;\n }\n\n const callExpression = t.callExpression(t.identifier(\"__yak_unitPostFix\"), [\n expression,\n t.stringLiteral(cssUnit),\n ]);\n runtimeInternalHelpers.add(\"__yak_unitPostFix\");\n return callExpression;\n};\n\nexport default appendCssUnitToExpressionValue;\n","import type { NodePath, types as babelTypes } from \"@babel/core\";\n\n/**\n * Extracts the conditions from a path\n */\nfunction extractConditions(\n path: NodePath<babelTypes.TaggedTemplateExpression>\n) {\n const conditions: string[] = [];\n const visitedNodes = new Set();\n const getConditions = (\n node: babelTypes.Node,\n previousNode: babelTypes.Node,\n isNegated = false\n ) => {\n if (visitedNodes.has(node)) return;\n visitedNodes.add(node);\n // Support for && and || operators e.g. disabled && \"disabled\"\n if (node.type === \"LogicalExpression\") {\n if (node.operator === \"&&\") {\n getConditions(node.right, previousNode, isNegated);\n conditions.push(\"and\");\n getConditions(node.left, previousNode, isNegated);\n } else if (node.operator === \"||\") {\n getConditions(node.right, previousNode, isNegated);\n conditions.push(\"or\");\n getConditions(node.left, previousNode, isNegated);\n }\n }\n // Support for ternary operator e.g. disabled ? \"disabled\" : \"enabled\"\n else if (node.type === \"ConditionalExpression\") {\n conditions.push(\"and\");\n getConditions(node.test, previousNode, node.alternate === previousNode);\n }\n // Support for ! operator e.g. !disabled\n else if (node.type === \"UnaryExpression\" && node.operator === \"!\") {\n getConditions(node.argument, previousNode, !isNegated);\n }\n // Support for Boolean() function e.g. Boolean(disabled)\n else if (\n node.type === \"CallExpression\" &&\n node.callee.type === \"Identifier\" &&\n node.callee.name === \"Boolean\"\n ) {\n getConditions(node.arguments[0], previousNode, isNegated);\n }\n // Get the name of the variable e.g. disabled\n else if (node.type === \"Identifier\") {\n conditions.push((isNegated ? \"not_\" : \"\") + node.name);\n }\n // Get the name of a member expression e.g. props.disabled\n else if (node.type === \"MemberExpression\") {\n conditions.push(\n (isNegated ? \"not_\" : \"\") + getMemberExpressionName(node)\n );\n }\n };\n let currentPath: NodePath | null = path;\n let previousPath: NodePath = path;\n while (currentPath) {\n getConditions(currentPath.node, previousPath.node);\n previousPath = currentPath;\n currentPath = currentPath.parentPath;\n }\n if (conditions[0] === \"or\" || conditions[0] === \"and\") {\n conditions.shift();\n }\n return conditions.reverse();\n}\n\n/**\n * Try to get the name of a css component from a literal expression\n *\n * e.g. const mixin = css`...` -> \"mixin\"\n */\nconst getStyledComponentName = (\n taggedTemplateExpressionPath: NodePath<babelTypes.TaggedTemplateExpression>\n) => {\n const variableDeclaratorPath = taggedTemplateExpressionPath.findParent(\n (path) => path.isVariableDeclarator()\n );\n if (\n !variableDeclaratorPath ||\n !(\"id\" in variableDeclaratorPath.node) ||\n variableDeclaratorPath.node.id?.type !== \"Identifier\"\n ) {\n return null;\n }\n return variableDeclaratorPath.node.id.name;\n};\n\n/**\n * Try to get the name of a member expression\n *\n * e.g. props.disabled -> \"propsDisabled\"\n * e.g. props.user.disabled -> \"propsUserDisabled\n */\nfunction getMemberExpressionName(node: babelTypes.MemberExpression): string {\n if (\n !node.object ||\n !node.property ||\n (node.object.type !== \"Identifier\" &&\n node.object.type !== \"MemberExpression\")\n ) {\n return \"\";\n }\n const objectName =\n node.object.type === \"Identifier\"\n ? node.object.name\n : getMemberExpressionName(node.object);\n const property = node.property;\n let propertyName = \"\";\n if (property.type === \"Identifier\") {\n propertyName = property.name;\n } else if (property.type === \"StringLiteral\") {\n propertyName = property.value;\n }\n if (!propertyName) {\n return \"\";\n }\n return objectName + propertyName[0].toUpperCase() + propertyName.slice(1);\n}\n\n/**\n * Try to get the name of a css literal\n *\n * e.g. ({$disabled}) => $disabled && css`...` -> \"is_$disabled\"\n */\nexport default function getCssName(\n literal: NodePath<babelTypes.TaggedTemplateExpression>\n) {\n const conditions = extractConditions(literal);\n if (conditions.length === 0) {\n const mixinName = getStyledComponentName(literal);\n return mixinName ? mixinName : \"yak\";\n }\n return conditions.join(\"_\").replace(/\\$/g, \"\");\n}\n","import type { NodePath, types as babelTypes } from \"@babel/core\";\n\n/**\n * Returns the name of the expression\n */\nexport const getConstantName = (\n expression: babelTypes.Expression,\n t: typeof babelTypes\n) => {\n // e.g. styled.div`color: ${x};`\n if (t.isIdentifier(expression)) {\n // e.g. x\n return expression.name;\n } else if (\n t.isMemberExpression(expression) &&\n t.isIdentifier(expression.object)\n ) {\n // e.g. x for x.y\n return expression.object.name;\n } else if (\n t.isCallExpression(expression) &&\n t.isIdentifier(expression.callee)\n ) {\n // e.g. x for x()\n return expression.callee.name;\n } else if (\n t.isCallExpression(expression) &&\n t.isMemberExpression(expression.callee) &&\n t.isIdentifier(expression.callee.object)\n ) {\n // e.g. x for x.y()\n return expression.callee.object.name;\n } else {\n return null;\n }\n};\n\n/**\n * Extracts all top level constant values from a program path\n */\nexport function getConstantValues(\n path: NodePath<babelTypes.Program>,\n t: typeof babelTypes\n) {\n const topLevelConstBindings = new Map<string, string | number | null>();\n const bindings = Object.entries(path.scope.bindings);\n for (const [name, binding] of bindings) {\n if (binding.kind === \"module\") {\n topLevelConstBindings.set(name, null);\n continue;\n }\n if (\n binding.kind === \"let\" ||\n binding.kind === \"var\" ||\n binding.kind === \"const\"\n ) {\n // don't consider function declarations or arrow functions as constants\n if (\n !(\"init\" in binding.path.node) ||\n t.isFunctionDeclaration(binding.path.node.init) ||\n t.isArrowFunctionExpression(binding.path.node.init)\n ) {\n topLevelConstBindings.set(name, null);\n continue;\n }\n const value = binding.path.node.init;\n topLevelConstBindings.set(\n name,\n t.isStringLiteral(value) || t.isNumericLiteral(value)\n ? value.value\n : null\n );\n }\n }\n return topLevelConstBindings;\n}\n","import type babelCore from \"@babel/core\";\nimport {\n BabelFile,\n NodePath,\n PluginObj,\n PluginPass,\n types as babelTypes,\n} from \"@babel/core\";\nimport quasiClassifier from \"./lib/quasiClassifier.js\";\nimport replaceQuasiExpressionTokens from \"./lib/replaceQuasiExpressionTokens.js\";\nimport murmurhash2_32_gc from \"./lib/hash.js\";\nimport { relative, resolve, basename } from \"node:path\";\nimport localIdent from \"./lib/localIdent.js\";\nimport getStyledComponentName from \"./lib/getStyledComponentName.js\";\nimport appendCssUnitToExpressionValue from \"./lib/appendCssUnitToExpressionValue.js\";\nimport getCssName from \"./lib/getCssName.js\";\nimport { getConstantName, getConstantValues } from \"./lib/getConstantValues.js\";\n\ntype YakBabelPluginOptions = {\n replaces: Record<string, unknown>;\n rootContext?: string;\n};\n\ntype YakLocalIdentifierNames = {\n css: string | undefined;\n styled: string | undefined;\n keyframes: string | undefined;\n};\n\n/**\n * Babel plugin for typescript files that use yak - it will do things:\n * - inject the import to the css-module (with .yak.module.css extension)\n * - replace the css template literal with styles from the css-module\n */\nexport default function (\n babel: typeof babelCore,\n options: YakBabelPluginOptions\n): PluginObj<\n PluginPass & {\n localVarNames: YakLocalIdentifierNames;\n isImportedInCurrentFile: boolean;\n classNameCount: number;\n topLevelConstBindings: Map<string, number | string | null>;\n varIndex: number;\n variableNameToStyledCall: Map<\n string,\n {\n wasAdded: boolean;\n className: string;\n astNode: babelTypes.CallExpression;\n }\n >;\n yakImportPath?: NodePath<babelTypes.ImportDeclaration>;\n runtimeInternalHelpers: Set<string>;\n }\n> {\n const { replaces } = options;\n const rootContext = options.rootContext || process.cwd();\n const { types: t } = babel;\n\n /**\n * A unique prefix for each file to avoid collisions\n * (generated on first use by hashing the relative file path)\n */\n const hashedFilePaths = new WeakMap<BabelFile, string>();\n const getHashedFilePath = (file: BabelFile) => {\n const fromCache = hashedFilePaths.get(file);\n if (fromCache) {\n return fromCache;\n }\n const resourcePath = file.opts.filename;\n if (!resourcePath) {\n throw new Error(\"resourcePath is undefined\");\n }\n const relativePath = relative(\n rootContext,\n resolve(rootContext, resourcePath)\n );\n const hashedFilePath = murmurhash2_32_gc(relativePath);\n hashedFilePaths.set(file, hashedFilePath);\n return hashedFilePath;\n };\n\n /**\n * Returns wether the given tag is matching a yak import\n *\n * e.g.:\n * - css`...` -> cssLiteral\n * - styled.div`...` -> styledLiteral\n * - styled(Component)`...` -> styledCall\n * - styled.div.attrs({})`...` -> attrsCall\n * - keyframes`...` -> keyframesLiteral\n */\n const getYakExpressionType = (\n tag: babelTypes.Expression,\n localVarNames: YakLocalIdentifierNames\n ) => {\n if (t.isIdentifier(tag)) {\n if (tag.name === localVarNames.css) {\n return \"cssLiteral\";\n }\n if (tag.name === localVarNames.keyframes) {\n return \"keyframesLiteral\";\n }\n }\n if (\n t.isMemberExpression(tag) &&\n t.isIdentifier(tag.object) &&\n tag.object.name === localVarNames.styled\n ) {\n return \"styledLiteral\";\n }\n if (\n t.isCallExpression(tag) &&\n t.isIdentifier(tag.callee) &&\n tag.callee.name === localVarNames.styled\n ) {\n return \"styledCall\";\n }\n if (\n t.isCallExpression(tag) &&\n t.isMemberExpression(tag.callee) &&\n t.isIdentifier(tag.callee.property) &&\n tag.callee.property.name === \"attrs\"\n ) {\n return \"attrsCall\";\n }\n return \"unknown\";\n };\n\n return {\n name: \"next-yak\",\n pre() {\n // Initialize state variables\n this.localVarNames = {\n css: undefined,\n styled: undefined,\n keyframes: undefined,\n };\n this.isImportedInCurrentFile = false;\n this.classNameCount = 0;\n this.varIndex = 0;\n this.variableNameToStyledCall = new Map();\n this.topLevelConstBindings = new Map();\n this.runtimeInternalHelpers = new Set();\n },\n visitor: {\n Program: {\n enter(path, state) {\n this.topLevelConstBindings = getConstantValues(path, t);\n },\n exit(path, state) {\n if (this.runtimeInternalHelpers.size && this.yakImportPath) {\n const newImport = t.importDeclaration(\n [...this.runtimeInternalHelpers].map((helper) =>\n t.importSpecifier(t.identifier(helper), t.identifier(helper))\n ),\n t.stringLiteral(\"next-yak/runtime-internals\")\n );\n this.yakImportPath.insertAfter(newImport);\n }\n },\n },\n /**\n * Store the name of the imported 'css' and 'styled' variables e.g.:\n * - `import { css, styled } from 'next-yak'` -> { css: 'css', styled: 'styled' }\n * - `import { css as yakCss, styled as yakStyled } from 'next-yak'` -> { css: 'yakCss', styled: 'yakStyled' }\n *\n * Inject the import to the css-module (with .yak.module.css extension)\n * e.g. `import './App.yak.module.css!=!./App?./App.yak.module.css'`\n */\n ImportDeclaration(path, state) {\n const node = path.node;\n if (node.source.value !== \"next-yak\") {\n return;\n }\n const filePath = state.file.opts.filename;\n if (!filePath) {\n throw new Error(\"filePath is undefined\");\n }\n const fileName = basename(filePath).replace(/\\.tsx?/, \"\");\n // Import 'next-yak' styles and assign to '__styleYak'\n // use webpacks !=! syntax to pretend that the typescript file is actually a css-module\n path.insertAfter(\n t.importDeclaration(\n [t.importDefaultSpecifier(t.identifier(\"__styleYak\"))],\n t.stringLiteral(\n `./${fileName}.yak.module.css!=!./${fileName}?./${fileName}.yak.module.css`\n )\n )\n );\n this.yakImportPath = path;\n\n // Process import specifiers\n node.specifiers.forEach((specifier) => {\n if (\n !(\"imported\" in specifier) ||\n !specifier.imported ||\n !t.isIdentifier(specifier.imported)\n ) {\n return;\n }\n\n const importSpecifier = specifier.imported;\n const localSpecifier = specifier.local || importSpecifier;\n\n if (\n importSpecifier.name === \"styled\" ||\n importSpecifier.name === \"css\" ||\n importSpecifier.name === \"keyframes\"\n ) {\n this.localVarNames[importSpecifier.name] = localSpecifier.name;\n this.isImportedInCurrentFile = true;\n }\n });\n },\n /**\n * Replace the tagged template expression\n * - css`...`\n * - styled.div`...`\n * - styled(Component)`...`\n * - styled.div.attrs({})`...`\n * - keyframes`...`\n */\n TaggedTemplateExpression(path, state) {\n if (!this.isImportedInCurrentFile) {\n return;\n }\n const tag = path.node.tag;\n\n // Check if the tag name matches the imported 'css' or 'styled' variable\n const expressionType = getYakExpressionType(tag, this.localVarNames);\n if (expressionType === \"unknown\") {\n return;\n }\n\n const styledApi =\n expressionType === \"styledLiteral\" ||\n expressionType === \"styledCall\" ||\n expressionType === \"attrsCall\";\n\n replaceQuasiExpressionTokens(\n path.node.quasi,\n (name) => {\n // Replace constants from .yak files and\n if (name in replaces) {\n return replaces[name];\n }\n // Replace expressions by the className of the styled component\n // e.g.\n // const MyStyledDiv = styled.div`${FOO} { color: red; }`\n // ->\n // const MyStyledDiv = styled.div`.selector0 { color: red; }`\n const styledCall = this.variableNameToStyledCall.get(name);\n if (styledCall) {\n const { wasAdded, className, astNode } = styledCall;\n // on first usage of another styled component, ensure that\n // the className of the target component will be added to the DOM\n if (!wasAdded) {\n styledCall.wasAdded = true;\n astNode.arguments.unshift(\n t.memberExpression(\n t.identifier(\"__styleYak\"),\n t.identifier(className)\n )\n );\n }\n return className;\n }\n return false;\n },\n t\n );\n\n // Store class name for the created variable for later replacements\n // e.g. const MyStyledDiv = styled.div`color: red;`\n // \"MyStyledDiv\" -> \"selector-0\"\n const variableName =\n styledApi || expressionType === \"keyframesLiteral\"\n ? getStyledComponentName(path)\n : expressionType === \"cssLiteral\"\n ? getCssName(path)\n : null;\n\n const identifier = localIdent(\n variableName || \"_yak\",\n variableName && expressionType !== \"cssLiteral\"\n ? null\n : this.classNameCount++,\n expressionType === \"keyframesLiteral\" ? \"animation\" : \"className\"\n );\n\n let literalSelectorWasUsed = false;\n // AutoGenerate a unique className for the current template literal\n const classNameExpression = t.memberExpression(\n t.identifier(\"__styleYak\"),\n t.identifier(identifier)\n );\n\n /**\n * The expression is replaced with a call to the 'styled' or 'css' function\n * e.g. styled.div`` -> styled.div(...)\n * e.g. css`` -> css(...)\n * newArguments is a set of all arguments that will be passed to the function\n */\n const newArguments = new Set<babelTypes.Expression>();\n const quasis = path.node.quasi.quasis;\n let currentNestingScopes: string[] = [];\n const quasiTypes = quasis.map((quasi) => {\n const classification = quasiClassifier(\n quasi.value.raw,\n currentNestingScopes\n );\n currentNestingScopes = classification.currentNestingScopes;\n return classification;\n });\n\n const expressions = path.node.quasi.expressions.filter(\n (expression): expression is babelTypes.Expression =>\n t.isExpression(expression)\n );\n\n let cssVariablesInlineStyle;\n\n // Add the className if the template literal contains css\n if (\n quasiTypes.length > 1 ||\n (quasiTypes.length === 1 && !quasiTypes[0].empty)\n ) {\n newArguments.add(classNameExpression);\n literalSelectorWasUsed = true;\n }\n\n let wasInsideCssValue = false;\n for (let i = 0; i < quasis.length; i++) {\n const expression = expressions[i];\n // loop over all quasis belonging to the same css block\n const type = quasiTypes[i];\n if (type.unknownSelector) {\n const expression = expressions[i - 1];\n if (!expression) {\n throw new Error(`Invalid css \"${quasis[i].value.raw}\"`);\n }\n throw new InvalidPositionError(\n \"Expressions are not allowed as selectors\",\n expression,\n this.file\n );\n }\n\n // expressions after a partial css are converted into css variables\n if (\n expression &&\n (type.unknownSelector ||\n type.insideCssValue ||\n (type.empty && wasInsideCssValue))\n ) {\n wasInsideCssValue = true;\n // to prevent overuse of css variables, we only allow expressions\n // for css variables for arrow function expressions\n const variableName = getConstantName(expression, t);\n if (variableName && this.topLevelConstBindings.has(variableName)) {\n // Ignore constants that have a static string or number value\n const value = this.topLevelConstBindings.get(variableName);\n if (value !== null) {\n continue;\n }\n\n throw new InvalidPositionError(\n \"Possible constant used as runtime value for a css variable\\n\" +\n \"Please move the constant to a .yak import or use an arrow function\\n\" +\n \"e.g.:\\n\" +\n \"| import { primaryColor } from './foo.yak'\\n\" +\n \"| const MyStyledDiv = styled.div`color: ${primaryColor};`\",\n expression,\n this.file\n );\n }\n\n if (!cssVariablesInlineStyle) {\n cssVariablesInlineStyle = t.objectExpression([]);\n }\n const cssVariableName = `--🦬${getHashedFilePath(state.file)}${this\n .varIndex++}`;\n\n // Extracts the css unit from a css string after the current expression\n const cssUnit = quasis[i + 1]?.value.raw.match(/^([a-z]+|%)/i)?.[0];\n const transformedExpression = cssUnit\n ? appendCssUnitToExpressionValue(\n cssUnit,\n expression,\n this.runtimeInternalHelpers,\n t\n )\n : expression;\n\n // expression: `x`\n // { style: { --v0: x}}\n cssVariablesInlineStyle.properties.push(\n t.objectProperty(\n t.stringLiteral(cssVariableName),\n transformedExpression\n )\n );\n }\n // handle mixins\n else {\n wasInsideCssValue = false;\n if (expression) {\n if (quasiTypes[i].currentNestingScopes.length > 0) {\n // inside a nested scope a foreign css literal must not be used\n // as we can not forward the scope\n const isReferenceToMixin =\n t.isIdentifier(expression) || t.isCallExpression(expression);\n if (isReferenceToMixin) {\n throw new InvalidPositionError(\n `Mixins are not allowed inside nested selectors`,\n expression,\n this.file,\n \"Use an inline css literal instead or move the selector into the mixin\"\n );\n }\n }\n newArguments.add(expression);\n }\n }\n }\n\n // Add the inline style object to the arguments\n // e.g. styled.div`color: ${x};` -> styled.div({ style: { --yak43: x } })\n if (cssVariablesInlineStyle) {\n newArguments.add(\n t.objectExpression([\n t.objectProperty(\n t.stringLiteral(`style`),\n cssVariablesInlineStyle\n ),\n ])\n );\n }\n\n const styledCall = t.callExpression(tag, [...newArguments]);\n path.replaceWith(styledCall);\n\n // Store the AST node of the `styled` node for later selector replacements\n // e.g.\n // const MyStyledDiv = styled.div`color: red;`\n // const Bar = styled.div` ${MyStyledDiv} { color: blue }`\n // \"${MyStyledDiv} {\" -> \".selector-0 {\"\n if (styledApi && variableName) {\n this.variableNameToStyledCall.set(variableName, {\n wasAdded: literalSelectorWasUsed,\n className: identifier,\n astNode: styledCall,\n });\n }\n },\n },\n };\n}\n\nexport class InvalidPositionError extends Error {\n /**\n * Add the expression code that caused the error to the message\n * for better debugging\n */\n constructor(\n message: string,\n expression: babelTypes.Expression,\n file: BabelFile,\n recommendedFix?: string\n ) {\n let errorText = message;\n const line = expression.loc?.start.line ?? -1;\n if (line !== -1) {\n errorText = `line ${line}: ${errorText}`;\n }\n if (expression.start && expression.end) {\n errorText += `\\nfound: \\${${file.code.slice(\n expression.start,\n expression.end\n )}}`;\n }\n if (recommendedFix) {\n errorText += `\\n${recommendedFix}`;\n }\n super(errorText);\n }\n}\n","import babel, { BabelFileResult } from \"@babel/core\";\nimport getYakImports from \"./lib/getYakImports.js\";\nimport { InvalidPositionError } from \"./babel-yak-plugin.js\";\n\n/**\n * Loader for typescript files that use yak, it replaces the css template literal with a call to the 'styled' function\n */\nexport default async function tsloader(\n this: any,\n source: string\n): Promise<string | void> {\n // ignore files if they don't use yak\n if (!source.includes(\"next-yak\")) {\n return source;\n }\n const callback = this.async();\n const { rootContext, resourcePath } = this;\n\n /** .yak files are constant definition files */\n const isYakFile = /\\.yak\\.(j|t)sx?$/.test(resourcePath.matches);\n // The user may import constants from a .yak file\n // e.g. import { primary } from './colors.yak'\n //\n // However .yak files inside .yak files are not be compiled\n // to avoid performance overhead\n const importedYakConstants = isYakFile ? [] : getYakImports(source);\n const replaces: Record<string, unknown> = {};\n await Promise.all(\n importedYakConstants.map(async ({ imports, from }) => {\n const constantValues = await this.importModule(from, {\n layer: \"yak-importModule\",\n });\n imports.forEach(({ localName, importedName }) => {\n replaces[localName] = constantValues[importedName];\n });\n })\n );\n\n let result: BabelFileResult | null = null;\n try {\n // Compile the typescript file with babel - this will:\n // - inject the import to the css-module (with .yak.module.css extension)\n // - replace the css template literal with styles from the css-module\n result = babel.transformSync(source, {\n filename: resourcePath,\n configFile: false,\n plugins: [\n [\n \"@babel/plugin-syntax-typescript\",\n { isTSX: this.resourcePath.endsWith(\".tsx\") },\n ],\n [\n await import(\"./babel-yak-plugin.js\").then((m) => m.default),\n {\n replaces,\n rootContext,\n },\n ],\n ],\n });\n } catch (error) {\n if (error instanceof InvalidPositionError) {\n return callback(new Error(error.message));\n }\n return callback(new Error(\"babel transform failed\"));\n }\n if (!result?.code) {\n return callback(new Error(\"babel transform failed\"));\n }\n return callback(null, result.code, result.map);\n}\n","/**\n * Finds all imports in a given code string which import from a .yak file\n *\n * Uses regex to work with typescript and javascript\n * Does not support lazy imports\n */\nconst getYakImports = (code: string) => {\n const codeWithoutComments = code.replace(/\\/\\*[\\s\\S]*?\\*\\//g, \"\");\n const allImports = codeWithoutComments.matchAll(\n /(^|\\n|;)\\s*import\\s+(?:(\\w+(?:\\s+as\\s+\\w+)?)\\s*,?\\s*)?(?:{([^}]*)})?\\s+from\\s+[\"']([^'\"]+\\.yak)[\"'](;|\\n)/g\n );\n return [...allImports].map(([, , defaultImport, namedImports, from]) => {\n // parse named imports to { localName: string, importedName: string }[]\n const imports =\n namedImports?.split(\",\").map((namedImport) => {\n const [importedName, localName = importedName] = namedImport\n .replace(/^type\\s+/, \"\")\n .trim()\n .split(/\\s+as\\s+/);\n return { localName, importedName };\n }) ?? [];\n // parse default import to { localName: string, importedName: string }[]\n if (defaultImport) {\n imports.push(parseDefaultImport(defaultImport));\n }\n return { imports, from };\n });\n};\n\n/**\n * Parses a default import string\n */\nfunction parseDefaultImport(defaultImport: string) {\n const defaultImportArray = defaultImport.split(/\\s+as\\s+/);\n return {\n localName: defaultImportArray[1] ?? defaultImportArray[0],\n importedName: defaultImportArray[0],\n };\n}\n\nexport default getYakImports;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACe,SAAR,iBAAkC,WAAmB;AAC1D,MAAI,iBAAiC;AACrC,MAAI,mBAAmB;AACvB,MAAI,UAAU;AACd,MAAI,cAAc;AAElB,WAAS,QAAQ,GAAG,QAAQ,UAAU,QAAQ,SAAS;AACrD,uBAAmB,UAAU,KAAK;AAElC,QACE,UAAU,QAAQ,CAAC,MAAM,SACxB,qBAAqB,OAAO,qBAAqB,MAClD;AACA,UAAI,mBAAmB,kBAAkB;AACvC,yBAAiB;AAAA,MACnB,WAAW,CAAC,gBAAgB;AAC1B,yBAAiB;AAAA,MACnB;AAAA,IACF;AAGA,QACE,CAAC,kBACD,qBAAqB,OACrB,UAAU,QAAQ,CAAC,MAAM,KACzB;AACA,UAAI,SAAS,QAAQ;AAGrB,aAAO,SAAS,UAAU,QAAQ,UAAU;AAE1C,YAAI,UAAU,MAAM,MAAM,OAAO,UAAU,SAAS,CAAC,MAAM,KAAK;AAC9D,cAAI,UAAU,SAAS,CAAC,MAAM,MAAM;AAClC;AAAA,UACF,WAAW,UAAU,SAAS,CAAC,IAAI,UAAU,SAAS,CAAC,MAAM,QAAQ;AACnE,sBAAU;AAAA,UACZ;AACA,oBAAU;AACV;AAAA,QACF;AAEA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Aa,aAAa,IAAI;AAGtC,QAAM,YAAY,mBAAmB,KAAK,aAAa,OAAO;AAM9D,QAAM,uBAAuB,YAAY,CAAC,IAAI,sBAAc,MAAM;AAClE,QAAM,WAAoC,CAAC;AAC3C,QAAM,QAAQ;AAAA,IACZ,qBAAqB,IAAI,OAAO,EAAE,SAAS,KAAK,MAAM;AACpD,YAAM,iBAAiB,MAAM,KAAK,aAAa,MAAM;AAAA,QACnD,OAAO;AAAA,MACT,CAAC;AACD,cAAQ,QAAQ,CAAC,EAAE,WAAW,aAAa,MAAM;AAC/C,iBAAS,SAAS,IAAI,eAAe,YAAY;AAAA,MACnD,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAEA,MAAI,SAAiC;AACrC,MAAI;AAIF,aAAS,YAAAC,QAAM,cAAc,QAAQ;AAAA,MACnC,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,SAAS;AAAA,QACP;AAAA,UACE;AAAA,UACA,EAAE,OAAO,KAAK,aAAa,SAAS,MAAM,EAAE;AAAA,QAC9C;AAAA,QACA;AAAA,UACE,MAAM,kFAAgC,KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,UAC3D;AAAA,YACE;AAAA,YACA;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH,SAAS,OAAO;AACd,QAAI,iBAAiB,sBAAsB;AACzC,aAAO,SAAS,IAAI,MAAM,MAAM,OAAO,CAAC;AAAA,IAC1C;AACA,WAAO,SAAS,IAAI,MAAM,wBAAwB,CAAC;AAAA,EACrD;AACA,MAAI,CAAC,QAAQ,MAAM;AACjB,WAAO,SAAS,IAAI,MAAM,wBAAwB,CAAC;AAAA,EACrD;AACA,SAAO,SAAS,MAAM,OAAO,MAAM,OAAO,GAAG;AAC/C;","names":["getStyledComponentName","babel","styledCall","expression","variableName","babel"]}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Loader for typescript files that use yak, it replaces the css template literal with a call to the 'styled' function
3
+ */
4
+ declare function tsloader(this: any, source: string): Promise<string | void>;
5
+
6
+ export { tsloader as default };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Loader for typescript files that use yak, it replaces the css template literal with a call to the 'styled' function
3
+ */
4
+ declare function tsloader(this: any, source: string): Promise<string | void>;
5
+
6
+ export { tsloader as default };