tungsten 0.2.23 → 0.2.25
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/dist/Framework.js +5 -5
- package/dist/bin/commands/compile.js +8 -8
- package/dist/build/compileStyles.js +2 -1
- package/dist/build/createClientFiles.d.ts.map +1 -1
- package/dist/build/createClientFiles.js +5 -4
- package/dist/build/processPackage.d.ts.map +1 -1
- package/dist/build/processPackage.js +3 -3
- package/dist/helpers/getFetchCompatibleHeaders.d.ts.map +1 -1
- package/dist/postcssPlugins/TransformCssNames.d.ts +14 -1
- package/dist/postcssPlugins/TransformCssNames.d.ts.map +1 -1
- package/dist/postcssPlugins/TransformCssNames.js +97 -95
- package/dist/removeRecursive.d.ts +2 -0
- package/dist/removeRecursive.d.ts.map +1 -0
- package/dist/removeRecursive.js +12 -0
- package/package.json +1 -2
package/dist/Framework.js
CHANGED
|
@@ -2,8 +2,8 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
|
|
|
2
2
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
3
3
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
4
4
|
//import slash from 'slash'
|
|
5
|
-
import rmfr from 'rmfr';
|
|
6
5
|
import { join } from 'path';
|
|
6
|
+
import { removeRecursive } from "./removeRecursive.js";
|
|
7
7
|
import { filter as objectFilter, remap as objectRemap } from 'sxy-lib/objects.js';
|
|
8
8
|
import { buildCodeSubPath, buildFolder, devBuildOuterFolder, prodBuildFolder, prodBuildCodeFolder, bundleFolder, staticSiteFolder } from "./settings.js";
|
|
9
9
|
import { DevServer } from "./Servers/DevServer.js";
|
|
@@ -65,22 +65,22 @@ export class Framework {
|
|
|
65
65
|
switch (mode) {
|
|
66
66
|
case 'prod':
|
|
67
67
|
{
|
|
68
|
-
await Promise.all([
|
|
68
|
+
await Promise.all([removeRecursive(join(projectDir, prodBuildFolder)), removeRecursive(join(projectDir, bundleFolder))]);
|
|
69
69
|
break;
|
|
70
70
|
}
|
|
71
71
|
case 'staticSite':
|
|
72
72
|
{
|
|
73
|
-
await
|
|
73
|
+
await removeRecursive(join(projectDir, staticSiteFolder));
|
|
74
74
|
break;
|
|
75
75
|
}
|
|
76
76
|
case 'dev':
|
|
77
77
|
{
|
|
78
|
-
await
|
|
78
|
+
await removeRecursive(join(projectDir, devBuildOuterFolder));
|
|
79
79
|
break;
|
|
80
80
|
}
|
|
81
81
|
default:
|
|
82
82
|
{
|
|
83
|
-
await
|
|
83
|
+
await removeRecursive(join(projectDir, buildFolder));
|
|
84
84
|
break;
|
|
85
85
|
}
|
|
86
86
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { dirname, join, resolve } from 'path';
|
|
2
2
|
import { promises as fsPromises } from 'fs';
|
|
3
|
-
import
|
|
3
|
+
import { removeRecursive } from "../../removeRecursive.js";
|
|
4
4
|
import { compileJavascript } from "../../build/compileJavascript.js";
|
|
5
5
|
import { compileStyles } from "../../build/compileStyles.js";
|
|
6
6
|
import { copyAssets } from "../../build/copyAssets.js";
|
|
@@ -101,7 +101,7 @@ if (buildLocation.toLowerCase() === resolve(projectDir).toLowerCase()) {
|
|
|
101
101
|
process.exit(1);
|
|
102
102
|
}
|
|
103
103
|
async function clearReadyFile() {
|
|
104
|
-
if (readyFileLocation !== undefined) await
|
|
104
|
+
if (readyFileLocation !== undefined) await removeRecursive(readyFileLocation);
|
|
105
105
|
}
|
|
106
106
|
async function markReady() {
|
|
107
107
|
if (readyFileLocation === undefined) return;
|
|
@@ -115,23 +115,23 @@ async function markReady() {
|
|
|
115
115
|
targets: [...targets],
|
|
116
116
|
updatedAt: new Date().toISOString()
|
|
117
117
|
}));
|
|
118
|
-
await
|
|
118
|
+
await removeRecursive(readyFileLocation);
|
|
119
119
|
await fsPromises.rename(temporaryLocation, readyFileLocation);
|
|
120
120
|
}
|
|
121
121
|
await clearReadyFile();
|
|
122
122
|
const cleanTasks = [];
|
|
123
123
|
if (clean && targets.has('js')) {
|
|
124
|
-
cleanTasks.push(
|
|
124
|
+
cleanTasks.push(removeRecursive(buildCodeLocation), removeRecursive(join(buildLocation, componentCssFolder)), removeRecursive(join(buildLocation, packagesFolder)), removeRecursive(packagesCacheLocation));
|
|
125
125
|
}
|
|
126
126
|
if (clean && targets.has('css')) {
|
|
127
|
-
cleanTasks.push(
|
|
127
|
+
cleanTasks.push(removeRecursive(join(buildLocation, staticFolder)));
|
|
128
128
|
}
|
|
129
129
|
if (clean && targets.has('client')) {
|
|
130
|
-
cleanTasks.push(
|
|
130
|
+
cleanTasks.push(removeRecursive(join(buildLocation, clientFolder)), removeRecursive(join(buildLocation, '.tungsten.config.js')));
|
|
131
131
|
}
|
|
132
132
|
if (clean) {
|
|
133
|
-
if (targets.has('assets')) cleanTasks.push(
|
|
134
|
-
if (targets.has('public')) cleanTasks.push(
|
|
133
|
+
if (targets.has('assets')) cleanTasks.push(removeRecursive(join(buildLocation, assetsFolder)));
|
|
134
|
+
if (targets.has('public')) cleanTasks.push(removeRecursive(join(buildLocation, publicFolder)));
|
|
135
135
|
cliOut(`Cleaning compile output: ${[...targets].join(', ')}`);
|
|
136
136
|
await Promise.all(cleanTasks);
|
|
137
137
|
}
|
|
@@ -209,7 +209,8 @@ export async function compileStyles(projectDir, config, styleImportBase, buildLo
|
|
|
209
209
|
// C is needed by B,A
|
|
210
210
|
// D is needed by C,B,A
|
|
211
211
|
const cssFiles = {};
|
|
212
|
-
const sourceLocation = config.sourceDir
|
|
212
|
+
const sourceLocation = config.sourceDir // eslint-disable-line @typescript-eslint/strict-boolean-expressions
|
|
213
|
+
? join(projectDir, config.sourceDir) : join(projectDir, config.codeDir);
|
|
213
214
|
const staticLocation = join(buildLocation, staticFolder);
|
|
214
215
|
const watchGlob = sourceLocation + '/**/*.{css,scss,sass,less}';
|
|
215
216
|
const ignoreGlob = buildLocation + '/**/*';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createClientFiles.d.ts","sourceRoot":"","sources":["../../src/build/createClientFiles.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAOtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAG/D,wBAAsB,iBAAiB,CACnC,MAAM,EAAE,uBAAuB,EAC/B,IAAI,EAAE,IAAI,EACV,aAAa,CAAC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"createClientFiles.d.ts","sourceRoot":"","sources":["../../src/build/createClientFiles.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAOtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAG/D,wBAAsB,iBAAiB,CACnC,MAAM,EAAE,uBAAuB,EAC/B,IAAI,EAAE,IAAI,EACV,aAAa,CAAC,EAAE,MAAM,iBAiFzB"}
|
|
@@ -11,11 +11,12 @@ export async function createClientFiles(config, mode, buildLocation) {
|
|
|
11
11
|
const routesLocation = config.routesLocation;
|
|
12
12
|
//if (routesLocation !== null) {
|
|
13
13
|
const [routeFilePath, routesExportName] = routesLocation;
|
|
14
|
-
|
|
15
|
-
//
|
|
16
|
-
fsPromises.mkdir(join(specificBuildFolder, `${clientFolder}`), {
|
|
14
|
+
// ensure the folder exists -- must complete before anything below writes into it,
|
|
15
|
+
// so it can't just be another entry in the promises array (they all start eagerly)
|
|
16
|
+
await fsPromises.mkdir(join(specificBuildFolder, `${clientFolder}`), {
|
|
17
17
|
recursive: true
|
|
18
|
-
})
|
|
18
|
+
});
|
|
19
|
+
const promises = [
|
|
19
20
|
// client.js file
|
|
20
21
|
fsPromises.copyFile(join(frameworkDir, frameworkDistFolder, frameworkClientFolder, 'client.js'),
|
|
21
22
|
// from
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processPackage.d.ts","sourceRoot":"","sources":["../../src/build/processPackage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"processPackage.d.ts","sourceRoot":"","sources":["../../src/build/processPackage.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAG/D,OAAO,EAAE,oBAAoB,EAA4D,MAAM,2BAA2B,CAAA;AAwB1H,wBAAsB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAoGxK"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import rmfr from 'rmfr';
|
|
2
1
|
import { transform } from 'cjstoesm';
|
|
3
2
|
import { promises as fsPromises } from 'fs';
|
|
4
3
|
import fsExtra from 'fs-extra';
|
|
5
4
|
import { packagesCacheFolder, packagesFolder } from "../settings.js";
|
|
5
|
+
import { removeRecursive } from "../removeRecursive.js";
|
|
6
6
|
import { cliLog } from "../cliOutput.js";
|
|
7
7
|
//import { getFrameworkDir } from '../getFrameworkDir.js'
|
|
8
8
|
//// Don't think we are using this
|
|
@@ -43,7 +43,7 @@ export async function processPackage(projectDir, packagesCacheInfo, packageName,
|
|
|
43
43
|
console.log(`Didn't find ${packageAndVersion} in packages cached - proceeding`);
|
|
44
44
|
//
|
|
45
45
|
// check if package is esm or cjs?
|
|
46
|
-
|
|
46
|
+
await removeRecursive(targetLocation);
|
|
47
47
|
await fsPromises.mkdir(targetLocation);
|
|
48
48
|
//console.log('json for ', packageName, json)
|
|
49
49
|
if (packageJson.type === undefined && packageJson.type !== 'module') {
|
|
@@ -52,7 +52,7 @@ export async function processPackage(projectDir, packagesCacheInfo, packageName,
|
|
|
52
52
|
const input = `${sourceLocation}/**/*`;
|
|
53
53
|
/// change to cache loc
|
|
54
54
|
//const outDir = targetLocation
|
|
55
|
-
|
|
55
|
+
await removeRecursive(cacheLocation);
|
|
56
56
|
await fsPromises.mkdir(cacheLocation);
|
|
57
57
|
await transform({
|
|
58
58
|
input: input,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFetchCompatibleHeaders.d.ts","sourceRoot":"","sources":["../../src/helpers/getFetchCompatibleHeaders.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAKtC,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"getFetchCompatibleHeaders.d.ts","sourceRoot":"","sources":["../../src/helpers/getFetchCompatibleHeaders.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAKtC,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAY/D"}
|
|
@@ -1,2 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Root } from 'postcss';
|
|
2
|
+
import type { CssNames } from '../CssNames.js';
|
|
3
|
+
type Opts = {
|
|
4
|
+
moduleName: string;
|
|
5
|
+
outNames: CssNames;
|
|
6
|
+
};
|
|
7
|
+
export declare const TransformCssNames: {
|
|
8
|
+
(opts: Opts): {
|
|
9
|
+
postcssPlugin: string;
|
|
10
|
+
Once(root: Root): void;
|
|
11
|
+
};
|
|
12
|
+
postcss: boolean;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
2
15
|
//# sourceMappingURL=TransformCssNames.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransformCssNames.d.ts","sourceRoot":"","sources":["../../src/postcssPlugins/TransformCssNames.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TransformCssNames.d.ts","sourceRoot":"","sources":["../../src/postcssPlugins/TransformCssNames.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,IAAI,EAAQ,MAAM,SAAS,CAAA;AACzC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAyD9C,KAAK,IAAI,GAAG;IACR,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,QAAQ,CAAA;CACrB,CAAA;AAKD,eAAO,MAAM,iBAAiB;WAAU,IAAI;;mBAezB,IAAI;;;CAoHtB,CAAA"}
|
|
@@ -9,8 +9,6 @@ extract classes -> localise
|
|
|
9
9
|
.navItem -> NavItem_navItemf
|
|
10
10
|
.span -> NavItem_span
|
|
11
11
|
*/
|
|
12
|
-
//const path = require('path')
|
|
13
|
-
import postcss from 'postcss';
|
|
14
12
|
import { parseSelectorsRich } from "./parseSelectorsRich.js";
|
|
15
13
|
import { componentBumpClass } from "../componentClassName.js";
|
|
16
14
|
import { throwError } from "../throwError.js";
|
|
@@ -45,13 +43,13 @@ function transformTag(moduleName, tag) {
|
|
|
45
43
|
};
|
|
46
44
|
}
|
|
47
45
|
//Page-poll#_div
|
|
46
|
+
// why is this unused?
|
|
48
47
|
function separatePseudo(selector) {
|
|
49
48
|
const colonIndex = selector.indexOf(':');
|
|
50
49
|
if (colonIndex === -1) return [selector, ''];else return [selector.slice(0, colonIndex), selector.slice(colonIndex)];
|
|
51
50
|
}
|
|
52
51
|
const bump = '.' + componentBumpClass + '.' + componentBumpClass + '.' + componentBumpClass;
|
|
53
|
-
|
|
54
|
-
export const TransformCssNames = postcss.plugin('postcss-transform-names', opts => {
|
|
52
|
+
export const TransformCssNames = opts => {
|
|
55
53
|
//console.log('TransformCssNames')
|
|
56
54
|
if (!('moduleName' in opts)) {
|
|
57
55
|
throw new Error(`PostcssTransformNames error - pass a moduleName prop to the` + ` plugin to receive transformed names map`);
|
|
@@ -59,100 +57,104 @@ export const TransformCssNames = postcss.plugin('postcss-transform-names', opts
|
|
|
59
57
|
if (!('outNames' in opts)) {
|
|
60
58
|
throw new Error(`PostcssTransformNames error - pass an outNames object to the` + ` plugin to receive transformed names map`);
|
|
61
59
|
}
|
|
62
|
-
return
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
//
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
if (
|
|
137
|
-
|
|
60
|
+
return {
|
|
61
|
+
postcssPlugin: 'postcss-transform-names',
|
|
62
|
+
Once(root) {
|
|
63
|
+
const moduleName = opts.moduleName;
|
|
64
|
+
const names = opts.outNames;
|
|
65
|
+
names.moduleName = moduleName;
|
|
66
|
+
names.tags = {};
|
|
67
|
+
names.classes = {};
|
|
68
|
+
// Transform CSS AST here
|
|
69
|
+
root.walkRules(rule => {
|
|
70
|
+
const selectorLine = rule.selector;
|
|
71
|
+
const selectorGroups = selectorLine.split(',').map(x => x.trim());
|
|
72
|
+
const newSelectorGroups = [];
|
|
73
|
+
for (const selectorGroup of selectorGroups) {
|
|
74
|
+
debug('selectorGroup', selectorGroup);
|
|
75
|
+
//// Always explain your regex's
|
|
76
|
+
//// Split the string before a space, after a space, before a . or # within a sequence (e.g. foo.bar)
|
|
77
|
+
//// This splits the string into tags (foo), classes (.foo), IDs (#foo), and spaces ( )
|
|
78
|
+
//// The spaces are retained so that we can rebuild the string with the spaces as they were found
|
|
79
|
+
//const selectors = selectorGroup.split(/(?= )|(?<= )|(?<=\S)(?=[.#]\S)/)
|
|
80
|
+
// replace the regex with a parser. Easier
|
|
81
|
+
const selectors = parseSelectorsRich(selectorGroup);
|
|
82
|
+
const newSelectors = [];
|
|
83
|
+
for (const {
|
|
84
|
+
type,
|
|
85
|
+
content
|
|
86
|
+
} of selectors) {
|
|
87
|
+
debug('Sel: ', type + ':', content);
|
|
88
|
+
if (type === 'whitespace') {
|
|
89
|
+
newSelectors.push(' ');
|
|
90
|
+
} else if (type === 'grammar') {
|
|
91
|
+
newSelectors.push(content);
|
|
92
|
+
} else if (type === 'id') {
|
|
93
|
+
newSelectors.push(content);
|
|
94
|
+
} else if (type === 'class') {
|
|
95
|
+
const className = content.slice(1);
|
|
96
|
+
const newClassName = transformClass(moduleName, className);
|
|
97
|
+
newSelectors.push('.' + newClassName);
|
|
98
|
+
names.classes[className] = newClassName;
|
|
99
|
+
} else if (type === 'tag') {
|
|
100
|
+
const newName = transformTag(moduleName, content);
|
|
101
|
+
// newName.css === escaped version for css
|
|
102
|
+
// newName.jsx === unescaped ver for jsx
|
|
103
|
+
if (/^[A-Z]/.test(content)) {
|
|
104
|
+
// starts with uppercase - React el
|
|
105
|
+
newSelectors.push(bump + '.' + newName.css);
|
|
106
|
+
} else {
|
|
107
|
+
// lowercase - html el
|
|
108
|
+
newSelectors.push('.' + newName.css);
|
|
109
|
+
}
|
|
110
|
+
names.tags[content] = newName.jsx;
|
|
111
|
+
} else if (type === 'pseudo-class') {
|
|
112
|
+
// // REGEX:
|
|
113
|
+
// // :
|
|
114
|
+
// // multiple letters/numbers/-/_ [match group 1]
|
|
115
|
+
// // (
|
|
116
|
+
// // any chars (greedy / as many as possible) [match group 2]
|
|
117
|
+
// // )
|
|
118
|
+
// // e.g. :Match1(Match2)
|
|
119
|
+
// const pseudoClassRegex = /:([a-zA-Z0-9-_]+)\((.*)\)/
|
|
120
|
+
// REGEX:
|
|
121
|
+
// :
|
|
122
|
+
// multiple letters/numbers/-/_ [match group 1]
|
|
123
|
+
// optional section, non matching
|
|
124
|
+
// (
|
|
125
|
+
// any chars (greedy / as many as possible) [match group 2]
|
|
126
|
+
// )
|
|
127
|
+
// e.g. :Match1(Match2)
|
|
128
|
+
const pseudoClassRegex = /:([a-zA-Z0-9-_]+)(?:\((.*)\))?/;
|
|
129
|
+
const results = pseudoClassRegex.exec(content);
|
|
130
|
+
if (results === null) throwError('TransformCssNames -> walkRules', 'pseudo-class selector did not match pseudo-class regex');
|
|
131
|
+
const label = results[1]; // eslint-disable-line no-type-assertion/no-type-assertion -- typings are incorrect
|
|
132
|
+
// if it is :i(xxx) or :ignore(xxx), pass through the internal part
|
|
133
|
+
// otherwise pass all through unaffected
|
|
134
|
+
if (label === 'i' || label === 'ignore') {
|
|
135
|
+
const inner = results[2]; // eslint-disable-line no-type-assertion/no-type-assertion -- typings are incorrect
|
|
136
|
+
if (inner !== undefined && inner !== '') {
|
|
137
|
+
newSelectors.push(inner);
|
|
138
|
+
}
|
|
139
|
+
} else {
|
|
140
|
+
newSelectors.push(content);
|
|
138
141
|
}
|
|
139
|
-
} else {
|
|
142
|
+
} else if (type === 'pseudo-element') {
|
|
143
|
+
newSelectors.push(content);
|
|
144
|
+
} else if (type === 'attribute') {
|
|
140
145
|
newSelectors.push(content);
|
|
141
146
|
}
|
|
142
|
-
} else if (type === 'pseudo-element') {
|
|
143
|
-
newSelectors.push(content);
|
|
144
|
-
} else if (type === 'attribute') {
|
|
145
|
-
newSelectors.push(content);
|
|
146
147
|
}
|
|
148
|
+
newSelectorGroups.push(newSelectors.join(''));
|
|
147
149
|
}
|
|
148
|
-
newSelectorGroups.
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
//opts.outNames = names
|
|
150
|
+
const newSelectorLine = newSelectorGroups.join(', ');
|
|
151
|
+
debug('new selector line', newSelectorLine);
|
|
152
|
+
debug('name for above line', names);
|
|
153
|
+
rule.selector = newSelectorLine;
|
|
154
|
+
});
|
|
155
|
+
//console.log("names", names)
|
|
156
|
+
//opts.outNames = names
|
|
157
|
+
}
|
|
157
158
|
};
|
|
158
|
-
}
|
|
159
|
+
};
|
|
160
|
+
TransformCssNames.postcss = true;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"removeRecursive.d.ts","sourceRoot":"","sources":["../src/removeRecursive.ts"],"names":[],"mappings":"AAOA,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3D"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { promises as fsPromises } from 'fs';
|
|
2
|
+
// replaces the old rmfr dependency - node has covered this natively since 14.14
|
|
3
|
+
// force: resolve quietly when the path is already gone, matching rm -rf
|
|
4
|
+
// maxRetries: windows often holds handles on build output for a moment after a
|
|
5
|
+
// watcher or child process lets go, which surfaces as EBUSY/EPERM
|
|
6
|
+
export function removeRecursive(path) {
|
|
7
|
+
return fsPromises.rm(path, {
|
|
8
|
+
recursive: true,
|
|
9
|
+
force: true,
|
|
10
|
+
maxRetries: 3
|
|
11
|
+
});
|
|
12
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tungsten",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.25",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -98,7 +98,6 @@
|
|
|
98
98
|
"@types/prop-types": "^15.7.15",
|
|
99
99
|
"@types/react": "19.1.9",
|
|
100
100
|
"@types/react-dom": "19.1.7",
|
|
101
|
-
"@types/rmfr": "^2.0.5",
|
|
102
101
|
"@types/serialize-javascript": "^5.0.4",
|
|
103
102
|
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
104
103
|
"@typescript-eslint/parser": "^5.62.0",
|