tungsten 0.2.22 → 0.2.23
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/build/bundle.js +3 -1
- package/dist/build/clientModuleAliases.d.ts +1 -3
- package/dist/build/clientModuleAliases.d.ts.map +1 -1
- package/dist/build/clientModuleAliases.js +4 -3
- package/dist/build/compileStyles.d.ts.map +1 -1
- package/dist/build/compileStyles.js +15 -19
- package/dist/build/devBundle.rollup.config.d.ts.map +1 -1
- package/dist/build/devBundle.rollup.config.js +1 -2
- package/dist/build/rollup.user.prod.config.d.ts.map +1 -1
- package/dist/build/rollup.user.prod.config.js +1 -2
- package/dist/staticGen/staticGen.d.ts.map +1 -1
- package/dist/staticGen/staticGen.js +5 -3
- package/package.json +3 -23
- package/types/modules.d.ts +32 -1
package/dist/build/bundle.js
CHANGED
|
@@ -13,7 +13,9 @@ export async function bundle(projectDir /*, appConfig: FrameworkConfigComplete*/
|
|
|
13
13
|
// let rootComponent = appConfig.rootComponent as string
|
|
14
14
|
// if (rootComponent.endsWith('.jsx')) rootComponent = rootComponent.slice(0, -1)
|
|
15
15
|
// }
|
|
16
|
-
const externalModules = [
|
|
16
|
+
const externalModules = [
|
|
17
|
+
//'node-fetch'
|
|
18
|
+
];
|
|
17
19
|
const command = `cd ${frameworkDir} && npx rollup` + ` --input "${join(projectDir, prodBuildFolder, clientFolder, 'client.js')}"` + ` --file "${join(projectDir, bundleFolder, 'client.js')}"` + ` --config "${join(frameworkDir, frameworkDistFolder, 'build/rollup.user.prod.config.js')}"` + (externalModules.length > 0 ? ` --external ${externalModules.join(',')}` : ``) + ` --inlineDynamicImports --format iife`;
|
|
18
20
|
cliLog('bundle command:', command);
|
|
19
21
|
const subProcess = spawnShellCommand(command, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clientModuleAliases.d.ts","sourceRoot":"","sources":["../../src/build/clientModuleAliases.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"clientModuleAliases.d.ts","sourceRoot":"","sources":["../../src/build/clientModuleAliases.ts"],"names":[],"mappings":""}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export const clientModulesAliases = {
|
|
2
|
-
|
|
3
|
-
}
|
|
1
|
+
// export const clientModulesAliases = {
|
|
2
|
+
// 'redaxios': 'tungsten/node_modules/redaxios/dist/redaxios.js'
|
|
3
|
+
// }
|
|
4
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compileStyles.d.ts","sourceRoot":"","sources":["../../src/build/compileStyles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"compileStyles.d.ts","sourceRoot":"","sources":["../../src/build/compileStyles.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAgOpE,wBAAsB,aAAa,CAC/B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,uBAAuB,EAC/B,eAAe,EAAE,MAAM,EACvB,aAAa,EAAE,MAAM,EACrB,KAAK,UAAO,oBA8Ff"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import slash from 'slash';
|
|
2
2
|
import chokidar from 'chokidar';
|
|
3
3
|
import { join, dirname, resolve } from 'path';
|
|
4
|
+
import { pathToFileURL } from 'url';
|
|
4
5
|
import { promises as fsPromises, utimesSync } from 'fs';
|
|
5
6
|
import * as sass from 'sass';
|
|
6
7
|
import { globby } from 'globby';
|
|
@@ -19,16 +20,13 @@ function arrayToObjectTrue(array) {
|
|
|
19
20
|
}
|
|
20
21
|
function sassToCss(data, file, importBase) {
|
|
21
22
|
try {
|
|
22
|
-
return sass.
|
|
23
|
-
|
|
24
|
-
file,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
}).css.toString();
|
|
23
|
+
return sass.compileString(data, {
|
|
24
|
+
syntax: 'indented',
|
|
25
|
+
url: pathToFileURL(file),
|
|
26
|
+
importers: [{
|
|
27
|
+
findFileUrl: url => pathToFileURL(resolveSassImport(url, file, importBase))
|
|
28
|
+
}]
|
|
29
|
+
}).css;
|
|
32
30
|
} catch (error) {
|
|
33
31
|
if (error instanceof Error) {
|
|
34
32
|
return error;
|
|
@@ -40,15 +38,13 @@ function sassToCss(data, file, importBase) {
|
|
|
40
38
|
}
|
|
41
39
|
function scssToCss(data, file, importBase) {
|
|
42
40
|
try {
|
|
43
|
-
return sass.
|
|
44
|
-
|
|
45
|
-
file,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
}).css.toString();
|
|
41
|
+
return sass.compileString(data, {
|
|
42
|
+
syntax: 'scss',
|
|
43
|
+
url: pathToFileURL(file),
|
|
44
|
+
importers: [{
|
|
45
|
+
findFileUrl: url => pathToFileURL(resolveScssImport(url, file, importBase))
|
|
46
|
+
}]
|
|
47
|
+
}).css;
|
|
52
48
|
} catch (error) {
|
|
53
49
|
if (error instanceof Error) {
|
|
54
50
|
return error;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devBundle.rollup.config.d.ts","sourceRoot":"","sources":["../../src/build/devBundle.rollup.config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"devBundle.rollup.config.d.ts","sourceRoot":"","sources":["../../src/build/devBundle.rollup.config.ts"],"names":[],"mappings":"AAUA,KAAK,YAAY,GAAG;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACrB,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,YAkBnB,CAAA;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { nodeResolve } from "@rollup/plugin-node-resolve";
|
|
2
2
|
import commonjs from "@rollup/plugin-commonjs";
|
|
3
3
|
//import { babel } from "@rollup/plugin-babel"
|
|
4
|
-
import
|
|
5
|
-
//import terser from "@rollup/plugin-terser" // to do
|
|
4
|
+
import terser from "@rollup/plugin-terser";
|
|
6
5
|
//import gzip from "rollup-plugin-gzip"
|
|
7
6
|
import jsonModule from "@rollup/plugin-json";
|
|
8
7
|
const json = typeof jsonModule === "function" ? jsonModule : jsonModule.default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rollup.user.prod.config.d.ts","sourceRoot":"","sources":["../../src/build/rollup.user.prod.config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rollup.user.prod.config.d.ts","sourceRoot":"","sources":["../../src/build/rollup.user.prod.config.ts"],"names":[],"mappings":"AAaA,KAAK,YAAY,GAAG;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACrB,CAAA;AAeD,QAAA,MAAM,YAAY,EAAE,YAkBnB,CAAA;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { nodeResolve } from "@rollup/plugin-node-resolve";
|
|
2
2
|
import commonjs from "@rollup/plugin-commonjs";
|
|
3
3
|
import { babel } from "@rollup/plugin-babel";
|
|
4
|
-
import
|
|
5
|
-
//import terser from "@rollup/plugin-terser" // to do
|
|
4
|
+
import terser from "@rollup/plugin-terser";
|
|
6
5
|
//import gzip from "rollup-plugin-gzip"
|
|
7
6
|
import jsonModule from "@rollup/plugin-json";
|
|
8
7
|
import { MakeBabelTransformRemoveServerBlocks } from "../babelPlugins/BabelTransformRemoveServerBlocks.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"staticGen.d.ts","sourceRoot":"","sources":["../../src/staticGen/staticGen.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"staticGen.d.ts","sourceRoot":"","sources":["../../src/staticGen/staticGen.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAiBhD,wBAAsB,SAAS,CAAC,SAAS,EAAE,SAAS,iBA2LnD"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { existsSync, promises as fsPromises } from 'fs';
|
|
2
2
|
import { join, dirname } from 'path';
|
|
3
3
|
import fsExtra from 'fs-extra';
|
|
4
|
-
import axios from 'axios';
|
|
5
4
|
//import type { SxyFrameworkConfigComplete } from '../FrameworkConfig.js'
|
|
6
5
|
import { staticSiteFolder, staticFolder, assetsFolder, publicFolder, bundleFolder, componentCssFolder } from "../settings.js";
|
|
7
6
|
import { getAppRoutes } from "./getAppRoutes.js";
|
|
@@ -86,8 +85,11 @@ export async function staticGen(framework) {
|
|
|
86
85
|
let links;
|
|
87
86
|
try {
|
|
88
87
|
console.log('get URL', url);
|
|
89
|
-
const response = await
|
|
90
|
-
|
|
88
|
+
const response = await fetch(url);
|
|
89
|
+
// fetch, unlike axios, resolves on non-2xx - so check explicitly, or we'd
|
|
90
|
+
// write error pages out as static HTML
|
|
91
|
+
if (!response.ok) throwError('renderPath', `Get request to ${url} returned an invalid status: ${response.status}`);
|
|
92
|
+
let result = await response.text();
|
|
91
93
|
links = findLinks(result);
|
|
92
94
|
const newPaths = [];
|
|
93
95
|
for (const link of links) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tungsten",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.23",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -36,9 +36,8 @@
|
|
|
36
36
|
"@rollup/plugin-commonjs": "^22.0.2",
|
|
37
37
|
"@rollup/plugin-json": "^6.1.0",
|
|
38
38
|
"@rollup/plugin-node-resolve": "^14.1.0",
|
|
39
|
+
"@rollup/plugin-terser": "^1.0.0",
|
|
39
40
|
"arktype": "^2.2.0",
|
|
40
|
-
"axios": "^0.27.2",
|
|
41
|
-
"babel-loader": "^8.4.1",
|
|
42
41
|
"babel-plugin-css-to-js": "^0.0.4",
|
|
43
42
|
"babel-plugin-sxy-module-resolver": "^4.1.9",
|
|
44
43
|
"babel-plugin-sxy-transform-cjs-to-esm": "^0.2.6",
|
|
@@ -48,7 +47,6 @@
|
|
|
48
47
|
"chokidar": "^3.6.0",
|
|
49
48
|
"cjs-module-lexer": "^1.4.3",
|
|
50
49
|
"cjstoesm": "^2.1.2",
|
|
51
|
-
"compression-webpack-plugin": "^10.0.0",
|
|
52
50
|
"cookie-parser": "^1.4.7",
|
|
53
51
|
"cross-env": "^7.0.3",
|
|
54
52
|
"decamelize": "^6.0.1",
|
|
@@ -59,26 +57,18 @@
|
|
|
59
57
|
"fs-extra": "^10.1.0",
|
|
60
58
|
"globby": "^13.2.2",
|
|
61
59
|
"hono": "^4.12.8",
|
|
62
|
-
"html-webpack-plugin": "^5.6.6",
|
|
63
60
|
"import-meta-resolve": "^2.2.2",
|
|
64
61
|
"ini": "^4.1.3",
|
|
65
|
-
"install": "^0.13.0",
|
|
66
62
|
"lodash.clonedeep": "^4.5.0",
|
|
67
|
-
"mini-css-extract-plugin": "^2.10.1",
|
|
68
|
-
"node-fetch": "^3.3.2",
|
|
69
|
-
"npm": "^11.12.0",
|
|
70
63
|
"npm-run-all": "^4.1.5",
|
|
71
64
|
"open": "^8.4.2",
|
|
72
65
|
"path-to-regexp": "^6.3.0",
|
|
73
66
|
"postcss": "^8.5.8",
|
|
74
67
|
"precinct": "^12.2.0",
|
|
75
68
|
"react-router": "^6.30.3",
|
|
76
|
-
"redaxios": "^0.5.1",
|
|
77
69
|
"require-resolve-hook": "^1.1.0",
|
|
78
|
-
"rmfr": "^2.0.0",
|
|
79
70
|
"rollup": "^2.80.0",
|
|
80
71
|
"rollup-plugin-gzip": "^3.1.2",
|
|
81
|
-
"rollup-plugin-terser": "^7.0.2",
|
|
82
72
|
"sass": "^1.98.0",
|
|
83
73
|
"serialize-javascript": "^6.0.2",
|
|
84
74
|
"slash": "^4.0.0",
|
|
@@ -88,8 +78,6 @@
|
|
|
88
78
|
"sxy-lib-object-copy": "^2.0.5",
|
|
89
79
|
"sxy-loader": "^3.1.0",
|
|
90
80
|
"sxy-package-investigator": "^1.0.0",
|
|
91
|
-
"terser-webpack-plugin": "^5.4.0",
|
|
92
|
-
"util": "^0.12.5",
|
|
93
81
|
"zod": "^4.3.6"
|
|
94
82
|
},
|
|
95
83
|
"devDependencies": {
|
|
@@ -98,7 +86,6 @@
|
|
|
98
86
|
"@types/babel-types": "^7.0.16",
|
|
99
87
|
"@types/babel__core": "^7.20.5",
|
|
100
88
|
"@types/babel__generator": "^7.27.0",
|
|
101
|
-
"@types/bcrypt": "^5.0.2",
|
|
102
89
|
"@types/bcryptjs": "^2.4.6",
|
|
103
90
|
"@types/chai": "^4.3.20",
|
|
104
91
|
"@types/cookie-parser": "^1.4.10",
|
|
@@ -119,25 +106,18 @@
|
|
|
119
106
|
"babel-plugin-sxy-transform-import-extensions": "^1.0.5",
|
|
120
107
|
"babel-plugin-transform-import-extension": "^1.0.3",
|
|
121
108
|
"chai": "^4.5.0",
|
|
122
|
-
"chai-subset": "^1.6.0",
|
|
123
109
|
"csstype": "^3.2.3",
|
|
124
110
|
"eslint": "^8.57.1",
|
|
125
111
|
"eslint-import-resolver-typescript": "^2.7.1",
|
|
126
112
|
"eslint-plugin-import": "^2.32.0",
|
|
127
113
|
"eslint-plugin-no-type-assertion": "^1.3.0",
|
|
128
114
|
"happy-dom": "^20.10.6",
|
|
129
|
-
"progress-webpack-plugin": "^1.0.16",
|
|
130
115
|
"prop-types": "^15.8.1",
|
|
131
116
|
"rimraf": "^5.0.10",
|
|
132
|
-
"rmrf": "^2.0.4",
|
|
133
117
|
"rollup-plugin-visualizer": "^5.14.0",
|
|
134
|
-
"supertest": "^6.3.4",
|
|
135
118
|
"sxy-test-runner": "^2.2.2",
|
|
136
119
|
"sxy-types": "^1.0.23",
|
|
137
|
-
"typescript": "^6.0.3"
|
|
138
|
-
"webpack-bundle-analyzer": "^4.10.2",
|
|
139
|
-
"webpack-cli": "^4.10.0",
|
|
140
|
-
"webpack-stats-plugin": "^1.1.3"
|
|
120
|
+
"typescript": "^6.0.3"
|
|
141
121
|
},
|
|
142
122
|
"peerDependencies": {
|
|
143
123
|
"react": "^18.2.0 || ^19.0.0",
|
package/types/modules.d.ts
CHANGED
|
@@ -4,4 +4,35 @@ declare module 'babel-plugin-css-to-js'
|
|
|
4
4
|
declare module '@babel/plugin-transform-class-properties'
|
|
5
5
|
declare module '@rollup/plugin-node-resolve'
|
|
6
6
|
declare module '@rollup/plugin-commonjs'
|
|
7
|
-
|
|
7
|
+
// Its shipped types resolve as CJS under NodeNext (no "type":"module", no import/require
|
|
8
|
+
// conditions in its exports map), so tsc sees a namespace and the default export isn't
|
|
9
|
+
// callable. Redeclared here instead. terser's own types aren't reachable -- it's a
|
|
10
|
+
// transitive dep, so pnpm keeps it out of the top-level node_modules -- hence the
|
|
11
|
+
// hand-written option list; nested option objects are left loose on purpose.
|
|
12
|
+
declare module '@rollup/plugin-terser' {
|
|
13
|
+
import type { Plugin } from 'rollup'
|
|
14
|
+
|
|
15
|
+
type TerserNested = Record<string, unknown>
|
|
16
|
+
|
|
17
|
+
export interface Options {
|
|
18
|
+
compress?: boolean | TerserNested
|
|
19
|
+
ecma?: 5 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020
|
|
20
|
+
enclose?: boolean | string
|
|
21
|
+
format?: TerserNested
|
|
22
|
+
ie8?: boolean
|
|
23
|
+
keep_classnames?: boolean | RegExp
|
|
24
|
+
keep_fnames?: boolean | RegExp
|
|
25
|
+
mangle?: boolean | TerserNested
|
|
26
|
+
module?: boolean
|
|
27
|
+
parse?: TerserNested
|
|
28
|
+
safari10?: boolean
|
|
29
|
+
sourceMap?: boolean | TerserNested
|
|
30
|
+
toplevel?: boolean
|
|
31
|
+
/** Added by the plugin, not terser itself. */
|
|
32
|
+
nameCache?: Record<string, unknown>
|
|
33
|
+
/** Added by the plugin, not terser itself. */
|
|
34
|
+
maxWorkers?: number
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export default function terser(options?: Options): Plugin
|
|
38
|
+
}
|