tailwindcss 3.2.6 → 3.3.0
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.
- package/CHANGELOG.md +52 -8
- package/lib/cli/build/index.js +7 -3
- package/lib/cli/build/plugin.js +28 -19
- package/lib/cli/build/watching.js +4 -2
- package/lib/cli/index.js +12 -21
- package/lib/cli/init/index.js +21 -6
- package/lib/corePluginList.js +4 -0
- package/lib/corePlugins.js +282 -26
- package/lib/css/preflight.css +2 -0
- package/lib/featureFlags.js +8 -1
- package/lib/lib/expandApplyAtRules.js +2 -1
- package/lib/lib/generateRules.js +20 -16
- package/lib/lib/getModuleDependencies.js +79 -33
- package/lib/lib/load-config.js +36 -0
- package/lib/lib/setupContextUtils.js +10 -2
- package/lib/lib/setupTrackingContext.js +4 -4
- package/lib/oxide/cli/build/index.js +7 -3
- package/lib/oxide/cli/build/plugin.js +27 -18
- package/lib/oxide/cli/build/watching.js +1 -1
- package/lib/oxide/cli/index.js +10 -16
- package/lib/oxide/cli/init/index.js +19 -4
- package/lib/public/colors.js +44 -22
- package/lib/public/default-config.js +2 -2
- package/lib/public/default-theme.js +2 -2
- package/lib/public/load-config.js +10 -0
- package/lib/util/applyImportantSelector.js +22 -0
- package/lib/util/dataTypes.js +3 -0
- package/lib/util/formatVariantSelector.js +2 -12
- package/lib/util/getAllConfigs.js +2 -2
- package/lib/util/normalizeConfig.js +16 -3
- package/lib/util/pluginUtils.js +14 -26
- package/lib/util/resolveConfigPath.js +19 -7
- package/lib/util/splitAtTopLevelOnly.js +7 -1
- package/loadConfig.d.ts +4 -0
- package/loadConfig.js +2 -0
- package/package.json +5 -4
- package/src/cli/build/index.js +7 -7
- package/src/cli/build/plugin.js +28 -23
- package/src/cli/build/watching.js +4 -2
- package/src/cli/index.js +8 -26
- package/src/cli/init/index.js +37 -8
- package/src/corePluginList.js +1 -1
- package/src/corePlugins.js +184 -27
- package/src/css/preflight.css +2 -0
- package/src/featureFlags.js +7 -0
- package/src/lib/expandApplyAtRules.js +2 -1
- package/src/lib/generateRules.js +35 -15
- package/src/lib/getModuleDependencies.js +70 -30
- package/src/lib/load-config.ts +27 -0
- package/src/lib/setupContextUtils.js +9 -2
- package/src/lib/setupTrackingContext.js +4 -4
- package/src/oxide/cli/build/index.ts +7 -7
- package/src/oxide/cli/build/plugin.ts +28 -22
- package/src/oxide/cli/build/watching.ts +1 -1
- package/src/oxide/cli/index.ts +7 -15
- package/src/oxide/cli/init/index.ts +34 -7
- package/src/public/colors.js +22 -0
- package/src/public/default-config.js +1 -1
- package/src/public/default-theme.js +2 -2
- package/src/public/load-config.js +2 -0
- package/src/util/applyImportantSelector.js +19 -0
- package/src/util/dataTypes.js +4 -0
- package/src/util/formatVariantSelector.js +1 -1
- package/src/util/getAllConfigs.js +2 -2
- package/src/util/normalizeConfig.js +19 -1
- package/src/util/pluginUtils.js +20 -31
- package/src/util/resolveConfigPath.js +12 -1
- package/src/util/splitAtTopLevelOnly.js +8 -1
- package/stubs/.gitignore +1 -0
- package/stubs/.prettierrc.json +6 -0
- package/stubs/{defaultConfig.stub.js → config.full.js} +38 -3
- package/stubs/{simpleConfig.stub.js → config.simple.js} +0 -1
- package/stubs/postcss.config.js +6 -0
- package/stubs/tailwind.config.cjs +2 -0
- package/stubs/tailwind.config.js +2 -0
- package/stubs/tailwind.config.ts +3 -0
- package/types/config.d.ts +7 -1
- package/types/generated/colors.d.ts +22 -0
- package/types/generated/corePluginList.d.ts +1 -1
- package/types/generated/default-theme.d.ts +31 -2
- package/lib/constants.js +0 -44
- package/src/constants.js +0 -17
- /package/stubs/{defaultPostCssConfig.stub.js → postcss.config.cjs} +0 -0
|
@@ -8,44 +8,90 @@ Object.defineProperty(exports, "default", {
|
|
|
8
8
|
});
|
|
9
9
|
const _fs = /*#__PURE__*/ _interopRequireDefault(require("fs"));
|
|
10
10
|
const _path = /*#__PURE__*/ _interopRequireDefault(require("path"));
|
|
11
|
-
const _resolve = /*#__PURE__*/ _interopRequireDefault(require("resolve"));
|
|
12
|
-
const _detective = /*#__PURE__*/ _interopRequireDefault(require("detective"));
|
|
13
11
|
function _interopRequireDefault(obj) {
|
|
14
12
|
return obj && obj.__esModule ? obj : {
|
|
15
13
|
default: obj
|
|
16
14
|
};
|
|
17
15
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
let jsExtensions = [
|
|
17
|
+
".js",
|
|
18
|
+
".cjs",
|
|
19
|
+
".mjs"
|
|
20
|
+
];
|
|
21
|
+
// Given the current file `a.ts`, we want to make sure that when importing `b` that we resolve
|
|
22
|
+
// `b.ts` before `b.js`
|
|
23
|
+
//
|
|
24
|
+
// E.g.:
|
|
25
|
+
//
|
|
26
|
+
// a.ts
|
|
27
|
+
// b // .ts
|
|
28
|
+
// c // .ts
|
|
29
|
+
// a.js
|
|
30
|
+
// b // .js or .ts
|
|
31
|
+
let jsResolutionOrder = [
|
|
32
|
+
"",
|
|
33
|
+
".js",
|
|
34
|
+
".cjs",
|
|
35
|
+
".mjs",
|
|
36
|
+
".ts",
|
|
37
|
+
".cts",
|
|
38
|
+
".mts",
|
|
39
|
+
".jsx",
|
|
40
|
+
".tsx"
|
|
41
|
+
];
|
|
42
|
+
let tsResolutionOrder = [
|
|
43
|
+
"",
|
|
44
|
+
".ts",
|
|
45
|
+
".cts",
|
|
46
|
+
".mts",
|
|
47
|
+
".tsx",
|
|
48
|
+
".js",
|
|
49
|
+
".cjs",
|
|
50
|
+
".mjs",
|
|
51
|
+
".jsx"
|
|
52
|
+
];
|
|
53
|
+
function resolveWithExtension(file, extensions) {
|
|
54
|
+
// Try to find `./a.ts`, `./a.ts`, ... from `./a`
|
|
55
|
+
for (let ext of extensions){
|
|
56
|
+
let full = `${file}${ext}`;
|
|
57
|
+
if (_fs.default.existsSync(full) && _fs.default.statSync(full).isFile()) {
|
|
58
|
+
return full;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
// Try to find `./a/index.js` from `./a`
|
|
62
|
+
for (let ext1 of extensions){
|
|
63
|
+
let full1 = `${file}/index${ext1}`;
|
|
64
|
+
if (_fs.default.existsSync(full1)) {
|
|
65
|
+
return full1;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return null;
|
|
25
69
|
}
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
});
|
|
70
|
+
function* _getModuleDependencies(filename, base, seen, ext = _path.default.extname(filename)) {
|
|
71
|
+
// Try to find the file
|
|
72
|
+
let absoluteFile = resolveWithExtension(_path.default.resolve(base, filename), jsExtensions.includes(ext) ? jsResolutionOrder : tsResolutionOrder);
|
|
73
|
+
if (absoluteFile === null) return; // File doesn't exist
|
|
74
|
+
// Prevent infinite loops when there are circular dependencies
|
|
75
|
+
if (seen.has(absoluteFile)) return; // Already seen
|
|
76
|
+
seen.add(absoluteFile);
|
|
77
|
+
// Mark the file as a dependency
|
|
78
|
+
yield absoluteFile;
|
|
79
|
+
// Resolve new base for new imports/requires
|
|
80
|
+
base = _path.default.dirname(absoluteFile);
|
|
81
|
+
ext = _path.default.extname(absoluteFile);
|
|
82
|
+
let contents = _fs.default.readFileSync(absoluteFile, "utf-8");
|
|
83
|
+
// Find imports/requires
|
|
84
|
+
for (let match of [
|
|
85
|
+
...contents.matchAll(/import[\s\S]*?['"](.{3,}?)['"]/gi),
|
|
86
|
+
...contents.matchAll(/import[\s\S]*from[\s\S]*?['"](.{3,}?)['"]/gi),
|
|
87
|
+
...contents.matchAll(/require\(['"`](.+)['"`]\)/gi)
|
|
88
|
+
]){
|
|
89
|
+
// Bail out if it's not a relative file
|
|
90
|
+
if (!match[1].startsWith(".")) continue;
|
|
91
|
+
yield* _getModuleDependencies(match[1], base, seen, ext);
|
|
49
92
|
}
|
|
50
|
-
|
|
93
|
+
}
|
|
94
|
+
function getModuleDependencies(absoluteFilePath) {
|
|
95
|
+
if (absoluteFilePath === null) return new Set();
|
|
96
|
+
return new Set(_getModuleDependencies(absoluteFilePath, _path.default.dirname(absoluteFilePath), new Set()));
|
|
51
97
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "loadConfig", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>loadConfig
|
|
8
|
+
});
|
|
9
|
+
const _jiti = /*#__PURE__*/ _interopRequireDefault(require("jiti"));
|
|
10
|
+
const _sucrase = require("sucrase");
|
|
11
|
+
function _interopRequireDefault(obj) {
|
|
12
|
+
return obj && obj.__esModule ? obj : {
|
|
13
|
+
default: obj
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
let jiti = null;
|
|
17
|
+
function lazyJiti() {
|
|
18
|
+
return jiti !== null && jiti !== void 0 ? jiti : jiti = (0, _jiti.default)(__filename, {
|
|
19
|
+
interopDefault: true,
|
|
20
|
+
transform: (opts)=>{
|
|
21
|
+
return (0, _sucrase.transform)(opts.source, {
|
|
22
|
+
transforms: [
|
|
23
|
+
"typescript",
|
|
24
|
+
"imports"
|
|
25
|
+
]
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function loadConfig(path) {
|
|
31
|
+
try {
|
|
32
|
+
return path ? require(path) : {};
|
|
33
|
+
} catch {
|
|
34
|
+
return lazyJiti()(path);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -895,14 +895,22 @@ function registerPlugins(plugins, context) {
|
|
|
895
895
|
prefix(context, "peer")
|
|
896
896
|
];
|
|
897
897
|
context.getClassOrder = function getClassOrder(classes) {
|
|
898
|
+
// Sort classes so they're ordered in a deterministic manner
|
|
899
|
+
let sorted = [
|
|
900
|
+
...classes
|
|
901
|
+
].sort((a, z)=>{
|
|
902
|
+
if (a === z) return 0;
|
|
903
|
+
if (a < z) return -1;
|
|
904
|
+
return 1;
|
|
905
|
+
});
|
|
898
906
|
// Non-util classes won't be generated, so we default them to null
|
|
899
|
-
let sortedClassNames = new Map(
|
|
907
|
+
let sortedClassNames = new Map(sorted.map((className)=>[
|
|
900
908
|
className,
|
|
901
909
|
null
|
|
902
910
|
]));
|
|
903
911
|
// Sort all classes in order
|
|
904
912
|
// Non-tailwind classes won't be generated and will be left as `null`
|
|
905
|
-
let rules = (0, _generateRules.generateRules)(new Set(
|
|
913
|
+
let rules = (0, _generateRules.generateRules)(new Set(sorted), context);
|
|
906
914
|
rules = context.offsets.sort(rules);
|
|
907
915
|
let idx = BigInt(parasiteUtilities.length);
|
|
908
916
|
for (const [, rule] of rules){
|
|
@@ -14,13 +14,14 @@ Object.defineProperty(exports, // DISABLE_TOUCH = TRUE
|
|
|
14
14
|
const _fs = /*#__PURE__*/ _interopRequireDefault(require("fs"));
|
|
15
15
|
const _quickLru = /*#__PURE__*/ _interopRequireDefault(require("quick-lru"));
|
|
16
16
|
const _hashConfig = /*#__PURE__*/ _interopRequireDefault(require("../util/hashConfig"));
|
|
17
|
-
const _getModuleDependencies = /*#__PURE__*/ _interopRequireDefault(require("../lib/getModuleDependencies"));
|
|
18
17
|
const _resolveConfig = /*#__PURE__*/ _interopRequireDefault(require("../public/resolve-config"));
|
|
19
18
|
const _resolveConfigPath = /*#__PURE__*/ _interopRequireDefault(require("../util/resolveConfigPath"));
|
|
20
19
|
const _setupContextUtils = require("./setupContextUtils");
|
|
21
20
|
const _parseDependency = /*#__PURE__*/ _interopRequireDefault(require("../util/parseDependency"));
|
|
22
21
|
const _validateConfigJs = require("../util/validateConfig.js");
|
|
23
22
|
const _contentJs = require("./content.js");
|
|
23
|
+
const _loadConfig = require("../lib/load-config");
|
|
24
|
+
const _getModuleDependencies = /*#__PURE__*/ _interopRequireDefault(require("./getModuleDependencies"));
|
|
24
25
|
function _interopRequireDefault(obj) {
|
|
25
26
|
return obj && obj.__esModule ? obj : {
|
|
26
27
|
default: obj
|
|
@@ -42,7 +43,7 @@ function getTailwindConfig(configOrPath) {
|
|
|
42
43
|
let userConfigPath = (0, _resolveConfigPath.default)(configOrPath);
|
|
43
44
|
if (userConfigPath !== null) {
|
|
44
45
|
let [prevConfig, prevConfigHash, prevDeps, prevModified] = configPathCache.get(userConfigPath) || [];
|
|
45
|
-
let newDeps = (0, _getModuleDependencies.default)(userConfigPath)
|
|
46
|
+
let newDeps = (0, _getModuleDependencies.default)(userConfigPath);
|
|
46
47
|
let modified = false;
|
|
47
48
|
let newModified = new Map();
|
|
48
49
|
for (let file of newDeps){
|
|
@@ -65,8 +66,7 @@ function getTailwindConfig(configOrPath) {
|
|
|
65
66
|
for (let file1 of newDeps){
|
|
66
67
|
delete require.cache[file1];
|
|
67
68
|
}
|
|
68
|
-
let newConfig = (0, _resolveConfig.default)(
|
|
69
|
-
newConfig = (0, _validateConfigJs.validateConfig)(newConfig);
|
|
69
|
+
let newConfig = (0, _validateConfigJs.validateConfig)((0, _resolveConfig.default)((0, _loadConfig.loadConfig)(userConfigPath)));
|
|
70
70
|
let newHash = (0, _hashConfig.default)(newConfig);
|
|
71
71
|
configPathCache.set(userConfigPath, [
|
|
72
72
|
newConfig,
|
|
@@ -8,13 +8,14 @@ Object.defineProperty(exports, "build", {
|
|
|
8
8
|
});
|
|
9
9
|
const _fs = /*#__PURE__*/ _interopRequireDefault(require("fs"));
|
|
10
10
|
const _path = /*#__PURE__*/ _interopRequireDefault(require("path"));
|
|
11
|
+
const _resolveConfigPath = require("../../../util/resolveConfigPath");
|
|
11
12
|
const _plugin = require("./plugin");
|
|
12
13
|
function _interopRequireDefault(obj) {
|
|
13
14
|
return obj && obj.__esModule ? obj : {
|
|
14
15
|
default: obj
|
|
15
16
|
};
|
|
16
17
|
}
|
|
17
|
-
async function build(args
|
|
18
|
+
async function build(args) {
|
|
18
19
|
let input = args["--input"];
|
|
19
20
|
let shouldWatch = args["--watch"];
|
|
20
21
|
// TODO: Deprecate this in future versions
|
|
@@ -31,7 +32,7 @@ async function build(args, configs) {
|
|
|
31
32
|
process.exit(9);
|
|
32
33
|
}
|
|
33
34
|
// TODO: Reference the @config path here if exists
|
|
34
|
-
let configPath = args["--config"] ? args["--config"] : (
|
|
35
|
+
let configPath = args["--config"] ? args["--config"] : (0, _resolveConfigPath.resolveDefaultConfigPath)();
|
|
35
36
|
let processor = await (0, _plugin.createProcessor)(args, configPath);
|
|
36
37
|
if (shouldWatch) {
|
|
37
38
|
// Abort the watcher if stdin is closed to avoid zombie processes
|
|
@@ -42,6 +43,9 @@ async function build(args, configs) {
|
|
|
42
43
|
process.stdin.resume();
|
|
43
44
|
await processor.watch();
|
|
44
45
|
} else {
|
|
45
|
-
await processor.build()
|
|
46
|
+
await processor.build().catch((e)=>{
|
|
47
|
+
console.error(e);
|
|
48
|
+
process.exit(1);
|
|
49
|
+
});
|
|
46
50
|
}
|
|
47
51
|
}
|
|
@@ -19,12 +19,13 @@ const _deps = require("./deps");
|
|
|
19
19
|
const _utils = require("./utils");
|
|
20
20
|
const _sharedState = require("../../../lib/sharedState");
|
|
21
21
|
const _resolveConfig = /*#__PURE__*/ _interopRequireDefault(require("../../../../resolveConfig"));
|
|
22
|
-
const _getModuleDependencies = /*#__PURE__*/ _interopRequireDefault(require("../../../lib/getModuleDependencies"));
|
|
23
22
|
const _content = require("../../../lib/content");
|
|
24
23
|
const _watching = require("./watching");
|
|
25
24
|
const _fastGlob = /*#__PURE__*/ _interopRequireDefault(require("fast-glob"));
|
|
26
25
|
const _findAtConfigPath = require("../../../lib/findAtConfigPath");
|
|
27
26
|
const _log = /*#__PURE__*/ _interopRequireDefault(require("../../../util/log"));
|
|
27
|
+
const _loadConfig = require("../../../lib/load-config");
|
|
28
|
+
const _getModuleDependencies = /*#__PURE__*/ _interopRequireDefault(require("../../../lib/getModuleDependencies"));
|
|
28
29
|
function _interopRequireDefault(obj) {
|
|
29
30
|
return obj && obj.__esModule ? obj : {
|
|
30
31
|
default: obj
|
|
@@ -108,7 +109,7 @@ let state = {
|
|
|
108
109
|
/** @type {any} */ context: null,
|
|
109
110
|
/** @type {ReturnType<typeof createWatcher> | null} */ watcher: null,
|
|
110
111
|
/** @type {{content: string, extension: string}[]} */ changedContent: [],
|
|
111
|
-
|
|
112
|
+
/** @type {{config: Config, dependencies: Set<string>, dispose: Function } | null} */ configBag: null,
|
|
112
113
|
contextDependencies: new Set(),
|
|
113
114
|
/** @type {import('../../lib/content.js').ContentPath[]} */ contentPaths: [],
|
|
114
115
|
refreshContentPaths () {
|
|
@@ -126,32 +127,35 @@ let state = {
|
|
|
126
127
|
},
|
|
127
128
|
loadConfig (configPath, content) {
|
|
128
129
|
if (this.watcher && configPath) {
|
|
129
|
-
this.refreshConfigDependencies(
|
|
130
|
+
this.refreshConfigDependencies();
|
|
130
131
|
}
|
|
131
|
-
let config =
|
|
132
|
+
let config = (0, _loadConfig.loadConfig)(configPath);
|
|
133
|
+
let dependencies = (0, _getModuleDependencies.default)(configPath);
|
|
134
|
+
this.configBag = {
|
|
135
|
+
config,
|
|
136
|
+
dependencies,
|
|
137
|
+
dispose () {
|
|
138
|
+
for (let file of dependencies){
|
|
139
|
+
delete require.cache[require.resolve(file)];
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
};
|
|
132
143
|
// @ts-ignore
|
|
133
|
-
config = (0, _resolveConfig.default)(config, {
|
|
144
|
+
this.configBag.config = (0, _resolveConfig.default)(this.configBag.config, {
|
|
134
145
|
content: {
|
|
135
146
|
files: []
|
|
136
147
|
}
|
|
137
148
|
});
|
|
138
149
|
// Override content files if `--content` has been passed explicitly
|
|
139
150
|
if ((content === null || content === void 0 ? void 0 : content.length) > 0) {
|
|
140
|
-
config.content.files = content;
|
|
151
|
+
this.configBag.config.content.files = content;
|
|
141
152
|
}
|
|
142
|
-
return config;
|
|
153
|
+
return this.configBag.config;
|
|
143
154
|
},
|
|
144
155
|
refreshConfigDependencies (configPath) {
|
|
156
|
+
var _this_configBag;
|
|
145
157
|
_sharedState.env.DEBUG && console.time("Module dependencies");
|
|
146
|
-
|
|
147
|
-
delete require.cache[require.resolve(file)];
|
|
148
|
-
}
|
|
149
|
-
if (configPath) {
|
|
150
|
-
let deps = (0, _getModuleDependencies.default)(configPath).map(({ file })=>file);
|
|
151
|
-
for (let dependency of deps){
|
|
152
|
-
this.configDependencies.add(dependency);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
158
|
+
(_this_configBag = this.configBag) === null || _this_configBag === void 0 ? void 0 : _this_configBag.dispose();
|
|
155
159
|
_sharedState.env.DEBUG && console.timeEnd("Module dependencies");
|
|
156
160
|
},
|
|
157
161
|
readContentPaths () {
|
|
@@ -323,7 +327,11 @@ async function createProcessor(args, cliConfigPath) {
|
|
|
323
327
|
// If you fix it and then save the main CSS file so there's no error
|
|
324
328
|
// The watcher will start watching the imported CSS files and will be
|
|
325
329
|
// resilient to future errors.
|
|
326
|
-
|
|
330
|
+
if (state.watcher) {
|
|
331
|
+
console.error(err);
|
|
332
|
+
} else {
|
|
333
|
+
return Promise.reject(err);
|
|
334
|
+
}
|
|
327
335
|
});
|
|
328
336
|
}
|
|
329
337
|
/**
|
|
@@ -346,7 +354,8 @@ async function createProcessor(args, cliConfigPath) {
|
|
|
346
354
|
* @param {{file: string, content(): Promise<string>, extension: string}[]} changes
|
|
347
355
|
*/ async rebuild (changes) {
|
|
348
356
|
let needsNewContext = changes.some((change)=>{
|
|
349
|
-
|
|
357
|
+
var _state_configBag;
|
|
358
|
+
return ((_state_configBag = state.configBag) === null || _state_configBag === void 0 ? void 0 : _state_configBag.dependencies.has(change.file)) || state.contextDependencies.has(change.file);
|
|
350
359
|
});
|
|
351
360
|
if (needsNewContext) {
|
|
352
361
|
state.context = null;
|
|
@@ -170,7 +170,7 @@ function createWatcher(args, { state , rebuild }) {
|
|
|
170
170
|
fswatcher: watcher,
|
|
171
171
|
refreshWatchedFiles () {
|
|
172
172
|
watcher.add(Array.from(state.contextDependencies));
|
|
173
|
-
watcher.add(Array.from(state.
|
|
173
|
+
watcher.add(Array.from(state.configBag.dependencies));
|
|
174
174
|
watcher.add(state.contentPatterns.all);
|
|
175
175
|
}
|
|
176
176
|
};
|
package/lib/oxide/cli/index.js
CHANGED
|
@@ -14,20 +14,6 @@ function _interopRequireDefault(obj) {
|
|
|
14
14
|
default: obj
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
function isESM() {
|
|
18
|
-
const pkgPath = _path.default.resolve("./package.json");
|
|
19
|
-
try {
|
|
20
|
-
let pkg = JSON.parse(_fs.default.readFileSync(pkgPath, "utf8"));
|
|
21
|
-
return pkg.type && pkg.type === "module";
|
|
22
|
-
} catch (err) {
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
let configs = isESM() ? {
|
|
27
|
-
tailwind: "tailwind.config.cjs"
|
|
28
|
-
} : {
|
|
29
|
-
tailwind: "tailwind.config.js"
|
|
30
|
-
};
|
|
31
17
|
// ---
|
|
32
18
|
function oneOf(...options) {
|
|
33
19
|
return Object.assign((value = true)=>{
|
|
@@ -46,9 +32,17 @@ let commands = {
|
|
|
46
32
|
init: {
|
|
47
33
|
run: _init.init,
|
|
48
34
|
args: {
|
|
35
|
+
"--esm": {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
description: `Initialize configuration file as ESM`
|
|
38
|
+
},
|
|
39
|
+
"--ts": {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
description: `Initialize configuration file as TypeScript`
|
|
42
|
+
},
|
|
49
43
|
"--full": {
|
|
50
44
|
type: Boolean,
|
|
51
|
-
description: `
|
|
45
|
+
description: `Include the default values for all options in the generated configuration file`
|
|
52
46
|
},
|
|
53
47
|
"-f": "--full"
|
|
54
48
|
}
|
|
@@ -217,4 +211,4 @@ if (args["--help"]) {
|
|
|
217
211
|
});
|
|
218
212
|
process.exit(0);
|
|
219
213
|
}
|
|
220
|
-
run(args
|
|
214
|
+
run(args);
|
|
@@ -13,16 +13,31 @@ function _interopRequireDefault(obj) {
|
|
|
13
13
|
default: obj
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function isESM() {
|
|
17
|
+
const pkgPath = _path.default.resolve("./package.json");
|
|
18
|
+
try {
|
|
19
|
+
let pkg = JSON.parse(_fs.default.readFileSync(pkgPath, "utf8"));
|
|
20
|
+
return pkg.type && pkg.type === "module";
|
|
21
|
+
} catch (err) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function init(args) {
|
|
17
26
|
let messages = [];
|
|
27
|
+
let isProjectESM = args["--ts"] || args["--esm"] || isESM();
|
|
28
|
+
let syntax = args["--ts"] ? "ts" : isProjectESM ? "js" : "cjs";
|
|
29
|
+
let extension = args["--ts"] ? "ts" : "js";
|
|
18
30
|
var _args___;
|
|
19
|
-
let tailwindConfigLocation = _path.default.resolve((_args___ = args["_"][1]) !== null && _args___ !== void 0 ? _args___ :
|
|
31
|
+
let tailwindConfigLocation = _path.default.resolve((_args___ = args["_"][1]) !== null && _args___ !== void 0 ? _args___ : `./tailwind.config.${extension}`);
|
|
20
32
|
if (_fs.default.existsSync(tailwindConfigLocation)) {
|
|
21
33
|
messages.push(`${_path.default.basename(tailwindConfigLocation)} already exists.`);
|
|
22
34
|
} else {
|
|
23
|
-
let
|
|
35
|
+
let stubContentsFile = _fs.default.readFileSync(args["--full"] ? _path.default.resolve(__dirname, "../../../../stubs/config.full.js") : _path.default.resolve(__dirname, "../../../../stubs/config.simple.js"), "utf8");
|
|
36
|
+
let stubFile = _fs.default.readFileSync(_path.default.resolve(__dirname, `../../../../stubs/tailwind.config.${syntax}`), "utf8");
|
|
24
37
|
// Change colors import
|
|
25
|
-
|
|
38
|
+
stubContentsFile = stubContentsFile.replace("../colors", "tailwindcss/colors");
|
|
39
|
+
// Replace contents of {ts,js,cjs} file with the stub {simple,full}.
|
|
40
|
+
stubFile = stubFile.replace("__CONFIG__", stubContentsFile.replace("module.exports =", "").trim()).trim() + "\n\n";
|
|
26
41
|
_fs.default.writeFileSync(tailwindConfigLocation, stubFile, "utf8");
|
|
27
42
|
messages.push(`Created Tailwind CSS config file: ${_path.default.basename(tailwindConfigLocation)}`);
|
|
28
43
|
}
|
package/lib/public/colors.js
CHANGED
|
@@ -34,7 +34,8 @@ const _default = {
|
|
|
34
34
|
600: "#475569",
|
|
35
35
|
700: "#334155",
|
|
36
36
|
800: "#1e293b",
|
|
37
|
-
900: "#0f172a"
|
|
37
|
+
900: "#0f172a",
|
|
38
|
+
950: "#020617"
|
|
38
39
|
},
|
|
39
40
|
gray: {
|
|
40
41
|
50: "#f9fafb",
|
|
@@ -46,7 +47,8 @@ const _default = {
|
|
|
46
47
|
600: "#4b5563",
|
|
47
48
|
700: "#374151",
|
|
48
49
|
800: "#1f2937",
|
|
49
|
-
900: "#111827"
|
|
50
|
+
900: "#111827",
|
|
51
|
+
950: "#030712"
|
|
50
52
|
},
|
|
51
53
|
zinc: {
|
|
52
54
|
50: "#fafafa",
|
|
@@ -58,7 +60,8 @@ const _default = {
|
|
|
58
60
|
600: "#52525b",
|
|
59
61
|
700: "#3f3f46",
|
|
60
62
|
800: "#27272a",
|
|
61
|
-
900: "#18181b"
|
|
63
|
+
900: "#18181b",
|
|
64
|
+
950: "#09090b"
|
|
62
65
|
},
|
|
63
66
|
neutral: {
|
|
64
67
|
50: "#fafafa",
|
|
@@ -70,7 +73,8 @@ const _default = {
|
|
|
70
73
|
600: "#525252",
|
|
71
74
|
700: "#404040",
|
|
72
75
|
800: "#262626",
|
|
73
|
-
900: "#171717"
|
|
76
|
+
900: "#171717",
|
|
77
|
+
950: "#0a0a0a"
|
|
74
78
|
},
|
|
75
79
|
stone: {
|
|
76
80
|
50: "#fafaf9",
|
|
@@ -82,7 +86,8 @@ const _default = {
|
|
|
82
86
|
600: "#57534e",
|
|
83
87
|
700: "#44403c",
|
|
84
88
|
800: "#292524",
|
|
85
|
-
900: "#1c1917"
|
|
89
|
+
900: "#1c1917",
|
|
90
|
+
950: "#0c0a09"
|
|
86
91
|
},
|
|
87
92
|
red: {
|
|
88
93
|
50: "#fef2f2",
|
|
@@ -94,7 +99,8 @@ const _default = {
|
|
|
94
99
|
600: "#dc2626",
|
|
95
100
|
700: "#b91c1c",
|
|
96
101
|
800: "#991b1b",
|
|
97
|
-
900: "#7f1d1d"
|
|
102
|
+
900: "#7f1d1d",
|
|
103
|
+
950: "#450a0a"
|
|
98
104
|
},
|
|
99
105
|
orange: {
|
|
100
106
|
50: "#fff7ed",
|
|
@@ -106,7 +112,8 @@ const _default = {
|
|
|
106
112
|
600: "#ea580c",
|
|
107
113
|
700: "#c2410c",
|
|
108
114
|
800: "#9a3412",
|
|
109
|
-
900: "#7c2d12"
|
|
115
|
+
900: "#7c2d12",
|
|
116
|
+
950: "#431407"
|
|
110
117
|
},
|
|
111
118
|
amber: {
|
|
112
119
|
50: "#fffbeb",
|
|
@@ -118,7 +125,8 @@ const _default = {
|
|
|
118
125
|
600: "#d97706",
|
|
119
126
|
700: "#b45309",
|
|
120
127
|
800: "#92400e",
|
|
121
|
-
900: "#78350f"
|
|
128
|
+
900: "#78350f",
|
|
129
|
+
950: "#451a03"
|
|
122
130
|
},
|
|
123
131
|
yellow: {
|
|
124
132
|
50: "#fefce8",
|
|
@@ -130,7 +138,8 @@ const _default = {
|
|
|
130
138
|
600: "#ca8a04",
|
|
131
139
|
700: "#a16207",
|
|
132
140
|
800: "#854d0e",
|
|
133
|
-
900: "#713f12"
|
|
141
|
+
900: "#713f12",
|
|
142
|
+
950: "#422006"
|
|
134
143
|
},
|
|
135
144
|
lime: {
|
|
136
145
|
50: "#f7fee7",
|
|
@@ -142,7 +151,8 @@ const _default = {
|
|
|
142
151
|
600: "#65a30d",
|
|
143
152
|
700: "#4d7c0f",
|
|
144
153
|
800: "#3f6212",
|
|
145
|
-
900: "#365314"
|
|
154
|
+
900: "#365314",
|
|
155
|
+
950: "#1a2e05"
|
|
146
156
|
},
|
|
147
157
|
green: {
|
|
148
158
|
50: "#f0fdf4",
|
|
@@ -154,7 +164,8 @@ const _default = {
|
|
|
154
164
|
600: "#16a34a",
|
|
155
165
|
700: "#15803d",
|
|
156
166
|
800: "#166534",
|
|
157
|
-
900: "#14532d"
|
|
167
|
+
900: "#14532d",
|
|
168
|
+
950: "#052e16"
|
|
158
169
|
},
|
|
159
170
|
emerald: {
|
|
160
171
|
50: "#ecfdf5",
|
|
@@ -166,7 +177,8 @@ const _default = {
|
|
|
166
177
|
600: "#059669",
|
|
167
178
|
700: "#047857",
|
|
168
179
|
800: "#065f46",
|
|
169
|
-
900: "#064e3b"
|
|
180
|
+
900: "#064e3b",
|
|
181
|
+
950: "#022c22"
|
|
170
182
|
},
|
|
171
183
|
teal: {
|
|
172
184
|
50: "#f0fdfa",
|
|
@@ -178,7 +190,8 @@ const _default = {
|
|
|
178
190
|
600: "#0d9488",
|
|
179
191
|
700: "#0f766e",
|
|
180
192
|
800: "#115e59",
|
|
181
|
-
900: "#134e4a"
|
|
193
|
+
900: "#134e4a",
|
|
194
|
+
950: "#042f2e"
|
|
182
195
|
},
|
|
183
196
|
cyan: {
|
|
184
197
|
50: "#ecfeff",
|
|
@@ -190,7 +203,8 @@ const _default = {
|
|
|
190
203
|
600: "#0891b2",
|
|
191
204
|
700: "#0e7490",
|
|
192
205
|
800: "#155e75",
|
|
193
|
-
900: "#164e63"
|
|
206
|
+
900: "#164e63",
|
|
207
|
+
950: "#083344"
|
|
194
208
|
},
|
|
195
209
|
sky: {
|
|
196
210
|
50: "#f0f9ff",
|
|
@@ -202,7 +216,8 @@ const _default = {
|
|
|
202
216
|
600: "#0284c7",
|
|
203
217
|
700: "#0369a1",
|
|
204
218
|
800: "#075985",
|
|
205
|
-
900: "#0c4a6e"
|
|
219
|
+
900: "#0c4a6e",
|
|
220
|
+
950: "#082f49"
|
|
206
221
|
},
|
|
207
222
|
blue: {
|
|
208
223
|
50: "#eff6ff",
|
|
@@ -214,7 +229,8 @@ const _default = {
|
|
|
214
229
|
600: "#2563eb",
|
|
215
230
|
700: "#1d4ed8",
|
|
216
231
|
800: "#1e40af",
|
|
217
|
-
900: "#1e3a8a"
|
|
232
|
+
900: "#1e3a8a",
|
|
233
|
+
950: "#172554"
|
|
218
234
|
},
|
|
219
235
|
indigo: {
|
|
220
236
|
50: "#eef2ff",
|
|
@@ -226,7 +242,8 @@ const _default = {
|
|
|
226
242
|
600: "#4f46e5",
|
|
227
243
|
700: "#4338ca",
|
|
228
244
|
800: "#3730a3",
|
|
229
|
-
900: "#312e81"
|
|
245
|
+
900: "#312e81",
|
|
246
|
+
950: "#1e1b4b"
|
|
230
247
|
},
|
|
231
248
|
violet: {
|
|
232
249
|
50: "#f5f3ff",
|
|
@@ -238,7 +255,8 @@ const _default = {
|
|
|
238
255
|
600: "#7c3aed",
|
|
239
256
|
700: "#6d28d9",
|
|
240
257
|
800: "#5b21b6",
|
|
241
|
-
900: "#4c1d95"
|
|
258
|
+
900: "#4c1d95",
|
|
259
|
+
950: "#2e1065"
|
|
242
260
|
},
|
|
243
261
|
purple: {
|
|
244
262
|
50: "#faf5ff",
|
|
@@ -250,7 +268,8 @@ const _default = {
|
|
|
250
268
|
600: "#9333ea",
|
|
251
269
|
700: "#7e22ce",
|
|
252
270
|
800: "#6b21a8",
|
|
253
|
-
900: "#581c87"
|
|
271
|
+
900: "#581c87",
|
|
272
|
+
950: "#3b0764"
|
|
254
273
|
},
|
|
255
274
|
fuchsia: {
|
|
256
275
|
50: "#fdf4ff",
|
|
@@ -262,7 +281,8 @@ const _default = {
|
|
|
262
281
|
600: "#c026d3",
|
|
263
282
|
700: "#a21caf",
|
|
264
283
|
800: "#86198f",
|
|
265
|
-
900: "#701a75"
|
|
284
|
+
900: "#701a75",
|
|
285
|
+
950: "#4a044e"
|
|
266
286
|
},
|
|
267
287
|
pink: {
|
|
268
288
|
50: "#fdf2f8",
|
|
@@ -274,7 +294,8 @@ const _default = {
|
|
|
274
294
|
600: "#db2777",
|
|
275
295
|
700: "#be185d",
|
|
276
296
|
800: "#9d174d",
|
|
277
|
-
900: "#831843"
|
|
297
|
+
900: "#831843",
|
|
298
|
+
950: "#500724"
|
|
278
299
|
},
|
|
279
300
|
rose: {
|
|
280
301
|
50: "#fff1f2",
|
|
@@ -286,7 +307,8 @@ const _default = {
|
|
|
286
307
|
600: "#e11d48",
|
|
287
308
|
700: "#be123c",
|
|
288
309
|
800: "#9f1239",
|
|
289
|
-
900: "#881337"
|
|
310
|
+
900: "#881337",
|
|
311
|
+
950: "#4c0519"
|
|
290
312
|
},
|
|
291
313
|
get lightBlue () {
|
|
292
314
|
warn({
|
|
@@ -7,10 +7,10 @@ Object.defineProperty(exports, "default", {
|
|
|
7
7
|
get: ()=>_default
|
|
8
8
|
});
|
|
9
9
|
const _cloneDeep = require("../util/cloneDeep");
|
|
10
|
-
const
|
|
10
|
+
const _configFull = /*#__PURE__*/ _interopRequireDefault(require("../../stubs/config.full"));
|
|
11
11
|
function _interopRequireDefault(obj) {
|
|
12
12
|
return obj && obj.__esModule ? obj : {
|
|
13
13
|
default: obj
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
const _default = (0, _cloneDeep.cloneDeep)(
|
|
16
|
+
const _default = (0, _cloneDeep.cloneDeep)(_configFull.default);
|