tailwindcss 0.0.0-oxide-insiders.07fe8bf → 0.0.0-oxide-insiders.019fddb

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.
@@ -18,10 +18,18 @@ _export(exports, {
18
18
  NONE: ()=>NONE,
19
19
  resolveDebug: ()=>resolveDebug
20
20
  });
21
+ const _packageJson = /*#__PURE__*/ _interopRequireDefault(require("../../package.json"));
22
+ function _interopRequireDefault(obj) {
23
+ return obj && obj.__esModule ? obj : {
24
+ default: obj
25
+ };
26
+ }
27
+ let OXIDE_DEFAULT_ENABLED = _packageJson.default.tailwindcss.engine === "oxide";
21
28
  const env = {
22
29
  NODE_ENV: process.env.NODE_ENV,
23
30
  DEBUG: resolveDebug(process.env.DEBUG),
24
- OXIDE: process.env.OXIDE
31
+ ENGINE: _packageJson.default.tailwindcss.engine,
32
+ OXIDE: resolveBoolean(process.env.OXIDE, OXIDE_DEFAULT_ENABLED)
25
33
  };
26
34
  const contextMap = new Map();
27
35
  const configContextMap = new Map();
@@ -29,6 +37,15 @@ const contextSourcesMap = new Map();
29
37
  const sourceHashMap = new Map();
30
38
  const NOT_ON_DEMAND = new String("*");
31
39
  const NONE = Symbol("__NONE__");
