tailwindcss 0.0.0-insiders.bd970d0 → 0.0.0-insiders.bda8421

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 (137) hide show
  1. package/README.md +1 -2
  2. package/lib/cli/build/deps.js +62 -0
  3. package/lib/cli/build/index.js +12 -15
  4. package/lib/cli/build/plugin.js +107 -167
  5. package/lib/cli/build/utils.js +13 -13
  6. package/lib/cli/build/watching.js +10 -10
  7. package/lib/cli/help/index.js +11 -11
  8. package/lib/cli/index.js +60 -61
  9. package/lib/cli/init/index.js +16 -16
  10. package/lib/cli-peer-dependencies.js +36 -0
  11. package/lib/cli.js +1 -1
  12. package/lib/corePluginList.js +4 -1
  13. package/lib/corePlugins.js +2018 -1905
  14. package/lib/css/preflight.css +18 -12
  15. package/lib/featureFlags.js +17 -23
  16. package/lib/index.js +1 -1
  17. package/lib/lib/cacheInvalidation.js +3 -3
  18. package/lib/lib/collapseAdjacentRules.js +6 -6
  19. package/lib/lib/collapseDuplicateDeclarations.js +1 -1
  20. package/lib/lib/content.js +39 -32
  21. package/lib/lib/defaultExtractor.js +40 -17
  22. package/lib/lib/evaluateTailwindFunctions.js +23 -23
  23. package/lib/lib/expandApplyAtRules.js +37 -18
  24. package/lib/lib/expandTailwindAtRules.js +49 -85
  25. package/lib/lib/findAtConfigPath.js +5 -5
  26. package/lib/lib/generateRules.js +82 -55
  27. package/lib/lib/getModuleDependencies.js +23 -23
  28. package/lib/lib/load-config.js +21 -6
  29. package/lib/lib/normalizeTailwindDirectives.js +36 -21
  30. package/lib/lib/offsets.js +97 -48
  31. package/lib/lib/partitionApplyAtRules.js +2 -2
  32. package/lib/lib/regex.js +5 -5
  33. package/lib/lib/resolveDefaultsAtRules.js +27 -25
  34. package/lib/lib/setupContextUtils.js +195 -167
  35. package/lib/lib/setupTrackingContext.js +4 -5
  36. package/lib/lib/sharedState.js +10 -10
  37. package/lib/lib/substituteScreenAtRules.js +4 -4
  38. package/lib/plugin.js +8 -124
  39. package/lib/postcss-plugins/nesting/index.js +2 -2
  40. package/lib/postcss-plugins/nesting/plugin.js +11 -11
  41. package/lib/processTailwindFeatures.js +3 -5
  42. package/lib/public/colors.js +264 -264
  43. package/lib/util/applyImportantSelector.js +2 -2
  44. package/lib/util/buildMediaQuery.js +2 -2
  45. package/lib/util/cloneDeep.js +1 -1
  46. package/lib/util/cloneNodes.js +33 -13
  47. package/lib/util/color.js +19 -19
  48. package/lib/util/createUtilityPlugin.js +3 -3
  49. package/lib/util/dataTypes.js +170 -113
  50. package/lib/util/defaults.js +4 -4
  51. package/lib/util/escapeClassName.js +2 -2
  52. package/lib/util/escapeCommas.js +1 -1
  53. package/lib/util/flattenColorPalette.js +2 -2
  54. package/lib/util/formatVariantSelector.js +24 -19
  55. package/lib/util/getAllConfigs.js +4 -5
  56. package/lib/util/isKeyframeRule.js +1 -1
  57. package/lib/util/isPlainObject.js +2 -2
  58. package/lib/util/isSyntacticallyValidPropertyValue.js +10 -10
  59. package/lib/util/log.js +6 -23
  60. package/lib/util/nameClass.js +4 -4
  61. package/lib/util/negateValue.js +8 -8
  62. package/lib/util/normalizeConfig.js +63 -94
  63. package/lib/util/normalizeScreens.js +18 -18
  64. package/lib/util/parseAnimationValue.js +38 -38
  65. package/lib/util/parseBoxShadowValue.js +18 -18
  66. package/lib/util/parseDependency.js +4 -4
  67. package/lib/util/parseGlob.js +4 -4
  68. package/lib/util/parseObjectStyles.js +1 -1
  69. package/lib/util/pluginUtils.js +36 -21
  70. package/lib/util/prefixSelector.js +4 -4
  71. package/lib/util/pseudoElements.js +72 -69
  72. package/lib/util/removeAlphaVariables.js +1 -1
  73. package/lib/util/resolveConfig.js +11 -15
  74. package/lib/util/resolveConfigPath.js +6 -6
  75. package/lib/util/responsive.js +1 -1
  76. package/lib/util/splitAtTopLevelOnly.js +3 -3
  77. package/lib/util/toColorValue.js +1 -1
  78. package/lib/util/toPath.js +2 -2
  79. package/lib/util/transformThemeValue.js +24 -24
  80. package/lib/util/validateConfig.js +9 -20
  81. package/lib/util/validateFormalSyntax.js +5 -5
  82. package/lib/util/withAlphaVariable.js +5 -5
  83. package/lib/value-parser/index.js +5 -5
  84. package/lib/value-parser/parse.js +43 -43
  85. package/lib/value-parser/stringify.js +11 -11
  86. package/lib/value-parser/unit.js +5 -5
  87. package/lib/value-parser/walk.js +1 -1
  88. package/nesting/index.d.ts +4 -0
  89. package/package.json +41 -36
  90. package/peers/index.js +96503 -0
  91. package/resolveConfig.d.ts +22 -3
  92. package/scripts/generate-types.js +1 -2
  93. package/scripts/release-notes.js +1 -1
  94. package/src/cli/build/deps.js +56 -0
  95. package/src/cli/build/index.js +0 -4
  96. package/src/cli/build/plugin.js +53 -85
  97. package/src/cli/build/watching.js +1 -1
  98. package/src/cli/index.js +0 -1
  99. package/src/cli-peer-dependencies.js +15 -0
  100. package/src/corePluginList.js +1 -1
  101. package/src/corePlugins.js +118 -31
  102. package/src/css/preflight.css +18 -12
  103. package/src/featureFlags.js +3 -5
  104. package/src/lib/content.js +39 -30
  105. package/src/lib/defaultExtractor.js +29 -6
  106. package/src/lib/expandApplyAtRules.js +24 -0
  107. package/src/lib/expandTailwindAtRules.js +19 -56
  108. package/src/lib/generateRules.js +39 -8
  109. package/src/lib/load-config.ts +13 -0
  110. package/src/lib/normalizeTailwindDirectives.js +27 -0
  111. package/src/lib/offsets.js +62 -3
  112. package/src/lib/resolveDefaultsAtRules.js +5 -1
  113. package/src/lib/setupContextUtils.js +79 -39
  114. package/src/plugin.js +0 -86
  115. package/src/processTailwindFeatures.js +0 -3
  116. package/src/util/cloneNodes.js +35 -14
  117. package/src/util/dataTypes.js +72 -6
  118. package/src/util/formatVariantSelector.js +7 -0
  119. package/src/util/isPlainObject.js +1 -1
  120. package/src/util/log.js +0 -24
  121. package/src/util/normalizeConfig.js +11 -38
  122. package/src/util/pluginUtils.js +20 -0
  123. package/src/util/pseudoElements.js +4 -0
  124. package/src/util/validateConfig.js +0 -10
  125. package/stubs/config.full.js +68 -8
  126. package/stubs/config.simple.js +1 -1
  127. package/stubs/postcss.config.cjs +1 -0
  128. package/stubs/postcss.config.js +1 -0
  129. package/types/config.d.ts +12 -5
  130. package/types/generated/corePluginList.d.ts +1 -1
  131. package/types/generated/default-theme.d.ts +28 -9
  132. package/types/index.d.ts +7 -3
  133. package/index.css +0 -5
  134. package/lib/lib/detectNesting.js +0 -45
  135. package/lib/lib/handleImportAtRules.js +0 -50
  136. package/src/lib/detectNesting.js +0 -47
  137. package/src/lib/handleImportAtRules.js +0 -34
