@s-ui/bundler 9.39.0-typescript.109 → 9.39.0-typescript.111

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@s-ui/bundler",
3
- "version": "9.39.0-typescript.109",
3
+ "version": "9.39.0-typescript.111",
4
4
  "description": "Config-free bundler for ES6 React apps.",
5
5
  "bin": {
6
6
  "sui-bundler": "./bin/sui-bundler.js"
@@ -23,7 +23,7 @@
23
23
  "homepage": "https://github.com/SUI-Components/sui/tree/master/packages/sui-bundler#readme",
24
24
  "dependencies": {
25
25
  "@babel/core": "7.21.8",
26
- "@s-ui/helpers": "1",
26
+ "@s-ui/helpers": "typescript",
27
27
  "@s-ui/sass-loader": "1",
28
28
  "@s-ui/typescript-config": "typescript",
29
29
  "@swc/core": "1.3.14",
@@ -4,6 +4,7 @@ const crypto = require('crypto')
4
4
  const fs = require('fs-extra')
5
5
  const path = require('path')
6
6
  const {writeFile} = require('@s-ui/helpers/file.js')
7
+ const {dynamicPackage} = require('@s-ui/helpers/packages')
7
8
 
8
9
  const {INIT_CWD} = process.env
9
10
  const tsConfigTemplate = `\
@@ -17,9 +18,14 @@ const tsConfigTemplate = `\
17
18
 
18
19
  const md5 = str => crypto.createHash('md5').update(str).digest('hex')
19
20
  const TS_CONFIG_PATH = path.join(INIT_CWD, 'tsconfig.json')
21
+ const PACKAGE_JSON_CONFIG_PATH = path.join(INIT_CWD, 'package.json')
22
+
23
+ const config = require(PACKAGE_JSON_CONFIG_PATH)?.config?.['sui-bundler'] || {}
20
24
 
21
25
  const shouldGenerateTSConfig = () => {
22
26
  try {
27
+ if (!config?.type || config?.type !== 'typescript') return false
28
+
23
29
  if (!fs.existsSync(TS_CONFIG_PATH)) return true
24
30
 
25
31
  const tsConfigLocal = fs.readFileSync(TS_CONFIG_PATH, {encoding: 'utf8'})
@@ -38,6 +44,7 @@ async function main() {
38
44
  process.exit(0)
39
45
  }
40
46
  await writeFile(TS_CONFIG_PATH, tsConfigTemplate)
47
+ await dynamicPackage('typescript')
41
48
  console.log(
42
49
  '❌ [sui-bundler postinstall] tsconfig.json was not up to date, so we updated it'
43
50
  )
@@ -34,7 +34,15 @@ const webpackConfig = {
34
34
  resolve: {
35
35
  alias: {
36
36
  ...defaultAlias,
37
- ...aliasFromConfig
37
+ ...aliasFromConfig,
38
+ 'react/jsx-dev-runtime.js': path.resolve(
39
+ process.cwd(),
40
+ 'node_modules/react/jsx-dev-runtime.js'
41
+ ),
42
+ 'react/jsx-runtime.js': path.resolve(
43
+ process.cwd(),
44
+ 'node_modules/react/jsx-runtime.js'
45
+ )
38
46
  },
39
47
  fallback: {
40
48
  fs: false,