40
+ function resolveBoolean(value, defaultValue) {
41
+ if (value === undefined) {
42
+ return defaultValue;
43
+ }
44
+ if (value === "0" || value === "false") {
45
+ return false;
46
+ }
47
+ return true;
48
+ }
32
49
  function resolveDebug(debug) {
33
50
  if (debug === undefined) {
34
51
  return false;
@@ -17,7 +17,7 @@ const _options = /*#__PURE__*/ _interopRequireDefault(require("postcss-load-conf
17
17
  const _processTailwindFeatures = /*#__PURE__*/ _interopRequireDefault(require("../../../processTailwindFeatures"));
18
18
  const _deps = require("./deps");
19
19
  const _utils = require("./utils");
20
- const _shared = require("../shared");
20
+ const _sharedState = require("../../../lib/sharedState");
21
21
  const _resolveConfig = /*#__PURE__*/ _interopRequireDefault(require("../../../../resolveConfig"));
22
22
  const _getModuleDependencies = /*#__PURE__*/ _interopRequireDefault(require("../../../lib/getModuleDependencies"));
23
23
  const _content = require("../../../lib/content");
@@ -142,7 +142,7 @@ let state = {
142
142
  return config;
143
143
  },
144
144
  refreshConfigDependencies (configPath) {
145
- _shared.env.DEBUG && console.time("Module dependencies");
145
+ _sharedState.env.DEBUG && console.time("Module dependencies");
146
146
  for (let file of this.configDependencies){
147
147
  delete require.cache[require.resolve(file)];
148
148
  }
@@ -152,7 +152,7 @@ let state = {
152
152
  this.configDependencies.add(dependency);
153
153
  }
154
154
  }
155
- _shared.env.DEBUG && console.timeEnd("Module dependencies");
155
+ _sharedState.env.DEBUG && console.timeEnd("Module dependencies");
156
156
  },
157
157
  readContentPaths () {
158
158
  let content = [];
@@ -160,7 +160,7 @@ let state = {
160
160
  // TODO: When we make the postcss plugin async-capable this can become async
161
161
  let files = _fastGlob.default.sync(this.contentPatterns.all);
162
162
  for (let file of files){
163
- if (_shared.env.OXIDE) {
163
+ if (_sharedState.env.OXIDE) {
164
164
  content.push({
165
165
  file,
166
166
  extension: _path.default.extname(file).slice(1)
@@ -189,26 +189,26 @@ let state = {
189
189
  this.context.changedContent = this.changedContent.splice(0);
190
190
  return this.context;
191
191
  }
192
- _shared.env.DEBUG && console.time("Searching for config");
192
+ _sharedState.env.DEBUG && console.time("Searching for config");
193
193
  var _findAtConfigPath1;
194
194
  let configPath = (_findAtConfigPath1 = (0, _findAtConfigPath.findAtConfigPath)(root, result)) !== null && _findAtConfigPath1 !== void 0 ? _findAtConfigPath1 : cliConfigPath;
195
- _shared.env.DEBUG && console.timeEnd("Searching for config");
196
- _shared.env.DEBUG && console.time("Loading config");
195
+ _sharedState.env.DEBUG && console.timeEnd("Searching for config");
196
+ _sharedState.env.DEBUG && console.time("Loading config");
197
197
  let config = this.loadConfig(configPath, content);
198
- _shared.env.DEBUG && console.timeEnd("Loading config");
199
- _shared.env.DEBUG && console.time("Creating context");
198
+ _sharedState.env.DEBUG && console.timeEnd("Loading config");
199
+ _sharedState.env.DEBUG && console.time("Creating context");
200
200
  this.context = createContext(config, []);
201
201
  Object.assign(this.context, {
202
202
  userConfigPath: configPath
203
203
  });
204
- _shared.env.DEBUG && console.timeEnd("Creating context");
205
- _shared.env.DEBUG && console.time("Resolving content paths");
204
+ _sharedState.env.DEBUG && console.timeEnd("Creating context");
205
+ _sharedState.env.DEBUG && console.time("Resolving content paths");
206
206
  this.refreshContentPaths();
207
- _shared.env.DEBUG && console.timeEnd("Resolving content paths");
207
+ _sharedState.env.DEBUG && console.timeEnd("Resolving content paths");
208
208
  if (this.watcher) {
209
- _shared.env.DEBUG && console.time("Watch new files");
209
+ _sharedState.env.DEBUG && console.time("Watch new files");
210
210
  this.watcher.refreshWatchedFiles();
211
- _shared.env.DEBUG && console.timeEnd("Watch new files");
211
+ _sharedState.env.DEBUG && console.timeEnd("Watch new files");
212
212
  }
213
213
  for (let file of this.readContentPaths()){
214
214
  this.context.changedContent.push(file);
@@ -239,7 +239,7 @@ async function createProcessor(args, cliConfigPath) {
239
239
  return {
240
240
  postcssPlugin: "tailwindcss",
241
241
  Once (root, { result }) {
242
- _shared.env.DEBUG && console.time("Compiling CSS");
242
+ _sharedState.env.DEBUG && console.time("Compiling CSS");
243
243
  (0, _processTailwindFeatures.default)(({ createContext })=>{
244
244
  console.error();
245
245
  console.error("Rebuilding...");
@@ -253,7 +253,7 @@ async function createProcessor(args, cliConfigPath) {
253
253
  });
254
254
  };
255
255
  })(root, result);
256
- _shared.env.DEBUG && console.timeEnd("Compiling CSS");
256
+ _sharedState.env.DEBUG && console.timeEnd("Compiling CSS");
257
257
  }
258
258
  };
259
259
  };
@@ -288,17 +288,17 @@ async function createProcessor(args, cliConfigPath) {
288
288
  if (!state.watcher) {
289
289
  return result;
290
290
  }
291
- _shared.env.DEBUG && console.time("Recording PostCSS dependencies");
291
+ _sharedState.env.DEBUG && console.time("Recording PostCSS dependencies");
292
292
  for (let message of result.messages){
293
293
  if (message.type === "dependency") {
294
294
  state.contextDependencies.add(message.file);
295
295
  }
296
296
  }
297
- _shared.env.DEBUG && console.timeEnd("Recording PostCSS dependencies");
297
+ _sharedState.env.DEBUG && console.timeEnd("Recording PostCSS dependencies");
298
298
  // TODO: This needs to be in a different spot
299
- _shared.env.DEBUG && console.time("Watch new files");
299
+ _sharedState.env.DEBUG && console.time("Watch new files");
300
300
  state.watcher.refreshWatchedFiles();
301
- _shared.env.DEBUG && console.timeEnd("Watch new files");
301
+ _sharedState.env.DEBUG && console.timeEnd("Watch new files");
302
302
  return result;
303
303
  }).then((result)=>{
304
304
  if (!output) {
package/lib/plugin.js CHANGED
@@ -28,9 +28,9 @@ module.exports = function tailwindcss(configOrPath) {
28
28
  let context = (0, _setupTrackingContext.default)(configOrPath);
29
29
  if (root.type === "document") {
30
30
  let roots = root.nodes.filter((node)=>node.type === "root");
31
- for (const root1 of roots){
32
- if (root1.type === "root") {
33
- (0, _processTailwindFeatures.default)(context)(root1, result);
31
+ for (const root of roots){
32
+ if (root.type === "root") {
33
+ (0, _processTailwindFeatures.default)(context)(root, result);
34
34
  }
35
35
  }
36
36
  return;
@@ -14,10 +14,10 @@ function defaults(target, ...sources) {
14
14
  target[k] = source[k];
15
15
  }
16
16
  }
17
- for (let k1 of Object.getOwnPropertySymbols(source)){
17
+ for (let k of Object.getOwnPropertySymbols(source)){
18
18
  var _target_hasOwnProperty1;
19
- if (!(target === null || target === void 0 ? void 0 : (_target_hasOwnProperty1 = target.hasOwnProperty) === null || _target_hasOwnProperty1 === void 0 ? void 0 : _target_hasOwnProperty1.call(target, k1))) {
20
- target[k1] = source[k1];
19
+ if (!(target === null || target === void 0 ? void 0 : (_target_hasOwnProperty1 = target.hasOwnProperty) === null || _target_hasOwnProperty1 === void 0 ? void 0 : _target_hasOwnProperty1.call(target, k))) {
20
+ target[k] = source[k];
21
21
  }
22
22
  }
23
23
  }
@@ -128,8 +128,8 @@ function normalizeConfig(config) {
128
128
  }
129
129
  // `config.content.transform` is optional, and can be a Function or a Record<String, Function>
130
130
  if (typeof config.content.transform === "object") {
131
- for (let value1 of Object.values(config.content.transform)){
132
- if (typeof value1 !== "function") {
131
+ for (let value of Object.values(config.content.transform)){
132
+ if (typeof value !== "function") {
133
133
  return false;
134
134
  }
135
135
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tailwindcss",
3
- "version": "0.0.0-oxide-insiders.07fe8bf",
3
+ "version": "0.0.0-oxide-insiders.019fddb",
4
4
  "description": "A utility-first CSS framework for rapidly building custom user interfaces.",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",
@@ -16,25 +16,22 @@
16
16
  "integrations/*",
17
17
  "oxide/crates/node"
18
18
  ],
19
+ "tailwindcss": {
20
+ "engine": "oxide"
21
+ },
19
22
  "scripts": {
20
- "prebuild": "npm run generate && rimraf lib",
21
- "build": "swc src --out-dir lib --copy-files",
22
- "postbuild": "esbuild lib/cli-peer-dependencies.js --bundle --platform=node --outfile=peers/index.js --define:process.env.CSS_TRANSFORMER_WASM=false",
23
- "rebuild-fixtures": "npm run build && node -r @swc/register scripts/rebuildFixtures.js",
23
+ "dev": "concurrently -n tailwind,oxide-node -c green,yellow 'npm run dev:js' 'npm run dev:rust'",
24
+ "build": "npm run build:rust && npm run build:js && npm run build:peers",
25
+ "test": "jest",
24
26
  "style": "eslint .",
25
- "pretest": "npm run generate",
26
- "test": "jest && OXIDE=1 jest",
27
- "test:integrations": "npm run test --prefix ./integrations",
28
- "install:integrations": "node scripts/install-integrations.js",
27
+ "prepublishOnly": "npm install --force && npm run build && npm run generate:types",
28
+ "dev:rust": "npm run --prefix ./oxide dev:node",
29
+ "dev:js": "npm run build:js -- --watch",
30
+ "build:rust": "npm run --prefix ./oxide build:node",
31
+ "build:js": "npm run generate:plugin-list && swc src --out-dir lib --copy-files --delete-dir-on-start",
32
+ "build:peers": "esbuild lib/cli-peer-dependencies.js --bundle --platform=node --outfile=peers/index.js --define:process.env.CSS_TRANSFORMER_WASM=false",
29
33
  "generate:plugin-list": "node -r @swc/register scripts/create-plugin-list.js",
30
- "generate:types": "node -r @swc/register scripts/generate-types.js",
31
- "generate": "npm run generate:plugin-list && npm run generate:types",
32
- "release-channel": "node ./scripts/release-channel.js",
33
- "release-notes": "node ./scripts/release-notes.js",
34
- "oxide:install": "npm run install:all --prefix ./oxide",
35
- "oxide:dev": "concurrently -n tailwind,oxide-node -c green,yellow 'npm run build -- --watch' 'npm run --prefix ./oxide dev:node'",
36
- "oxide:build": "npm run --prefix ./oxide build:node && npm run build",
37
- "prepublishOnly": "npm install --force && npm run build"
34
+ "generate:types": "node -r @swc/register scripts/generate-types.js"
38
35
  },
39
36
  "files": [
40
37
  "src/*",
@@ -45,26 +42,25 @@
45
42
  "stubs/*.stub.js",
46
43
  "nesting/*",
47
44
  "types/**/*",
48
- "oxide-node-api-shim",
49
45
  "*.d.ts",
50
46
  "*.css",
51
47
  "*.js"
52
48
  ],
53
49
  "devDependencies": {
54
50
  "@swc/cli": "0.1.59",
55
- "@swc/core": "1.3.24",
51
+ "@swc/core": "1.3.27",
56
52
  "@swc/jest": "0.2.24",
57
53
  "@swc/register": "0.1.10",
58
54
  "autoprefixer": "^10.4.13",
59
55
  "concurrently": "^7.5.0",
60
56
  "cssnano": "^5.1.14",
61
- "esbuild": "^0.16.10",
57
+ "esbuild": "^0.17.3",
62
58
  "eslint": "^8.31.0",
63
59
  "eslint-config-prettier": "^8.6.0",
64
60
  "eslint-plugin-prettier": "^4.2.1",
65
61
  "jest": "^28.1.3",
66
62
  "jest-diff": "^28.1.3",
67
- "prettier": "^2.8.1",
63
+ "prettier": "^2.8.3",
68
64
  "rimraf": "^3.0.0",
69
65
  "source-map-js": "^1.0.2",
70
66
  "turbo": "^1.7.0"
@@ -73,7 +69,7 @@
73
69
  "postcss": "^8.0.9"
74
70
  },
75
71
  "dependencies": {
76
- "@tailwindcss/oxide": "0.0.0-oxide-insiders.07fe8bf",
72
+ "@tailwindcss/oxide": "0.0.0-oxide-insiders.019fddb",
77
73
  "arg": "^5.0.2",
78
74
  "browserslist": "^4.21.4",
79
75
  "chokidar": "^3.5.3",
@@ -108,6 +104,7 @@
108
104
  ],
109
105
  "jest": {
110
106
  "testTimeout": 30000,
107
+ "globalSetup": "<rootDir>/jest/global-setup.js",
111
108
  "setupFilesAfterEnv": [
112
109
  "<rootDir>/jest/customMatchers.js"
113
110
  ],
@@ -123,6 +120,6 @@
123
120
  }
124
121
  },
125
122
  "engines": {
126
- "node": ">=12.13.0"
123
+ "node": ">=16.0.0"
127
124
  }
128
125
  }