@tailwindcss/oxide 0.0.0-insiders.dd87d75 → 0.0.0-insiders.de145c5

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 (4) hide show
  1. package/LICENSE +21 -0
  2. package/index.d.ts +27 -1
  3. package/index.js +80 -6
  4. package/package.json +32 -17
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Tailwind Labs, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/index.d.ts CHANGED
@@ -4,8 +4,34 @@
4
4
  /* auto-generated by NAPI-RS */
5
5
 
6
6
  export interface ChangedContent {
7
+ /** File path to the changed file */
7
8
  file?: string
9
+ /** Contents of the changed file */
8
10
  content?: string
11
+ /** File extension */
9
12
  extension: string
10
13
  }
11
- export function parseCandidateStringsFromFiles(changedContent: Array<ChangedContent>): Array<string>
14
+ export interface GlobEntry {
15
+ /** Base path of the glob */
16
+ base: string
17
+ /** Glob pattern */
18
+ pattern: string
19
+ }
20
+ export interface ScannerOptions {
21
+ /** Glob sources */
22
+ sources?: Array<GlobEntry>
23
+ }
24
+ export interface CandidateWithPosition {
25
+ /** The candidate string */
26
+ candidate: string
27
+ /** The position of the candidate inside the content file */
28
+ position: number
29
+ }
30
+ export declare class Scanner {
31
+ constructor(opts: ScannerOptions)
32
+ scan(): Array<string>
33
+ scanFiles(input: Array<ChangedContent>): Array<string>
34
+ getCandidatesWithPositions(input: ChangedContent): Array<CandidateWithPosition>
35
+ get files(): Array<string>
36
+ get globs(): Array<GlobEntry>
37
+ }
package/index.js CHANGED
@@ -1,3 +1,9 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /* prettier-ignore */
4
+
5
+ /* auto-generated by NAPI-RS */
6
+
1
7
  const { existsSync, readFileSync } = require('fs')
2
8
  const { join } = require('path')
3
9
 
