@_linked/cli 1.8.1 → 1.9.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.
Files changed (207) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/defaults/setup-publish/dual-branch/github/workflows/publish.yml +3 -0
  3. package/defaults/setup-publish/github/workflows/publish.yml +3 -0
  4. package/defaults/shape.ts +8 -2
  5. package/jest.config.cjs +8 -4
  6. package/lib/esm/cli-methods.d.ts +11 -3
  7. package/lib/esm/cli-methods.d.ts.map +1 -1
  8. package/lib/esm/cli-methods.js +51 -105
  9. package/lib/esm/cli-methods.js.map +1 -1
  10. package/lib/esm/cli.js +32 -8
  11. package/lib/esm/cli.js.map +1 -1
  12. package/lib/esm/commands/start.d.ts +6 -0
  13. package/lib/esm/commands/start.d.ts.map +1 -0
  14. package/lib/esm/commands/start.js +311 -0
  15. package/lib/esm/commands/start.js.map +1 -0
  16. package/lib/esm/config-webpack-app.d.ts +1 -1
  17. package/lib/esm/config-webpack-app.d.ts.map +1 -1
  18. package/lib/esm/config-webpack-app.js +1 -1
  19. package/lib/esm/config-webpack-app.js.map +1 -1
  20. package/lib/esm/config-webpack.d.ts +1 -1
  21. package/lib/esm/config-webpack.d.ts.map +1 -1
  22. package/lib/esm/config-webpack.js +4 -4
  23. package/lib/esm/config-webpack.js.map +1 -1
  24. package/lib/esm/defineConfig.d.ts +1 -1
  25. package/lib/esm/defineConfig.d.ts.map +1 -1
  26. package/lib/esm/index.d.ts +1 -1
  27. package/lib/esm/index.d.ts.map +1 -1
  28. package/lib/esm/index.js +1 -1
  29. package/lib/esm/index.js.map +1 -1
  30. package/lib/esm/interfaces.d.ts +9 -0
  31. package/lib/esm/interfaces.d.ts.map +1 -1
  32. package/lib/esm/lifecycle.d.ts +24 -0
  33. package/lib/esm/lifecycle.d.ts.map +1 -0
  34. package/lib/esm/lifecycle.js +156 -0
  35. package/lib/esm/lifecycle.js.map +1 -0
  36. package/lib/esm/loaders/ts-loader.d.mts.map +1 -1
  37. package/lib/esm/loaders/ts-loader.mjs +11 -2
  38. package/lib/esm/loaders/ts-loader.mjs.map +1 -1
  39. package/lib/esm/utils.d.ts +1 -1
  40. package/lib/esm/utils.d.ts.map +1 -1
  41. package/lib/esm/utils.js +9 -3
  42. package/lib/esm/utils.js.map +1 -1
  43. package/lib/esm/vite-config.d.ts +20 -0
  44. package/lib/esm/vite-config.d.ts.map +1 -0
  45. package/lib/esm/vite-config.js +410 -0
  46. package/lib/esm/vite-config.js.map +1 -0
  47. package/package.json +13 -14
  48. package/test-results/.last-run.json +6 -0
  49. package/test-results/create-app-Person-fixture-add-/342/206/222-edit-/342/206/222-delete-round-trip/error-context.md +16 -0
  50. package/test-results/create-app-Person-fixture-add-/342/206/222-edit-/342/206/222-delete-round-trip/trace.zip +0 -0
  51. package/tests/unit/safeYarn.test.ts +1 -1
  52. package/tsconfig-esm.json +1 -1
  53. package/defaults/app-with-backend/.env-cmdrc.json +0 -19
  54. package/defaults/app-with-backend/.eslintignore +0 -5
  55. package/defaults/app-with-backend/.eslintrc.json +0 -40
  56. package/defaults/app-with-backend/.prettierignore +0 -4
  57. package/defaults/app-with-backend/.prettierrc.json +0 -27
  58. package/defaults/app-with-backend/.vscode/launch.json +0 -12
  59. package/defaults/app-with-backend/.yarn/plugins/@yarnpkg/plugin-version.cjs +0 -550
  60. package/defaults/app-with-backend/.yarn/releases/yarn-3.6.1.cjs +0 -874
  61. package/defaults/app-with-backend/gitignore.template +0 -25
  62. package/defaults/app-with-backend/linked.backend.datasets.example.json +0 -17
  63. package/defaults/app-with-backend/linked.backend.storage.ts +0 -35
  64. package/defaults/app-with-backend/linked.config.js +0 -5
  65. package/defaults/app-with-backend/package.json +0 -70
  66. package/defaults/app-with-backend/pm2-staging.config.js +0 -12
  67. package/defaults/app-with-backend/pm2.config.js +0 -12
  68. package/defaults/app-with-backend/public/favicon-144x144.png +0 -0
  69. package/defaults/app-with-backend/public/favicon-57x57.png +0 -0
  70. package/defaults/app-with-backend/public/favicon-72x72.png +0 -0
  71. package/defaults/app-with-backend/public/favicon.ico +0 -0
  72. package/defaults/app-with-backend/readme.md +0 -93
  73. package/defaults/app-with-backend/src/App.module.css +0 -83
  74. package/defaults/app-with-backend/src/App.tsx +0 -30
  75. package/defaults/app-with-backend/src/backend.ts +0 -9
  76. package/defaults/app-with-backend/src/components/Error.module.css +0 -9
  77. package/defaults/app-with-backend/src/components/Error.tsx +0 -11
  78. package/defaults/app-with-backend/src/components/PersonOverview.module.css +0 -100
  79. package/defaults/app-with-backend/src/components/PersonOverview.tsx +0 -97
  80. package/defaults/app-with-backend/src/components/PersonOverviewContext.tsx +0 -12
  81. package/defaults/app-with-backend/src/components/PersonPreview.module.css +0 -97
  82. package/defaults/app-with-backend/src/components/PersonPreview.tsx +0 -109
  83. package/defaults/app-with-backend/src/components/Spinner.module.css +0 -17
  84. package/defaults/app-with-backend/src/components/Spinner.tsx +0 -12
  85. package/defaults/app-with-backend/src/index.tsx +0 -34
  86. package/defaults/app-with-backend/src/layout/DefaultLayout.module.css +0 -15
  87. package/defaults/app-with-backend/src/layout/DefaultLayout.tsx +0 -12
  88. package/defaults/app-with-backend/src/layout/Header.module.css +0 -46
  89. package/defaults/app-with-backend/src/layout/Header.tsx +0 -27
  90. package/defaults/app-with-backend/src/linked.frontend.datasets.json +0 -12
  91. package/defaults/app-with-backend/src/linked.frontend.storage.ts +0 -36
  92. package/defaults/app-with-backend/src/package.ts +0 -16
  93. package/defaults/app-with-backend/src/pages/Home.module.css +0 -23
  94. package/defaults/app-with-backend/src/pages/Home.tsx +0 -14
  95. package/defaults/app-with-backend/src/pages/Page1.module.css +0 -111
  96. package/defaults/app-with-backend/src/pages/Page1.tsx +0 -196
  97. package/defaults/app-with-backend/src/pages/PageNotFound.module.css +0 -19
  98. package/defaults/app-with-backend/src/pages/PageNotFound.tsx +0 -14
  99. package/defaults/app-with-backend/src/pages/Signin.module.css +0 -20
  100. package/defaults/app-with-backend/src/pages/Signin.tsx +0 -16
  101. package/defaults/app-with-backend/src/routes.tsx +0 -78
  102. package/defaults/app-with-backend/src/theme.css +0 -91
  103. package/defaults/app-with-backend/src/types.ts +0 -14
  104. package/defaults/app-with-backend/src/utils/lazyWithPreload.tsx +0 -42
  105. package/defaults/app-with-backend/src/utils/preloadRoutes.ts +0 -38
  106. package/defaults/app-with-backend/tsconfig.json +0 -24
  107. package/defaults/app-with-backend/yarnrc.yml.template +0 -8
  108. package/lib/cjs/cli-methods.d.ts +0 -67
  109. package/lib/cjs/cli-methods.d.ts.map +0 -1
  110. package/lib/cjs/cli-methods.js +0 -2718
  111. package/lib/cjs/cli-methods.js.map +0 -1
  112. package/lib/cjs/cli.d.ts +0 -3
  113. package/lib/cjs/cli.d.ts.map +0 -1
  114. package/lib/cjs/cli.js +0 -315
  115. package/lib/cjs/cli.js.map +0 -1
  116. package/lib/cjs/commands/build-package.d.ts +0 -9
  117. package/lib/cjs/commands/build-package.d.ts.map +0 -1
  118. package/lib/cjs/commands/build-package.js +0 -55
  119. package/lib/cjs/commands/build-package.js.map +0 -1
  120. package/lib/cjs/commands/safe-yarn.d.ts +0 -10
  121. package/lib/cjs/commands/safe-yarn.d.ts.map +0 -1
  122. package/lib/cjs/commands/safe-yarn.js +0 -66
  123. package/lib/cjs/commands/safe-yarn.js.map +0 -1
  124. package/lib/cjs/commands/setup-publish.d.ts +0 -23
  125. package/lib/cjs/commands/setup-publish.d.ts.map +0 -1
  126. package/lib/cjs/commands/setup-publish.js +0 -369
  127. package/lib/cjs/commands/setup-publish.js.map +0 -1
  128. package/lib/cjs/config-webpack-app.d.ts +0 -112
  129. package/lib/cjs/config-webpack-app.d.ts.map +0 -1
  130. package/lib/cjs/config-webpack-app.js +0 -427
  131. package/lib/cjs/config-webpack-app.js.map +0 -1
  132. package/lib/cjs/config-webpack.d.ts +0 -55
  133. package/lib/cjs/config-webpack.d.ts.map +0 -1
  134. package/lib/cjs/config-webpack.js +0 -417
  135. package/lib/cjs/config-webpack.js.map +0 -1
  136. package/lib/cjs/defineConfig.d.ts +0 -8
  137. package/lib/cjs/defineConfig.d.ts.map +0 -1
  138. package/lib/cjs/defineConfig.js +0 -12
  139. package/lib/cjs/defineConfig.js.map +0 -1
  140. package/lib/cjs/index.d.ts +0 -12
  141. package/lib/cjs/index.d.ts.map +0 -1
  142. package/lib/cjs/index.js +0 -43
  143. package/lib/cjs/index.js.map +0 -1
  144. package/lib/cjs/interfaces.d.ts +0 -131
  145. package/lib/cjs/interfaces.d.ts.map +0 -1
  146. package/lib/cjs/interfaces.js +0 -3
  147. package/lib/cjs/interfaces.js.map +0 -1
  148. package/lib/cjs/loaders/css-loader.d.mts +0 -2
  149. package/lib/cjs/loaders/css-loader.d.mts.map +0 -1
  150. package/lib/cjs/loaders/css-loader.mjs +0 -86
  151. package/lib/cjs/loaders/css-loader.mjs.map +0 -1
  152. package/lib/cjs/loaders/register-css-only.d.ts +0 -2
  153. package/lib/cjs/loaders/register-css-only.d.ts.map +0 -1
  154. package/lib/cjs/loaders/register-css-only.js +0 -11
  155. package/lib/cjs/loaders/register-css-only.js.map +0 -1
  156. package/lib/cjs/loaders/register.d.ts +0 -2
  157. package/lib/cjs/loaders/register.d.ts.map +0 -1
  158. package/lib/cjs/loaders/register.js +0 -11
  159. package/lib/cjs/loaders/register.js.map +0 -1
  160. package/lib/cjs/loaders/ts-loader.d.mts +0 -3
  161. package/lib/cjs/loaders/ts-loader.d.mts.map +0 -1
  162. package/lib/cjs/loaders/ts-loader.mjs +0 -116
  163. package/lib/cjs/loaders/ts-loader.mjs.map +0 -1
  164. package/lib/cjs/metadata.d.ts +0 -1
  165. package/lib/cjs/metadata.d.ts.map +0 -1
  166. package/lib/cjs/metadata.js +0 -155
  167. package/lib/cjs/metadata.js.map +0 -1
  168. package/lib/cjs/package.json +0 -139
  169. package/lib/cjs/plugins/check-imports.d.ts +0 -2
  170. package/lib/cjs/plugins/check-imports.d.ts.map +0 -1
  171. package/lib/cjs/plugins/check-imports.js +0 -68
  172. package/lib/cjs/plugins/check-imports.js.map +0 -1
  173. package/lib/cjs/plugins/declaration-plugin.d.ts +0 -15
  174. package/lib/cjs/plugins/declaration-plugin.d.ts.map +0 -1
  175. package/lib/cjs/plugins/declaration-plugin.js +0 -285
  176. package/lib/cjs/plugins/declaration-plugin.js.map +0 -1
  177. package/lib/cjs/plugins/externalise-modules.d.ts +0 -7
  178. package/lib/cjs/plugins/externalise-modules.d.ts.map +0 -1
  179. package/lib/cjs/plugins/externalise-modules.js +0 -190
  180. package/lib/cjs/plugins/externalise-modules.js.map +0 -1
  181. package/lib/cjs/plugins/lincd-tailwind-sources.d.ts +0 -3
  182. package/lib/cjs/plugins/lincd-tailwind-sources.d.ts.map +0 -1
  183. package/lib/cjs/plugins/lincd-tailwind-sources.js +0 -32
  184. package/lib/cjs/plugins/lincd-tailwind-sources.js.map +0 -1
  185. package/lib/cjs/plugins/watch-run.d.ts +0 -5
  186. package/lib/cjs/plugins/watch-run.d.ts.map +0 -1
  187. package/lib/cjs/plugins/watch-run.js +0 -45
  188. package/lib/cjs/plugins/watch-run.js.map +0 -1
  189. package/lib/cjs/preflight.css +0 -137
  190. package/lib/cjs/tailwind.config.d.ts +0 -8
  191. package/lib/cjs/tailwind.config.d.ts.map +0 -1
  192. package/lib/cjs/tailwind.config.js +0 -17
  193. package/lib/cjs/tailwind.config.js.map +0 -1
  194. package/lib/cjs/utils.d.ts +0 -77
  195. package/lib/cjs/utils.d.ts.map +0 -1
  196. package/lib/cjs/utils.js +0 -585
  197. package/lib/cjs/utils.js.map +0 -1
  198. package/lib/esm/loaders/register-css-only.d.ts +0 -2
  199. package/lib/esm/loaders/register-css-only.d.ts.map +0 -1
  200. package/lib/esm/loaders/register-css-only.js +0 -9
  201. package/lib/esm/loaders/register-css-only.js.map +0 -1
  202. package/lib/esm/loaders/register.d.ts +0 -2
  203. package/lib/esm/loaders/register.d.ts.map +0 -1
  204. package/lib/esm/loaders/register.js +0 -9
  205. package/lib/esm/loaders/register.js.map +0 -1
  206. package/lib/esm/package.json +0 -139
  207. /package/{babel.config.js → babel.config.cjs} +0 -0