@@ -20,9 +20,9 @@ function _interop_require_default(obj) {
20
20
  default: obj
21
21
  };
22
22
  }
23
- function createWatcher(args, { state, rebuild }) {
24
- let shouldPoll = args['--poll'];
25
- let shouldCoalesceWriteEvents = shouldPoll || process.platform === 'win32';
23
+ function createWatcher(args, { state , rebuild }) {
24
+ let shouldPoll = args["--poll"];
25
+ let shouldCoalesceWriteEvents = shouldPoll || process.platform === "win32";
26
26
  // Polling interval in milliseconds
27
27
  // Used only when polling or coalescing add/change events on Windows
28
28
  let pollInterval = 10;
@@ -88,7 +88,7 @@ function createWatcher(args, { state, rebuild }) {
88
88
  pendingRebuilds.add(file);
89
89
  changedContent.push({
90
90
  file,
91
- content: content !== null && content !== void 0 ? content : ()=>_fs.default.promises.readFile(file, 'utf8'),
91
+ content: content !== null && content !== void 0 ? content : ()=>_fs.default.promises.readFile(file, "utf8"),
92
92
  extension: _path.default.extname(file).slice(1)
93
93
  });
94
94
  if (_timer) {
@@ -107,12 +107,12 @@ function createWatcher(args, { state, rebuild }) {
107
107
  chain = chain.then(rebuildAndContinue, rebuildAndContinue);
108
108
  return chain;
109
109
  }
110
- watcher.on('change', (file)=>recordChangedFile(file));
111
- watcher.on('add', (file)=>recordChangedFile(file));
110
+ watcher.on("change", (file)=>recordChangedFile(file));
111
+ watcher.on("add", (file)=>recordChangedFile(file));
112
112
  // Restore watching any files that are "removed"
113
113
  // This can happen when a file is pseudo-atomically replaced (a copy is created, overwritten, the old one is unlinked, and the new one is renamed)
114
114
  // TODO: An an optimization we should allow removal when the config changes
115
- watcher.on('unlink', (file)=>{
115
+ watcher.on("unlink", (file)=>{
116
116
  file = (0, _normalizepath.default)(file);
117
117
  // Only re-add the file if it's not covered by a dynamic pattern
118
118
  if (!_micromatch.default.some([
@@ -125,8 +125,8 @@ function createWatcher(args, { state, rebuild }) {
125
125
  // will only fire a rename event for atomic writes and not a change event
126
126
  // This is very likely a chokidar bug but it's one we need to work around
127
127
  // We treat this as a change event and rebuild the CSS
128
- watcher.on('raw', (evt, filePath, meta)=>{
129
- if (evt !== 'rename') {
128
+ watcher.on("raw", (evt, filePath, meta)=>{
129
+ if (evt !== "rename" || filePath === null) {
130
130
  return;
131
131
  }
132
132
  let watchedPath = meta.watchedPath;
@@ -161,7 +161,7 @@ function createWatcher(args, { state, rebuild }) {
161
161
  // This is because the order of events and timing is different on Linux
162
162
  // @ts-ignore: TypeScript isn't picking up that content is a string here
163
163
  await recordChangedFile(filePath, ()=>content, true);
164
- } catch (e) {
164
+ } catch {
165
165
  // If reading the file fails, it's was probably a deleted temporary file
166
166
  // So we can ignore it and no rebuild is needed
167
167
  }
@@ -15,7 +15,7 @@ function _interop_require_default(obj) {
15
15
  default: obj
16
16
  };
17
17
  }
18
- function help({ message, usage, commands, options }) {
18
+ function help({ message , usage , commands , options }) {
19
19
  let indent = 2;
20
20
  // Render header
21
21
  console.log();
@@ -23,31 +23,31 @@ function help({ message, usage, commands, options }) {
23
23
  // Render message
24
24
  if (message) {
25
25
  console.log();
26
- for (let msg of message.split('\n')){
26
+ for (let msg of message.split("\n")){
27
27
  console.log(msg);
28
28
  }
29
29
  }
30
30
  // Render usage
31
31
  if (usage && usage.length > 0) {
32
32
  console.log();
33
- console.log('Usage:');
33
+ console.log("Usage:");
34
34
  for (let example of usage){
35
- console.log(' '.repeat(indent), example);
35
+ console.log(" ".repeat(indent), example);
36
36
  }
37
37
  }
38
38
  // Render commands
39
39
  if (commands && commands.length > 0) {
40
40
  console.log();
41
- console.log('Commands:');
41
+ console.log("Commands:");
42
42
  for (let command of commands){
43
- console.log(' '.repeat(indent), command);
43
+ console.log(" ".repeat(indent), command);
44
44
  }
45
45
  }
46
46
  // Render options
47
47
  if (options) {
48
48
  let groupedOptions = {};
49
49
  for (let [key, value] of Object.entries(options)){
50
- if (typeof value === 'object') {
50
+ if (typeof value === "object") {
51
51
  groupedOptions[key] = {
52
52
  ...value,
53
53
  flags: [
@@ -59,13 +59,13 @@ function help({ message, usage, commands, options }) {
59
59
  }
60
60
  }
61
61
  console.log();
62
- console.log('Options:');
63
- for (let { flags, description, deprecated } of Object.values(groupedOptions)){
62
+ console.log("Options:");
63
+ for (let { flags , description , deprecated } of Object.values(groupedOptions)){
64
64
  if (deprecated) continue;
65
65
  if (flags.length === 1) {
66
- console.log(' '.repeat(indent + 4 /* 4 = "-i, ".length */ ), flags.slice().reverse().join(', ').padEnd(20, ' '), description);
66
+ console.log(" ".repeat(indent + 4 /* 4 = "-i, ".length */ ), flags.slice().reverse().join(", ").padEnd(20, " "), description);
67
67
  } else {
68
- console.log(' '.repeat(indent), flags.slice().reverse().join(', ').padEnd(24, ' '), description);
68
+ console.log(" ".repeat(indent), flags.slice().reverse().join(", ").padEnd(24, " "), description);
69
69
  }
70
70
  }
71
71
  }
package/lib/cli/index.js CHANGED
@@ -22,7 +22,7 @@ function oneOf(...options) {
22
22
  return parsed;
23
23
  }
24
24
  }
25
- throw new Error('...');
25
+ throw new Error("...");
26
26
  }, {
27
27
  manualParsing: true
28
28
  });
@@ -31,93 +31,92 @@ let commands = {
31
31
  init: {
32
32
  run: _init.init,
33
33
  args: {
34
- '--esm': {
34
+ "--esm": {
35
35
  type: Boolean,
36
36
  description: `Initialize configuration file as ESM`
37
37
  },
38
- '--ts': {
38
+ "--ts": {
39
39
  type: Boolean,
40
40
  description: `Initialize configuration file as TypeScript`
41
41
  },
42
- '--postcss': {
42
+ "--postcss": {
43
43
  type: Boolean,
44
44
  description: `Initialize a \`postcss.config.js\` file`
45
45
  },
46
- '--full': {
46
+ "--full": {
47
47
  type: Boolean,
48
48
  description: `Include the default values for all options in the generated configuration file`
49
49
  },
50
- '-f': '--full',
51
- '-p': '--postcss'
50
+ "-f": "--full",
51
+ "-p": "--postcss"
52
52
  }
53
53
  },
54
54
  build: {
55
55
  run: _build.build,
56
56
  args: {
57
- '--input': {
57
+ "--input": {
58
58
  type: String,
59
- description: 'Input file'
59
+ description: "Input file"
60
60
  },
61
- '--output': {
61
+ "--output": {
62
62
  type: String,
63
- description: 'Output file'
63
+ description: "Output file"
64
64
  },
65
- '--watch': {
65
+ "--watch": {
66
66
  type: oneOf(String, Boolean),
67
- description: 'Watch for changes and rebuild as needed'
67
+ description: "Watch for changes and rebuild as needed"
68
68
  },
69
- '--poll': {
69
+ "--poll": {
70
70
  type: Boolean,
71
- description: 'Use polling instead of filesystem events when watching'
71
+ description: "Use polling instead of filesystem events when watching"
72
72
  },
73
- '--content': {
73
+ "--content": {
74
74
  type: String,
75
- description: 'Content paths to use for removing unused classes'
75
+ description: "Content paths to use for removing unused classes"
76
76
  },
77
- '--purge': {
77
+ "--purge": {
78
78
  type: String,
79
79
  deprecated: true
80
80
  },
81
- '--postcss': {
81
+ "--postcss": {
82
82
  type: oneOf(String, Boolean),
83
- description: 'Load custom PostCSS configuration'
83
+ description: "Load custom PostCSS configuration"
84
84
  },
85
- '--minify': {
85
+ "--minify": {
86
86
  type: Boolean,
87
- description: 'Minify the output'
87
+ description: "Minify the output"
88
88
  },
89
- '--config': {
89
+ "--config": {
90
90
  type: String,
91
- description: 'Path to a custom config file'
91
+ description: "Path to a custom config file"
92
92
  },
93
- '--no-autoprefixer': {
94
- deprecated: true,
93
+ "--no-autoprefixer": {
95
94
  type: Boolean,
96
- description: 'Disable autoprefixer'
95
+ description: "Disable autoprefixer"
97
96
  },
98
- '-c': '--config',
99
- '-i': '--input',
100
- '-o': '--output',
101
- '-m': '--minify',
102
- '-w': '--watch',
103
- '-p': '--poll'
97
+ "-c": "--config",
98
+ "-i": "--input",
99
+ "-o": "--output",
100
+ "-m": "--minify",
101
+ "-w": "--watch",
102
+ "-p": "--poll"
104
103
  }
105
104
  }
106
105
  };
107
106
  let sharedFlags = {
108
- '--help': {
107
+ "--help": {
109
108
  type: Boolean,
110
- description: 'Display usage information'
109
+ description: "Display usage information"
111
110
  },
112
- '-h': '--help'
111
+ "-h": "--help"
113
112
  };
114
113
  if (process.stdout.isTTY /* Detect redirecting output to a file */ && (process.argv[2] === undefined || process.argv.slice(2).every((flag)=>sharedFlags[flag] !== undefined))) {
115
114
  (0, _help.help)({
116
115
  usage: [
117
- 'tailwindcss [--input input.css] [--output output.css] [--watch] [options...]',
118
- 'tailwindcss init [--full] [--postcss] [options...]'
116
+ "tailwindcss [--input input.css] [--output output.css] [--watch] [options...]",
117
+ "tailwindcss init [--full] [--postcss] [options...]"
119
118
  ],
120
- commands: Object.keys(commands).filter((command)=>command !== 'build').map((command)=>`${command} [options]`),
119
+ commands: Object.keys(commands).filter((command)=>command !== "build").map((command)=>`${command} [options]`),
121
120
  options: {
122
121
  ...commands.build.args,
123
122
  ...sharedFlags
@@ -125,48 +124,48 @@ if (process.stdout.isTTY /* Detect redirecting output to a file */ && (process.
125
124
  });
126
125
  process.exit(0);
127
126
  }
128
- let command = ((arg = '')=>arg.startsWith('-') ? undefined : arg)(process.argv[2]) || 'build';
127
+ let command = ((arg = "")=>arg.startsWith("-") ? undefined : arg)(process.argv[2]) || "build";
129
128
  if (commands[command] === undefined) {
130
129
  if (_fs.default.existsSync(_path.default.resolve(command))) {
131
130
  // TODO: Deprecate this in future versions
132
131
  // Check if non-existing command, might be a file.
133
- command = 'build';
132
+ command = "build";
134
133
  } else {
135
134
  (0, _help.help)({
136
135
  message: `Invalid command: ${command}`,
137
136
  usage: [
138
- 'tailwindcss <command> [options]'
137
+ "tailwindcss <command> [options]"
139
138
  ],
140
- commands: Object.keys(commands).filter((command)=>command !== 'build').map((command)=>`${command} [options]`),
139
+ commands: Object.keys(commands).filter((command)=>command !== "build").map((command)=>`${command} [options]`),
141
140
  options: sharedFlags
142
141
  });
143
142
  process.exit(1);
144
143
  }
145
144
  }
146
145
  // Execute command
147
- let { args: flags, run } = commands[command];
146
+ let { args: flags , run } = commands[command];
148
147
  let args = (()=>{
149
148
  try {
150
149
  let result = (0, _arg.default)(Object.fromEntries(Object.entries({
151
150
  ...flags,
152
151
  ...sharedFlags
153
152
  }).filter(([_key, value])=>{
154
- var _value_type, _value;
155
- return !((_value = value) === null || _value === void 0 ? void 0 : (_value_type = _value.type) === null || _value_type === void 0 ? void 0 : _value_type.manualParsing);
153
+ var _value_type;
154
+ return !(value === null || value === void 0 ? void 0 : (_value_type = value.type) === null || _value_type === void 0 ? void 0 : _value_type.manualParsing);
156
155
  }).map(([key, value])=>[
157
156
  key,
158
- typeof value === 'object' ? value.type : value
157
+ typeof value === "object" ? value.type : value
159
158
  ])), {
160
159
  permissive: true
161
160
  });
162
161
  // Manual parsing of flags to allow for special flags like oneOf(Boolean, String)
163
- for(let i = result['_'].length - 1; i >= 0; --i){
164
- let flag = result['_'][i];
165
- if (!flag.startsWith('-')) continue;
166
- let [flagName, flagValue] = flag.split('=');
162
+ for(let i = result["_"].length - 1; i >= 0; --i){
163
+ let flag = result["_"][i];
164
+ if (!flag.startsWith("-")) continue;
165
+ let [flagName, flagValue] = flag.split("=");
167
166
  let handler = flags[flagName];
168
167
  // Resolve flagName & handler
169
- while(typeof handler === 'string'){
168
+ while(typeof handler === "string"){
170
169
  flagName = handler;
171
170
  handler = flags[handler];
172
171
  }
@@ -176,18 +175,18 @@ let args = (()=>{
176
175
  // --flag value syntax was used so we need to pull `value` from `args`
177
176
  if (flagValue === undefined) {
178
177
  // Parse args for current flag
179
- while(result['_'][offset] && !result['_'][offset].startsWith('-')){
180
- args.push(result['_'][offset++]);
178
+ while(result["_"][offset] && !result["_"][offset].startsWith("-")){
179
+ args.push(result["_"][offset++]);
181
180
  }
182
181
  // Cleanup manually parsed flags + args
183
- result['_'].splice(i, 1 + args.length);
182
+ result["_"].splice(i, 1 + args.length);
184
183
  // No args were provided, use default value defined in handler
185
184
  // One arg was provided, use that directly
186
185
  // Multiple args were provided so pass them all in an array
187
186
  flagValue = args.length === 0 ? undefined : args.length === 1 ? args[0] : args;
188
187
  } else {
189
188
  // Remove the whole flag from the args array
190
- result['_'].splice(i, 1);
189
+ result["_"].splice(i, 1);
191
190
  }
192
191
  // Set the resolved value in the `result` object
193
192
  result[flagName] = handler.type(flagValue, flagName);
@@ -198,16 +197,16 @@ let args = (()=>{
198
197
  //
199
198
  // E.g.: tailwindcss input.css -> _: ['build', 'input.css']
200
199
  // E.g.: tailwindcss build input.css -> _: ['build', 'input.css']
201
- if (result['_'][0] !== command) {
202
- result['_'].unshift(command);
200
+ if (result["_"][0] !== command) {
201
+ result["_"].unshift(command);
203
202
  }
204
203
  return result;
205
204
  } catch (err) {
206
- if (err.code === 'ARG_UNKNOWN_OPTION') {
205
+ if (err.code === "ARG_UNKNOWN_OPTION") {
207
206
  (0, _help.help)({
208
207
  message: err.message,
209
208
  usage: [
210
- 'tailwindcss <command> [options]'
209
+ "tailwindcss <command> [options]"
211
210
  ],
212
211
  options: sharedFlags
213
212
  });
@@ -216,7 +215,7 @@ let args = (()=>{
216
215
  throw err;
217
216
  }
218
217
  })();
219
- if (args['--help']) {
218
+ if (args["--help"]) {
220
219
  (0, _help.help)({
221
220
  options: {
222
221
  ...flags,
@@ -17,40 +17,40 @@ function _interop_require_default(obj) {
17
17
  };
18
18
  }
19
19
  function isESM() {
20
- const pkgPath = _path.default.resolve('./package.json');
20
+ const pkgPath = _path.default.resolve("./package.json");
21
21
  try {
22
- let pkg = JSON.parse(_fs.default.readFileSync(pkgPath, 'utf8'));
23
- return pkg.type && pkg.type === 'module';
22
+ let pkg = JSON.parse(_fs.default.readFileSync(pkgPath, "utf8"));
23
+ return pkg.type && pkg.type === "module";
24
24
  } catch (err) {
25
25
  return false;
26
26
  }
27
27
  }
28
28
  function init(args) {
29
29
  let messages = [];
30
- let isProjectESM = args['--ts'] || args['--esm'] || isESM();
31
- let syntax = args['--ts'] ? 'ts' : isProjectESM ? 'js' : 'cjs';
32
- let extension = args['--ts'] ? 'ts' : 'js';
30
+ let isProjectESM = args["--ts"] || args["--esm"] || isESM();
31
+ let syntax = args["--ts"] ? "ts" : isProjectESM ? "js" : "cjs";
32
+ let extension = args["--ts"] ? "ts" : "js";
33
33
  var _args___;
34
- let tailwindConfigLocation = _path.default.resolve((_args___ = args['_'][1]) !== null && _args___ !== void 0 ? _args___ : `./tailwind.config.${extension}`);
34
+ let tailwindConfigLocation = _path.default.resolve((_args___ = args["_"][1]) !== null && _args___ !== void 0 ? _args___ : `./tailwind.config.${extension}`);
35
35
  if (_fs.default.existsSync(tailwindConfigLocation)) {
36
36
  messages.push(`${_path.default.basename(tailwindConfigLocation)} already exists.`);
37
37
  } else {
38
- let stubContentsFile = _fs.default.readFileSync(args['--full'] ? _path.default.resolve(__dirname, '../../../stubs/config.full.js') : _path.default.resolve(__dirname, '../../../stubs/config.simple.js'), 'utf8');
39
- let stubFile = _fs.default.readFileSync(_path.default.resolve(__dirname, `../../../stubs/tailwind.config.${syntax}`), 'utf8');
38
+ let stubContentsFile = _fs.default.readFileSync(args["--full"] ? _path.default.resolve(__dirname, "../../../stubs/config.full.js") : _path.default.resolve(__dirname, "../../../stubs/config.simple.js"), "utf8");
39
+ let stubFile = _fs.default.readFileSync(_path.default.resolve(__dirname, `../../../stubs/tailwind.config.${syntax}`), "utf8");
40
40
  // Change colors import
41
- stubContentsFile = stubContentsFile.replace('../colors', 'tailwindcss/colors');
41
+ stubContentsFile = stubContentsFile.replace("../colors", "tailwindcss/colors");
42
42
  // Replace contents of {ts,js,cjs} file with the stub {simple,full}.
43
- stubFile = stubFile.replace('__CONFIG__', stubContentsFile.replace('module.exports =', '').trim()).trim() + '\n\n';
44
- _fs.default.writeFileSync(tailwindConfigLocation, stubFile, 'utf8');
43
+ stubFile = stubFile.replace("__CONFIG__", stubContentsFile.replace("module.exports =", "").trim()).trim() + "\n\n";
44
+ _fs.default.writeFileSync(tailwindConfigLocation, stubFile, "utf8");
45
45
  messages.push(`Created Tailwind CSS config file: ${_path.default.basename(tailwindConfigLocation)}`);
46
46
  }
47
- if (args['--postcss']) {
48
- let postcssConfigLocation = _path.default.resolve('./postcss.config.js');
47
+ if (args["--postcss"]) {
48
+ let postcssConfigLocation = _path.default.resolve("./postcss.config.js");
49
49
  if (_fs.default.existsSync(postcssConfigLocation)) {
50
50
  messages.push(`${_path.default.basename(postcssConfigLocation)} already exists.`);
51
51
  } else {
52
- let stubFile = _fs.default.readFileSync(isProjectESM ? _path.default.resolve(__dirname, '../../../stubs/postcss.config.js') : _path.default.resolve(__dirname, '../../../stubs/postcss.config.cjs'), 'utf8');
53
- _fs.default.writeFileSync(postcssConfigLocation, stubFile, 'utf8');
52
+ let stubFile = _fs.default.readFileSync(isProjectESM ? _path.default.resolve(__dirname, "../../../stubs/postcss.config.js") : _path.default.resolve(__dirname, "../../../stubs/postcss.config.cjs"), "utf8");
53
+ _fs.default.writeFileSync(postcssConfigLocation, stubFile, "utf8");
54
54
  messages.push(`Created PostCSS config file: ${_path.default.basename(postcssConfigLocation)}`);
55
55
  }
56
56
  }
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ lazyPostcss: function() {
13
+ return lazyPostcss;
14
+ },
15
+ lazyPostcssImport: function() {
16
+ return lazyPostcssImport;
17
+ },
18
+ lazyAutoprefixer: function() {
19
+ return lazyAutoprefixer;
20
+ },
21
+ lazyCssnano: function() {
22
+ return lazyCssnano;
23
+ }
24
+ });
25
+ function lazyPostcss() {
26
+ return require("postcss");
27
+ }
28
+ function lazyPostcssImport() {
29
+ return require("postcss-import");
30
+ }
31
+ function lazyAutoprefixer() {
32
+ return require("autoprefixer");
33
+ }
34
+ function lazyCssnano() {
35
+ return require("cssnano");
36
+ }
package/lib/cli.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
- module.exports = require('./cli/index');
3
+ module.exports = require("./cli/index");
@@ -32,6 +32,7 @@ const _default = [
32
32
  "lineClamp",
33
33
  "display",
34
34
  "aspectRatio",
35
+ "size",
35
36
  "height",
36
37
  "maxHeight",
37
38
  "minHeight",
@@ -184,5 +185,7 @@ const _default = [
184
185
  "transitionDuration",
185
186
  "transitionTimingFunction",
186
187
  "willChange",
187
- "content"
188
+ "contain",
189
+ "content",
190
+ "forcedColorAdjust"
188
191
  ];