@@ -11,7 +17,8 @@ function isMusl() {
11
17
  // For Node 10
12
18
  if (!process.report || typeof process.report.getReport !== 'function') {
13
19
  try {
14
- return readFileSync('/usr/bin/ldd', 'utf8').includes('musl')
20
+ const lddPath = require('child_process').execSync('which ldd').toString().trim()
21
+ return readFileSync(lddPath, 'utf8').includes('musl')
15
22
  } catch (e) {
16
23
  return true
17
24
  }
@@ -101,6 +108,15 @@ switch (platform) {
101
108
  }
102
109
  break
103
110
  case 'darwin':
111
+ localFileExisted = existsSync(join(__dirname, 'tailwindcss-oxide.darwin-universal.node'))
112
+ try {
113
+ if (localFileExisted) {
114
+ nativeBinding = require('./tailwindcss-oxide.darwin-universal.node')
115
+ } else {
116
+ nativeBinding = require('@tailwindcss/oxide-darwin-universal')
117
+ }
118
+ break
119
+ } catch {}
104
120
  switch (arch) {
105
121
  case 'x64':
106
122
  localFileExisted = existsSync(join(__dirname, 'tailwindcss-oxide.darwin-x64.node'))
@@ -208,14 +224,72 @@ switch (platform) {
208
224
  }
209
225
  break
210
226
  case 'arm':
227
+ if (isMusl()) {
228
+ localFileExisted = existsSync(
229
+ join(__dirname, 'tailwindcss-oxide.linux-arm-musleabihf.node')
230
+ )
231
+ try {
232
+ if (localFileExisted) {
233
+ nativeBinding = require('./tailwindcss-oxide.linux-arm-musleabihf.node')
234
+ } else {
235
+ nativeBinding = require('@tailwindcss/oxide-linux-arm-musleabihf')
236
+ }
237
+ } catch (e) {
238
+ loadError = e
239
+ }
240
+ } else {
241
+ localFileExisted = existsSync(
242
+ join(__dirname, 'tailwindcss-oxide.linux-arm-gnueabihf.node')
243
+ )
244
+ try {
245
+ if (localFileExisted) {
246
+ nativeBinding = require('./tailwindcss-oxide.linux-arm-gnueabihf.node')
247
+ } else {
248
+ nativeBinding = require('@tailwindcss/oxide-linux-arm-gnueabihf')
249
+ }
250
+ } catch (e) {
251
+ loadError = e
252
+ }
253
+ }
254
+ break
255
+ case 'riscv64':
256
+ if (isMusl()) {
257
+ localFileExisted = existsSync(
258
+ join(__dirname, 'tailwindcss-oxide.linux-riscv64-musl.node')
259
+ )
260
+ try {
261
+ if (localFileExisted) {
262
+ nativeBinding = require('./tailwindcss-oxide.linux-riscv64-musl.node')
263
+ } else {
264
+ nativeBinding = require('@tailwindcss/oxide-linux-riscv64-musl')
265
+ }
266
+ } catch (e) {
267
+ loadError = e
268
+ }
269
+ } else {
270
+ localFileExisted = existsSync(
271
+ join(__dirname, 'tailwindcss-oxide.linux-riscv64-gnu.node')
272
+ )
273
+ try {
274
+ if (localFileExisted) {
275
+ nativeBinding = require('./tailwindcss-oxide.linux-riscv64-gnu.node')
276
+ } else {
277
+ nativeBinding = require('@tailwindcss/oxide-linux-riscv64-gnu')
278
+ }
279
+ } catch (e) {
280
+ loadError = e
281
+ }
282
+ }
283
+ break
284
+ case 's390x':
211
285
  localFileExisted = existsSync(
212
- join(__dirname, 'tailwindcss-oxide.linux-arm-gnueabihf.node')
286
+ join(__dirname, 'tailwindcss-oxide.linux-s390x-gnu.node')
213
287
  )
214
288
  try {
215
289
  if (localFileExisted) {
216
- nativeBinding = require('./tailwindcss-oxide.linux-arm-gnueabihf.node')
290
+ nativeBinding = require('./tailwindcss-oxide.linux-s390x-gnu.node')
217
291
  } else {
218
- nativeBinding = require('@tailwindcss/oxide-linux-arm-gnueabihf')
292
+ nativeBinding = require('@tailwindcss/oxide-linux-s390x-gnu')
219
293
  }
220
294
  } catch (e) {
221
295
  loadError = e
@@ -236,6 +310,6 @@ if (!nativeBinding) {
236
310
  throw new Error(`Failed to load native binding`)
237
311
  }
238
312
 
239
- const { parseCandidateStringsFromFiles } = nativeBinding
313
+ const { Scanner } = nativeBinding
240
314
 
241
- module.exports.parseCandidateStringsFromFiles = parseCandidateStringsFromFiles
315
+ module.exports.Scanner = Scanner
package/package.json CHANGED
@@ -1,25 +1,33 @@
1
1
  {
2
2
  "name": "@tailwindcss/oxide",
3
- "version": "0.0.0-insiders.dd87d75",
3
+ "version": "0.0.0-insiders.de145c5",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "git+https://github.com/tailwindlabs/tailwindcss.git",
7
+ "directory": "crates/node"
8
+ },
4
9
  "main": "index.js",
5
10
  "types": "index.d.ts",
6
11
  "napi": {
7
12
  "name": "tailwindcss-oxide",
8
13
  "triples": {
9
14
  "additional": [
15
+ "armv7-linux-androideabi",
16
+ "aarch64-linux-android",
10
17
  "aarch64-apple-darwin",
11
18
  "aarch64-unknown-linux-gnu",
12
19
  "aarch64-unknown-linux-musl",
13
20
  "armv7-unknown-linux-gnueabihf",
14
21
  "x86_64-unknown-linux-musl",
15
22
  "x86_64-unknown-freebsd",
16
- "i686-pc-windows-msvc"
23
+ "i686-pc-windows-msvc",
24
+ "aarch64-pc-windows-msvc"
17
25
  ]
18
26
  }
19
27
  },
20
28
  "license": "MIT",
21
29
  "devDependencies": {
22
- "@napi-rs/cli": "^2.13.0"
30
+ "@napi-rs/cli": "^2.18.4"
23
31
  },
24
32
  "engines": {
25
33
  "node": ">= 10"
@@ -28,21 +36,28 @@
28
36
  "index.js",
29
37
  "index.d.ts"
30
38
  ],
39
+ "publishConfig": {
40
+ "provenance": true,
41
+ "access": "public"
42
+ },
43
+ "optionalDependencies": {
44
+ "@tailwindcss/oxide-android-arm64": "0.0.0-insiders.de145c5",
45
+ "@tailwindcss/oxide-darwin-x64": "0.0.0-insiders.de145c5",
46
+ "@tailwindcss/oxide-freebsd-x64": "0.0.0-insiders.de145c5",
47
+ "@tailwindcss/oxide-linux-arm-gnueabihf": "0.0.0-insiders.de145c5",
48
+ "@tailwindcss/oxide-linux-arm64-gnu": "0.0.0-insiders.de145c5",
49
+ "@tailwindcss/oxide-darwin-arm64": "0.0.0-insiders.de145c5",
50
+ "@tailwindcss/oxide-win32-x64-msvc": "0.0.0-insiders.de145c5",
51
+ "@tailwindcss/oxide-win32-arm64-msvc": "0.0.0-insiders.de145c5",
52
+ "@tailwindcss/oxide-linux-arm64-musl": "0.0.0-insiders.de145c5",
53
+ "@tailwindcss/oxide-linux-x64-gnu": "0.0.0-insiders.de145c5",
54
+ "@tailwindcss/oxide-linux-x64-musl": "0.0.0-insiders.de145c5"
55
+ },
31
56
  "scripts": {
32
57
  "artifacts": "napi artifacts",
33
- "build": "napi build --platform --release",
34
- "build:debug": "napi build --platform",
58
+ "build": "napi build --platform --release --no-const-enum",
59
+ "dev": "cargo watch --quiet --shell 'npm run build'",
60
+ "build:debug": "napi build --platform --no-const-enum",
35
61
  "version": "napi version"
36
- },
37
- "optionalDependencies": {
38
- "@tailwindcss/oxide-darwin-arm64": "0.0.0-insiders.dd87d75",
39
- "@tailwindcss/oxide-darwin-x64": "0.0.0-insiders.dd87d75",
40
- "@tailwindcss/oxide-freebsd-x64": "0.0.0-insiders.dd87d75",
41
- "@tailwindcss/oxide-linux-arm-gnueabihf": "0.0.0-insiders.dd87d75",
42
- "@tailwindcss/oxide-linux-arm64-gnu": "0.0.0-insiders.dd87d75",
43
- "@tailwindcss/oxide-linux-arm64-musl": "0.0.0-insiders.dd87d75",
44
- "@tailwindcss/oxide-linux-x64-gnu": "0.0.0-insiders.dd87d75",
45
- "@tailwindcss/oxide-linux-x64-musl": "0.0.0-insiders.dd87d75",
46
- "@tailwindcss/oxide-win32-x64-msvc": "0.0.0-insiders.dd87d75"
47
62
  }
48
- }
63
+ }