proteum 1.0.0-2 → 1.0.0-4

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/cli/bin.js CHANGED
@@ -2,10 +2,34 @@
2
2
 
3
3
  const path = require('path');
4
4
 
5
+ /*
6
+ Why this exists (npm i vs npm link difference)
7
+
8
+ Proteum's CLI is written in TypeScript and is executed via ts-node at runtime.
9
+ When Proteum is installed from npm, `cli/tsconfig.json` lives inside `node_modules/proteum/cli`.
10
+
11
+ ts-node's default ignore pattern (`/(?:^|\\/)node_modules\\//`) is applied to *paths relative to the tsconfig folder*.
12
+ For hoisted deps (ex: `node_modules/tailwindcss/...`), the relative path becomes `../../tailwindcss/...` (no `node_modules/` segment),
13
+ so ts-node mistakenly transpiles those sibling dependencies.
14
+
15
+ Tailwind v4 contains `class ... extends Map` and downleveling that to ES5 turns `super()` into `Map.call(this)`,
16
+ which throws: "TypeError: Constructor Map requires 'new'".
17
+
18
+ Fix: extend ts-node ignore patterns so it also ignores `../../<pkg>/...` (hoisted siblings), while still allowing the CLI
19
+ to `require()` the user's app config (ex: `../../../server/config/*.ts`).
20
+ */
21
+ if (!process.env.TS_NODE_IGNORE) {
22
+ process.env.TS_NODE_IGNORE = [
23
+ // Default ts-node ignore rule (works when deps are nested under `../node_modules/...`)
24
+ '(?:^|/)node_modules/',
25
+ // Extra rule for deps hoisted next to Proteum (ex: `../../tailwindcss/...`)
26
+ '^\\.\\./\\.\\./(?!\\./|\\.\\./)[^/]+/'
27
+ ].join(',');
28
+ }
29
+
5
30
  process.env.TS_NODE_PROJECT = path.join(__dirname, 'tsconfig.json');
6
31
  process.env.TS_NODE_TRANSPILE_ONLY = '1';
7
32
 
8
33
  require('ts-node/register/transpile-only');
9
34
 
10
35
  require('./index.ts');
11
-
@@ -4,7 +4,7 @@ import type webpack from 'webpack';
4
4
  module.exports = (app: App, dev: boolean, client: boolean): webpack.RuleSetRule[] => {
5
5
 
6
6
  return [{
7
- test: /\.(bmp|gif|png|jpg|jpegico|svg|webp)$/,
7
+ test: /\.(bmp|gif|png|jpe?g|ico|svg|webp)$/i,
8
8
  type: 'asset',
9
9
  parser: {
10
10
  dataUrlCondition: {
@@ -15,7 +15,8 @@ module.exports = (app: App, dev: boolean, client: boolean): webpack.RuleSetRule[
15
15
  }
16
16
  }
17
17
 
18
- },
18
+ },
19
+
19
20
  ...(dev ? [] : [{
20
21
  test: /\.(jpg|jpeg|png)$/i,
21
22
  type: "javascript/auto",
@@ -29,12 +30,12 @@ module.exports = (app: App, dev: boolean, client: boolean): webpack.RuleSetRule[
29
30
  publicPath: '/public',
30
31
 
31
32
  // Triggers error
32
- // cacheDirectory: true,
33
+ // cacheDirectory: true,
33
34
  }
34
- }]
35
- }]),
36
-
37
- {
35
+ }],
36
+ }]),
37
+
38
+ {
38
39
  test: /\.(webm|mp4|avi|mpk|mov|mkv)$/,
39
40
  type: 'asset/resource',
40
41
  },]
@@ -5,6 +5,8 @@ import type { App } from '../../../app';
5
5
 
6
6
  module.exports = (app: App, dev: Boolean, client: boolean) => {
7
7
 
8
+ console.log('app.paths.root', app.paths.root)
9
+
8
10
  return [
9
11
 
10
12
  // Apply PostCSS plugins including autoprefixer
package/cli/tsconfig.json CHANGED
@@ -1,6 +1,10 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
 
4
+ // We run the CLI through ts-node in production, so we must use a modern target.
5
+ // In particular, downleveling built-in subclasses (ex: `class extends Map`) to ES5 breaks at runtime.
6
+ "target": "ES2021",
7
+ "module": "CommonJS",
4
8
 
5
9
  "esModuleInterop": true,
6
10
  "skipLibCheck": true,
@@ -35,4 +39,4 @@
35
39
  },
36
40
 
37
41
  "include": ["./"]
38
- }
42
+ }
@@ -20,6 +20,8 @@ import type { AnyService } from './service';
20
20
 
21
21
  export { default as Service } from './service';
22
22
 
23
+ import 'tailwindcss';
24
+
23
25
  /*----------------------------------
24
26
  - TYPES
25
27
  ----------------------------------*/
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "proteum",
3
3
  "description": "Convenient TypeScript framework designed for Performance and Productivity.",
4
- "version": "1.0.0-2",
4
+ "version": "1.0.0-4",
5
5
  "author": "Gaetan Le Gac (https://github.com/gaetanlegac)",
6
6
  "repository": "git://github.com/gaetanlegac/proteum.git",
7
7
  "license": "MIT",