@@ -1,417 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- var __importDefault = (this && this.__importDefault) || function (mod) {
36
- return (mod && mod.__esModule) ? mod : { "default": mod };
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.generateWebpackConfig = generateWebpackConfig;
40
- const colors = __importStar(require("colors"));
41
- const declaration_plugin_1 = __importDefault(require("./plugins/declaration-plugin"));
42
- const externalise_modules_1 = __importDefault(require("./plugins/externalise-modules"));
43
- const watch_run_1 = __importDefault(require("./plugins/watch-run"));
44
- const utils_1 = require("./utils");
45
- // console.log('Webpack '+require('webpack/package.json').version);
46
- // console.log('ts-loader '+require('ts-loader/package.json').version);
47
- const fs_1 = __importDefault(require("fs"));
48
- const mini_css_extract_plugin_1 = __importDefault(require("mini-css-extract-plugin"));
49
- const path_1 = __importDefault(require("path"));
50
- const webpack_1 = __importDefault(require("webpack"));
51
- // const WebpackLicencePlugin = require('webpack-license-plugin');
52
- // const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
53
- const child_process_1 = require("child_process");
54
- const copy_webpack_plugin_1 = __importDefault(require("copy-webpack-plugin"));
55
- const terser_webpack_plugin_1 = __importDefault(require("terser-webpack-plugin"));
56
- const webpack_bundle_analyzer_1 = require("webpack-bundle-analyzer");
57
- const NODE_ENV = process.env.NODE_ENV;
58
- const nodeProduction = NODE_ENV == 'production';
59
- // const libraryName = 'lincd';
60
- process.traceDeprecation = true;
61
- function getLincdPackagePaths(packages) {
62
- if (!packages) {
63
- let pkgJson = (0, utils_1.getPackageJSON)();
64
- packages = { ...pkgJson.dependencies, ...pkgJson.devDependencies };
65
- }
66
- let lincdPackagePaths = [];
67
- for (var dependency of Object.keys(packages)) {
68
- try {
69
- let pkgJson = require(dependency + '/package.json');
70
- if (pkgJson.lincd) {
71
- let pkgPath = require.resolve(dependency + '/package.json');
72
- lincdPackagePaths.push(pkgPath.substring(0, pkgPath.length - 13));
73
- }
74
- }
75
- catch (err) {
76
- // console.log("could not find "+dependency);
77
- }
78
- }
79
- return lincdPackagePaths;
80
- }
81
- function generateWebpackConfig(buildName, moduleName, config = {}) {
82
- if (!config.externals)
83
- config.externals = {};
84
- if (!config.internals)
85
- config.internals = [];
86
- var watch = config.watch;
87
- var productionMode = nodeProduction || config.productionMode;
88
- var es5 = config.target == 'es5';
89
- var es6 = config.target == 'es6';
90
- //remove the scope (used for filenames for example)
91
- var cleanModuleName = moduleName.replace(/@[\w\-]+\//, '');
92
- var configFile;
93
- if (es5 && fs_1.default.existsSync('tsconfig-es5.json')) {
94
- configFile = 'tsconfig-es5.json';
95
- }
96
- else {
97
- configFile = 'tsconfig.json';
98
- }
99
- if (!fs_1.default.existsSync(configFile)) {
100
- (0, utils_1.warn)('Cannot find ' + configFile);
101
- process.exit();
102
- }
103
- let tsConfig = JSON.parse(fs_1.default.readFileSync(configFile, 'utf8'));
104
- var plugins = [
105
- // new webpack.DefinePlugin({
106
- // 'process.env.BROWSER': JSON.stringify(true),
107
- // 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
108
- // }),
109
- // new webpack.NoEmitOnErrorsPlugin(),
110
- // new ExtractTextPlugin(config.cssFileName ? config.cssFileName : cleanModuleName + '.css'),
111
- new mini_css_extract_plugin_1.default({
112
- // linkType: false,
113
- filename: config.cssFileName
114
- ? config.cssFileName
115
- : cleanModuleName + '.css',
116
- }),
117
- //currently not compatible with webpack 5
118
- // new WebpackLicencePlugin({
119
- // excludedPackageTest: (packageName, version) => {
120
- // return packageName.indexOf('lincd') !== -1;
121
- // },
122
- // }),
123
- //NOTE: grunt comes with a copy task, which is ran during `yarn lincd build` but cannot run during `yarn lincd dev`
124
- //so here we ALSO copy the same files to cover dev flow
125
- new copy_webpack_plugin_1.default({
126
- patterns: [
127
- {
128
- from: 'src/**/*.css',
129
- to({ context, absoluteFilename }) {
130
- // console.log(chalk.magenta(context),chalk.magenta(absoluteFilename),process.cwd());
131
- //turn absolute path into the right lib path (lib is NOT in webpack output path, so need to use '../')
132
- let outputPath = absoluteFilename
133
- .replace(process.cwd(), '')
134
- .replace('/src/', '../lib/');
135
- // console.log(chalk.blueBright(outputPath));
136
- return Promise.resolve(outputPath);
137
- },
138
- noErrorOnMissing: true,
139
- },
140
- ],
141
- }),
142
- ];
143
- if (config.debug) {
144
- plugins.push(new watch_run_1.default());
145
- }
146
- if (config.afterBuildCommand || config.afterFirstBuildCommand) {
147
- let executedFirstCommand = false;
148
- plugins.push({
149
- apply: (compiler) => {
150
- compiler.hooks.afterEmit.tap('AfterEmitPlugin', (compilation) => {
151
- if (config.afterBuildCommand) {
152
- (0, child_process_1.exec)(config.afterBuildCommand, (err, stdout, stderr) => {
153
- if (stdout)
154
- process.stdout.write(stdout);
155
- if (stderr)
156
- process.stderr.write(stderr);
157
- });
158
- }
159
- if (config.afterFirstBuildCommand && !executedFirstCommand) {
160
- executedFirstCommand = true;
161
- (0, child_process_1.exec)(config.afterFirstBuildCommand, (err, stdout, stderr) => {
162
- if (stdout)
163
- process.stdout.write(stdout);
164
- if (stderr)
165
- process.stderr.write(stderr);
166
- });
167
- }
168
- });
169
- },
170
- });
171
- }
172
- if (config.analyse) {
173
- plugins.push(new webpack_bundle_analyzer_1.BundleAnalyzerPlugin());
174
- }
175
- if ((es6 || config.declarations === true) && !config.declarations === false) {
176
- plugins.push(new declaration_plugin_1.default({
177
- out: (config.filename ? config.filename : cleanModuleName) + '.d.ts',
178
- root: config.outputPath ? config.outputPath : './lib/',
179
- debug: 'debug' in config ? config.debug : false,
180
- }));
181
- }
182
- // var resolvePlugins = [
183
- // new TsconfigPathsPlugin({
184
- // configFile: configFile,
185
- // silent: true,
186
- // }),
187
- // ];
188
- var aliases = config.alias || {};
189
- let postcssPlugins = [];
190
- if (!config.cssMode) {
191
- config.cssMode = 'tailwind';
192
- }
193
- if (config.cssMode === 'tailwind') {
194
- let lincdPackagePaths;
195
- //IF this package is including sources from another lincd package in its bundle (usually not the case)
196
- if (config.internals) {
197
- //THEN make sure that we also look for tailwind classes in those packages
198
- //pass the list of internal packages, or if all, pass null because it will look up all the package.json:dependencies
199
- lincdPackagePaths = getLincdPackagePaths(config.internals !== '*' ? config.internals : null).map((path) => {
200
- return path + '/lib/**/*.{js,mjs}';
201
- });
202
- }
203
- postcssPlugins.push([
204
- '@tailwindcss/postcss',
205
- {
206
- //Tailwind v4 has very limited options for postcss
207
- //use @ directives instead
208
- // content: {
209
- // files: ['./src/**/*.{tsx,ts}', ...lincdPackagePaths],
210
- // },
211
- // plugins: [],
212
- },
213
- ]);
214
- }
215
- else {
216
- // postcss mode: use postcss-nested to enable nesting of css
217
- postcssPlugins.push(['postcss-import', {}], [
218
- 'postcss-preset-env',
219
- {
220
- features: { 'nesting-rules': true },
221
- },
222
- ]);
223
- }
224
- let rules = [
225
- {
226
- test: /\.css$/,
227
- use: [
228
- mini_css_extract_plugin_1.default.loader,
229
- {
230
- loader: 'css-loader',
231
- options: {
232
- url: false,
233
- importLoaders: 1,
234
- modules: {
235
- mode: 'local',
236
- auto: (resourcePath) => {
237
- //make sure this only applies to .module.css files, and not to tailwind
238
- return (/\.module\.css$/i.test(resourcePath) &&
239
- !/tailwind/i.test(resourcePath));
240
- },
241
- getLocalIdent: (context, localIdentName, localName) => {
242
- return (0, utils_1.generateScopedName)(localName, context.resourcePath);
243
- },
244
- },
245
- },
246
- },
247
- {
248
- loader: 'postcss-loader',
249
- options: {
250
- postcssOptions: {
251
- plugins: postcssPlugins,
252
- },
253
- },
254
- },
255
- ],
256
- },
257
- // {
258
- // test: /\.(ts|tsx)$/,
259
- // exclude: /node_modules/,
260
- // //include: [path.join(process.cwd(),"frontend")], // only bundle files in this directory
261
- // use: {
262
- // loader: "babel-loader", // cf. .babelrc.json in this folder and browser list in package.json
263
- // options: {
264
- // // plugins: productionMode ? [] : ["react-refresh/babel"],
265
- // cacheCompression: false,
266
- // cacheDirectory: true,
267
- // presets: [
268
- // "@babel/preset-env",
269
- // ["@babel/preset-react", {"runtime": "automatic"}],
270
- // "@babel/preset-typescript",
271
- // ],
272
- // plugins: [
273
- // "@babel/plugin-transform-runtime",
274
- // ["@babel/plugin-proposal-decorators",{
275
- // decoratorsBeforeExport:true
276
- // }]
277
- // ],
278
- // },
279
- // },
280
- // },
281
- {
282
- test: /\.tsx?$/,
283
- use: [
284
- {
285
- loader: 'ts-loader?' +
286
- JSON.stringify({
287
- configFile: configFile,
288
- compilerOptions: {
289
- declaration: !es5,
290
- /*
291
- for webpack we overwrite the module settings of the modules' tsconfig file
292
- because we NEED esnext for code splitting. But the VM we currently use for the registry does not support esnext modules
293
- */
294
- module: 'esnext',
295
- moduleResolution: 'node',
296
- },
297
- ...config.tsConfigOverwrites,
298
- }),
299
- },
300
- ],
301
- },
302
- {
303
- test: /[\w]+/,
304
- use: [
305
- {
306
- loader: path_1.default.resolve(__dirname, 'plugins', 'check-imports.js'),
307
- options: {},
308
- },
309
- ],
310
- },
311
- // {
312
- // enforce: 'pre',
313
- // test: /\.js$/,
314
- // use: [
315
- // {
316
- // loader: 'source-map-loader',
317
- // },
318
- // ],
319
- // },
320
- ];
321
- if (es5 && config.internalsources && config.internalsources.length > 0) {
322
- //usually a module that transpiles to es5 will only have es5 code in the bundle.
323
- //however a module that INTERNALISES other dacore modules will directly include es6 code from @dacore/other_modules/lib
324
- //which eventually results in an import of @dacore/core being bundled as 'const =', which trips up old browsers
325
- //so we fix that here by just referring directly to the typescript source instead of the transpiled js for internalised modules
326
- //however this means that for internalised modules THE SOURCE CODE NEEDS TO BE AVAILABLE. This is currently NOT the case with how we publish modules to yarn
327
- //so that means internalised modules need to be LOCALLY AVAILABLE with yarn workspaces
328
- plugins.push(new webpack_1.default.NormalModuleReplacementPlugin(/lincd\/lib\//, (resource) => {
329
- let moduleName = resource.request.match(/lincd\/lib\//)[1];
330
- if (config.internalsources.indexOf(moduleName) !== -1) {
331
- console.log(colors.magenta('internal sources + ES5: Replacing /lib/ with /src/ for source-internalised module ' +
332
- moduleName));
333
- resource.request = resource.request.replace('/lib/', '/src/');
334
- console.log(colors.magenta('internal sources + ES5: ' + resource.request));
335
- console.log(colors.red("WARNING: Make sure you have the TYPESCRIPT SOURCE FILES of the modules listed as 'internal' AVAILABLE ON YOUR LOCAL MACHINE. So if you check in node_modules/your-internalised-module - that should be a symbolic link and you will find a 'src' folder with typescript files there."));
336
- }
337
- }));
338
- }
339
- return {
340
- entry: config.entry
341
- ? config.entry
342
- : tsConfig.files
343
- ? tsConfig.files
344
- : './src/index.ts',
345
- output: {
346
- filename: (config.filename ? config.filename : cleanModuleName) +
347
- (es5 ? '.es5' : '') +
348
- '.js',
349
- path: path_1.default.resolve(process.cwd(), config.bundlePath || 'dist'),
350
- devtoolModuleFilenameTemplate: moduleName + '/[resource-path]',
351
- },
352
- devtool: productionMode ? 'source-map' : 'cheap-module-source-map',
353
- // devtool: productionMode ? 'cheap-source-map' : 'cheap-source-map',
354
- mode: productionMode ? 'production' : 'development',
355
- //fixing a persistent but strange build error here that showed up once, this is a workaround. See: https://github.com/webpack-contrib/css-loader/issues/447
356
- // node: {
357
- // fs: 'empty',
358
- // child_process: 'empty',
359
- // },
360
- resolve: {
361
- extensions: ['.webpack.js', '.js', '.ts', '.tsx', '.json'],
362
- alias: aliases,
363
- // plugins: resolvePlugins,
364
- fallback: { crypto: false },
365
- },
366
- resolveLoader: {
367
- modules: [
368
- path_1.default.join(__dirname, 'plugins'), //load webpack our own custom-made loaders from the plugin folder
369
- path_1.default.join(__dirname, '..', 'node_modules'), //load webpack loaders from this lincd-cli library instead of the library that's using it to build its project
370
- 'node_modules',
371
- ],
372
- },
373
- optimization: {
374
- minimize: productionMode,
375
- minimizer: [
376
- new terser_webpack_plugin_1.default({
377
- extractComments: {
378
- condition: /^\**!|@preserve|@license|@cc_on/i,
379
- banner: (licenseFile) => {
380
- return `License information can be found in ${licenseFile} and oss-licences.json`;
381
- },
382
- },
383
- }),
384
- ],
385
- },
386
- watch: watch,
387
- watchOptions: {
388
- ignored: ['**/*.d.ts', '**/*.js.map', '**/*.css.json'],
389
- aggregateTimeout: 500,
390
- },
391
- module: {
392
- rules,
393
- },
394
- //See plugins/externalise-modules.ts We're passing in a function here that determines what to exclude from the bundle and what not
395
- //See also https://webpack.js.org/configuration/externals/
396
- externals: (0, externalise_modules_1.default)(config, es5),
397
- plugins: plugins,
398
- stats: {
399
- errorDetails: true, //config.debug,
400
- chunks: false,
401
- children: true,
402
- version: true,
403
- hash: false,
404
- entrypoints: false,
405
- modules: false,
406
- },
407
- //hide some info from output when in watch mode to keep it succinct
408
- //stats:{chunks:!watch,version:!watch}//hide some info from output when in watch mode to keep it succinct
409
- cache: {
410
- // https://webpack.js.org/configuration/other-options/#cache
411
- type: 'filesystem',
412
- // cacheDirectory: path.resolve(process.cwd(),"node_modules",".cache","webpack"),
413
- // name: "lincd-webpack-cache",
414
- },
415
- };
416
- }
417
- //# sourceMappingURL=config-webpack.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config-webpack.js","sourceRoot":"","sources":["../../src/config-webpack.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA,sDAsXC;AAzaD,+CAAiC;AAEjC,sFAA6D;AAC7D,wFAA+D;AAC/D,oEAAiD;AACjD,mCAAiE;AACjE,mEAAmE;AACnE,uEAAuE;AAEvE,4CAAoB;AACpB,sFAA2D;AAC3D,gDAAwB;AACxB,sDAA8B;AAC9B,kEAAkE;AAClE,wEAAwE;AACxE,iDAAmC;AACnC,8EAA6C;AAC7C,kFAAiD;AACjD,qEAA6D;AAO7D,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;AACtC,MAAM,cAAc,GAAG,QAAQ,IAAI,YAAY,CAAC;AAEhD,+BAA+B;AAC/B,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;AAEhC,SAAS,oBAAoB,CAAC,QAAS;IACrC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,IAAI,OAAO,GAAG,IAAA,sBAAc,GAAE,CAAC;QAC/B,QAAQ,GAAG,EAAC,GAAG,OAAO,CAAC,YAAY,EAAE,GAAG,OAAO,CAAC,eAAe,EAAC,CAAC;IACnE,CAAC;IACD,IAAI,iBAAiB,GAAG,EAAE,CAAC;IAC3B,KAAK,IAAI,UAAU,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC7C,IAAI,CAAC;YACH,IAAI,OAAO,GAAG,OAAO,CAAC,UAAU,GAAG,eAAe,CAAC,CAAC;YACpD,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;gBAClB,IAAI,OAAO,GAAG,OAAO,CAAC,OAAO,CAA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gBACP,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,iEAAiE;gBAClG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,8GAA8G;gBAC1J,cAAc;aACf;SACF;QACD,YAAY,EAAE;YACZ,QAAQ,EAAE,cAAc;YACxB,SAAS,EAAE;gBACT,IAAI,+BAAY,CAAC;oBACf,eAAe,EAAE;wBACf,SAAS,EAAE,kCAAkC;wBAC7C,MAAM,EAAE,CAAC,WAAW,EAAE,EAAE;4BACtB,OAAO,uCAAuC,WAAW,wBAAwB,CAAC;wBACpF,CAAC;qBACF;iBACF,CAAC;aACH;SACF;QACD,KAAK,EAAE,KAAK;QACZ,YAAY,EAAE;YACZ,OAAO,EAAE,CAAC,WAAW,EAAE,aAAa,EAAE,eAAe,CAAC;YACtD,gBAAgB,EAAE,GAAG;SACtB;QACD,MAAM,EAAE;YACN,KAAK;SACN;QACD,kIAAkI;QAClI,0DAA0D;QAC1D,SAAS,EAAE,IAAA,6BAAkB,EAAC,MAAM,EAAE,GAAG,CAAC;QAC1C,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE;YACL,YAAY,EAAE,IAAI,EAAE,eAAe;YACnC,MAAM,EAAE,KAAK;YACb,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,IAAI;YACb,IAAI,EAAE,KAAK;YACX,WAAW,EAAE,KAAK;YAClB,OAAO,EAAE,KAAK;SACf;QAED,mEAAmE;QACnE,yGAAyG;QACzG,KAAK,EAAE;YACL,4DAA4D;YAC5D,IAAI,EAAE,YAAY;YAClB,iFAAiF;YACjF,+BAA+B;SAChC;KACF,CAAC;AACJ,CAAC"}
@@ -1,8 +0,0 @@
1
- import { LinkedConfig } from './interfaces';
2
- /**
3
- * Define a Linked configuration with type checking and autocomplete
4
- * @param config The configuration object
5
- * @returns The same configuration object (identity function for type inference)
6
- */
7
- export declare function defineConfig(config: LinkedConfig): LinkedConfig;
8
- //# sourceMappingURL=defineConfig.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"defineConfig.d.ts","sourceRoot":"","sources":["../../src/defineConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,cAAc,CAAC;AAE1C;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,YAAY,CAE/D"}
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defineConfig = defineConfig;
4
- /**
5
- * Define a Linked configuration with type checking and autocomplete
6
- * @param config The configuration object
7
- * @returns The same configuration object (identity function for type inference)
8
- */
9
- function defineConfig(config) {
10
- return config;
11
- }
12
- //# sourceMappingURL=defineConfig.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"defineConfig.js","sourceRoot":"","sources":["../../src/defineConfig.ts"],"names":[],"mappings":";;AAOA,oCAEC;AAPD;;;;GAIG;AACH,SAAgB,YAAY,CAAC,MAAoB;IAC/C,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -1,12 +0,0 @@
1
- export { default as DeclarationPlugin } from './plugins/declaration-plugin';
2
- export { default as externaliseModules } from './plugins/externalise-modules';
3
- export { default as tailwindConfig } from './tailwind.config';
4
- import { generateWebpackConfig } from './config-webpack';
5
- export { generateWebpackConfig };
6
- export * from './utils';
7
- export { defineConfig } from './defineConfig';
8
- export type { LinkedConfig, LinkedWebpackConfig, LinkedServerConfig, } from './interfaces';
9
- export { buildPackageByPath } from './commands/build-package';
10
- export { safeYarn } from './commands/safe-yarn';
11
- export { setupPublish } from './commands/setup-publish';
12
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,IAAI,iBAAiB,EAAC,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAC,OAAO,IAAI,kBAAkB,EAAC,MAAM,+BAA+B,CAAC;AAK5E,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAC,qBAAqB,EAAC,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAC,qBAAqB,EAAC,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAC5C,YAAY,EACV,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAC,kBAAkB,EAAC,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAC"}
package/lib/cjs/index.js DELETED
@@ -1,43 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- var __importDefault = (this && this.__importDefault) || function (mod) {
17
- return (mod && mod.__esModule) ? mod : { "default": mod };
18
- };
19
- Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.setupPublish = exports.safeYarn = exports.buildPackageByPath = exports.defineConfig = exports.generateWebpackConfig = exports.tailwindConfig = exports.externaliseModules = exports.DeclarationPlugin = void 0;
21
- var declaration_plugin_1 = require("./plugins/declaration-plugin");
22
- Object.defineProperty(exports, "DeclarationPlugin", { enumerable: true, get: function () { return __importDefault(declaration_plugin_1).default; } });
23
- var externalise_modules_1 = require("./plugins/externalise-modules");
24
- Object.defineProperty(exports, "externaliseModules", { enumerable: true, get: function () { return __importDefault(externalise_modules_1).default; } });
25
- // './plugins/check-imports' is a webpack loader (CJS, uses require()). It must
26
- // NOT be re-exported here — importing the @_linked/cli barrel would force it
27
- // to evaluate in ESM context and crash. Webpack loads it via file path in
28
- // config-webpack.ts.
29
- var tailwind_config_1 = require("./tailwind.config");
30
- Object.defineProperty(exports, "tailwindConfig", { enumerable: true, get: function () { return __importDefault(tailwind_config_1).default; } });
31
- // export {buildMetadata} from './metadata';
32
- const config_webpack_1 = require("./config-webpack");
33
- Object.defineProperty(exports, "generateWebpackConfig", { enumerable: true, get: function () { return config_webpack_1.generateWebpackConfig; } });
34
- __exportStar(require("./utils"), exports);
35
- var defineConfig_1 = require("./defineConfig");
36
- Object.defineProperty(exports, "defineConfig", { enumerable: true, get: function () { return defineConfig_1.defineConfig; } });
37
- var build_package_1 = require("./commands/build-package");
38
- Object.defineProperty(exports, "buildPackageByPath", { enumerable: true, get: function () { return build_package_1.buildPackageByPath; } });
39
- var safe_yarn_1 = require("./commands/safe-yarn");
40
- Object.defineProperty(exports, "safeYarn", { enumerable: true, get: function () { return safe_yarn_1.safeYarn; } });
41
- var setup_publish_1 = require("./commands/setup-publish");
42
- Object.defineProperty(exports, "setupPublish", { enumerable: true, get: function () { return setup_publish_1.setupPublish; } });
43
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,mEAA0E;AAAlE,wIAAA,OAAO,OAAqB;AACpC,qEAA4E;AAApE,0IAAA,OAAO,OAAsB;AACrC,+EAA+E;AAC/E,6EAA6E;AAC7E,0EAA0E;AAC1E,qBAAqB;AACrB,qDAA4D;AAApD,kIAAA,OAAO,OAAkB;AACjC,4CAA4C;AAC5C,qDAAuD;AAE/C,sGAFA,sCAAqB,OAEA;AAC7B,0CAAwB;AACxB,+CAA4C;AAApC,4GAAA,YAAY,OAAA;AAOpB,0DAA4D;AAApD,mHAAA,kBAAkB,OAAA;AAC1B,kDAA8C;AAAtC,qGAAA,QAAQ,OAAA;AAChB,0DAAsD;AAA9C,6GAAA,YAAY,OAAA"}
@@ -1,131 +0,0 @@
1
- export interface ModuleConfig {
2
- internals?: string[] | '*';
3
- entry?: string;
4
- filename?: string;
5
- declarations?: boolean;
6
- internalsources?: string[];
7
- externals?: {
8
- [npmModule: string]: string;
9
- };
10
- target?: 'es5' | 'es6';
11
- es5?: ModuleConfig;
12
- es6?: ModuleConfig;
13
- dev?: ModuleConfig;
14
- prod?: ModuleConfig;
15
- debug?: boolean;
16
- alias?: {
17
- [oldNpmPath: string]: string;
18
- };
19
- provide?: {};
20
- environment?: 'nodejs' | 'browser' | 'polymorphic';
21
- outputPath?: string;
22
- bundlePath?: string;
23
- es5Server?: boolean;
24
- analyse?: boolean;
25
- cssIdentName?: string;
26
- beforeBuildCommand?: string;
27
- afterBuildCommand?: string;
28
- afterBuildCommandProduction?: string;
29
- afterFirstBuildCommand?: string;
30
- cssGlobalModulePaths?: string;
31
- cssMode?: 'tailwind' | 'postcss';
32
- cssFileName?: string;
33
- tsConfigOverwrites?: Object;
34
- }
35
- export interface AdjustedModuleConfig extends ModuleConfig {
36
- watch?: boolean;
37
- productionMode?: boolean;
38
- }
39
- export interface PackageDetails {
40
- path: string;
41
- packageName: string;
42
- }
43
- /**
44
- * Webpack build configuration
45
- */
46
- export interface LinkedWebpackConfig {
47
- /**
48
- * Enable webpack filesystem caching for faster rebuilds
49
- * @default true
50
- */
51
- cache?: boolean;
52
- /**
53
- * Enable webpack bundle analyzer to visualize bundle size
54
- * @default false
55
- */
56
- analyse?: boolean;
57
- /**
58
- * Additional webpack plugins
59
- */
60
- plugins?: any[];
61
- /**
62
- * Webpack externals configuration - modules to exclude from bundle
63
- */
64
- externals?: {
65
- [npmModule: string]: string;
66
- };
67
- /**
68
- * Webpack alias configuration for import path shortcuts
69
- */
70
- alias?: {
71
- [oldNpmPath: string]: string;
72
- };
73
- /**
74
- * Patterns for CSS files that should not use CSS Modules
75
- */
76
- cssGlobalModulePaths?: (RegExp | string)[];
77
- }
78
- /**
79
- * Server-specific configuration
80
- */
81
- export interface LinkedServerConfig {
82
- /**
83
- * Paths to cache for server-side rendering (SSR)
84
- * Cached pages will be served from memory for faster response times
85
- */
86
- cachePaths?: string[];
87
- /**
88
- * Cache timeout in milliseconds for SSR rendered pages
89
- * After this time, cached pages will be re-rendered
90
- * @default 300000 (5 minutes)
91
- */
92
- cacheTimeout?: number;
93
- /**
94
- * Enable multi-core server processing (requires @semantu/multicore)
95
- * Spawns worker processes to handle requests across multiple CPU cores
96
- * @default false
97
- */
98
- multiCore?: boolean;
99
- /**
100
- * Function that loads the app component (for SSR and hot reloading)
101
- * Must be a function to support hot module reloading
102
- */
103
- loadAppComponent?: () => any;
104
- /**
105
- * Function that loads the app routes configuration (for SSR preloading)
106
- * Must be a function to support hot module reloading
107
- * Should return a RoutesModule from 'lincd-server'
108
- */
109
- loadRoutes?: () => Promise<any>;
110
- }
111
- /**
112
- * Complete Linked configuration
113
- */
114
- export interface LinkedConfig {
115
- /**
116
- * CSS processing mode (shared by webpack and server for SSR)
117
- * - 'tailwind': Use Tailwind CSS v4 with @tailwindcss/postcss. Still supports CSS Modules for .module.css files
118
- * - 'postcss': Use PostCSS with nesting support and CSS Modules for .module.css files
119
- * @default 'postcss'
120
- */
121
- cssMode?: 'tailwind' | 'postcss';
122
- /**
123
- * Webpack build configuration
124
- */
125
- webpack?: LinkedWebpackConfig;
126
- /**
127
- * Server configuration
128
- */
129
- server?: LinkedServerConfig;
130
- }
131
- //# sourceMappingURL=interfaces.d.ts.map