@_linked/cli 1.5.2 → 1.6.1
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/CHANGELOG.md +22 -0
- package/defaults/app-with-backend/package.json +0 -1
- package/defaults/app-with-backend/src/App.tsx +4 -4
- package/defaults/app-with-backend/src/routes.tsx +4 -13
- package/lib/cjs/package.json +2 -5
- package/lib/esm/package.json +2 -5
- package/package.json +2 -5
- package/lib/cjs/cli-deprecated.d.ts +0 -2
- package/lib/cjs/cli-deprecated.d.ts.map +0 -1
- package/lib/cjs/cli-deprecated.js +0 -40
- package/lib/cjs/cli-deprecated.js.map +0 -1
- package/lib/esm/cli-deprecated.d.ts +0 -2
- package/lib/esm/cli-deprecated.d.ts.map +0 -1
- package/lib/esm/cli-deprecated.js +0 -7
- package/lib/esm/cli-deprecated.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.6.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#42](https://github.com/linked-cm/cli/pull/42) [`81ac274`](https://github.com/linked-cm/cli/commit/81ac2740d9d98b1755a27c54174e6225a45da158) Thanks [@flyon](https://github.com/flyon)! - Stripped `@_linked/auth` from the default scaffold. It was wired in (`<ProvideAuth>` in `App.tsx`, `RequireAuth` import in `routes.tsx`) but no signin provider was configured, so it did nothing — while still dragging the entire legacy `lincd-*` chain (`foaf`, `lincd-input`, `lincd-mui-base`, `lincd-rdfs`, `lincd-sioc`) into the dep tree and crashing on startup with `Error: Multiple versions of LINCD are loaded` (both `lincd@1.0.3` and `@_linked/core` claim the same `globalThis.lincd` key).
|
|
8
|
+
|
|
9
|
+
To add sign-in back: `yarn add @_linked/auth`, wrap `<AppRoutes/>` in `<ProvideAuth>`, import `RequireAuth`, set `requireAuth: true` on the route you want protected. Inline comments in `App.tsx` and `routes.tsx` show where.
|
|
10
|
+
|
|
11
|
+
## 1.6.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [#40](https://github.com/linked-cm/cli/pull/40) [`582ad13`](https://github.com/linked-cm/cli/commit/582ad13dc947d59b51df499dc223260f602c1b09) Thanks [@flyon](https://github.com/flyon)! - Simplified the package to ship a single bin (`linked`). The legacy `lincd`, `lincd-cli`, and `lnk` aliases are gone.
|
|
16
|
+
|
|
17
|
+
With only one bin, npx can resolve it without `-p`:
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
npx @_linked/cli@latest create-app my-app
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
If you previously used `lincd` or `lincd-cli` from `@_linked/cli` (the deprecation shim), switch to `linked`. The `lnk` short alias was undocumented and has been removed alongside.
|
|
24
|
+
|
|
3
25
|
## 1.5.2
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
|
@@ -7,9 +7,11 @@ import { AppRoot } from '@_linked/server-utils/components/AppRoot';
|
|
|
7
7
|
import { Head } from '@_linked/server-utils/components/Head';
|
|
8
8
|
import { Body } from '@_linked/server-utils/components/Body';
|
|
9
9
|
import AppRoutes, { ROUTES } from './routes';
|
|
10
|
-
import { ProvideAuth } from '@_linked/auth/hooks/useAuth';
|
|
11
10
|
import style from './App.module.css'; //import any .module.css file like this and access the classnames from the style object
|
|
12
11
|
|
|
12
|
+
// To add sign-in to this app, install `@_linked/auth`, wrap <AppRoutes/>
|
|
13
|
+
// in <ProvideAuth>, and uncomment the `requireAuth` line in routes.tsx.
|
|
14
|
+
|
|
13
15
|
export default function App() {
|
|
14
16
|
return (
|
|
15
17
|
<AppRoot>
|
|
@@ -19,9 +21,7 @@ export default function App() {
|
|
|
19
21
|
<Body routes={ROUTES} pageStyles={style} className={style.App}>
|
|
20
22
|
<Suspense fallback={<Spinner />}>
|
|
21
23
|
<ErrorBoundary FallbackComponent={Error}>
|
|
22
|
-
<
|
|
23
|
-
<AppRoutes />
|
|
24
|
-
</ProvideAuth>
|
|
24
|
+
<AppRoutes />
|
|
25
25
|
</ErrorBoundary>
|
|
26
26
|
</Suspense>
|
|
27
27
|
</Body>
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { RequireAuth } from '@_linked/auth/components/RequireAuth';
|
|
2
1
|
import type { RoutesConfig } from '@_linked/server/types/RouteConfig';
|
|
3
2
|
import React, { lazy, Suspense } from 'react';
|
|
4
3
|
import { Route, Routes } from 'react-router-dom';
|
|
@@ -36,9 +35,9 @@ export const ROUTES: RoutesConfig = {
|
|
|
36
35
|
),
|
|
37
36
|
label: 'Components',
|
|
38
37
|
preloadChunks: ['page1'],
|
|
39
|
-
// To make this route sign-in-protected,
|
|
40
|
-
//
|
|
41
|
-
// requireAuth: true
|
|
38
|
+
// To make this route sign-in-protected, install `@_linked/auth`, wire up
|
|
39
|
+
// a `<ProvideAuth>` provider in App.tsx, import RequireAuth here, and
|
|
40
|
+
// set `requireAuth: true` on this route.
|
|
42
41
|
},
|
|
43
42
|
signin: {
|
|
44
43
|
path: '/signin',
|
|
@@ -56,12 +55,6 @@ export default function AppRoutes() {
|
|
|
56
55
|
const route = ROUTES[routeName];
|
|
57
56
|
const Component = route.component;
|
|
58
57
|
|
|
59
|
-
//if a route is marked as requireAuth, wrap it in the RequireAuth component and pass the signinRoute
|
|
60
|
-
const AuthGuard = route.requireAuth ? RequireAuth : React.Fragment;
|
|
61
|
-
const authProps = route.requireAuth
|
|
62
|
-
? { signinRoute: ROUTES.signin.path }
|
|
63
|
-
: {};
|
|
64
|
-
|
|
65
58
|
// define a render function that determines what to render based on the component and route.render
|
|
66
59
|
const renderRoute = () =>
|
|
67
60
|
// if a Component is defined, render it using JSX syntax (<Component />)
|
|
@@ -74,9 +67,7 @@ export default function AppRoutes() {
|
|
|
74
67
|
key={route.path}
|
|
75
68
|
path={route.path}
|
|
76
69
|
element={
|
|
77
|
-
<
|
|
78
|
-
<Suspense fallback={<Spinner />}>{renderRoute()}</Suspense>
|
|
79
|
-
</AuthGuard>
|
|
70
|
+
<Suspense fallback={<Spinner />}>{renderRoute()}</Suspense>
|
|
80
71
|
}
|
|
81
72
|
/>
|
|
82
73
|
);
|
package/lib/cjs/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@_linked/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"description": "Command line tools for the @_linked/* packages and apps",
|
|
5
5
|
"typesVersions": {
|
|
6
6
|
"*": {
|
|
@@ -50,10 +50,7 @@
|
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
52
|
"bin": {
|
|
53
|
-
"
|
|
54
|
-
"lincd-cli": "lib/esm/cli-deprecated.js",
|
|
55
|
-
"linked": "lib/esm/launch.js",
|
|
56
|
-
"lnk": "lib/esm/launch.js"
|
|
53
|
+
"linked": "lib/esm/launch.js"
|
|
57
54
|
},
|
|
58
55
|
"dependencies": {
|
|
59
56
|
"@_linked/core": "^2.6.0",
|
package/lib/esm/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@_linked/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"description": "Command line tools for the @_linked/* packages and apps",
|
|
5
5
|
"typesVersions": {
|
|
6
6
|
"*": {
|
|
@@ -50,10 +50,7 @@
|
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
52
|
"bin": {
|
|
53
|
-
"
|
|
54
|
-
"lincd-cli": "lib/esm/cli-deprecated.js",
|
|
55
|
-
"linked": "lib/esm/launch.js",
|
|
56
|
-
"lnk": "lib/esm/launch.js"
|
|
53
|
+
"linked": "lib/esm/launch.js"
|
|
57
54
|
},
|
|
58
55
|
"dependencies": {
|
|
59
56
|
"@_linked/core": "^2.6.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@_linked/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"description": "Command line tools for the @_linked/* packages and apps",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -70,10 +70,7 @@
|
|
|
70
70
|
"access": "public"
|
|
71
71
|
},
|
|
72
72
|
"bin": {
|
|
73
|
-
"
|
|
74
|
-
"lincd-cli": "lib/esm/cli-deprecated.js",
|
|
75
|
-
"linked": "lib/esm/launch.js",
|
|
76
|
-
"lnk": "lib/esm/launch.js"
|
|
73
|
+
"linked": "lib/esm/launch.js"
|
|
77
74
|
},
|
|
78
75
|
"dependencies": {
|
|
79
76
|
"@_linked/core": "^2.6.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli-deprecated.d.ts","sourceRoot":"","sources":["../../src/cli-deprecated.ts"],"names":[],"mappings":""}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env tsx
|
|
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
|
-
if (!process.env.LINKED_SUPPRESS_DEPRECATION) {
|
|
36
|
-
process.stderr.write("\x1b[33m⚠️ 'lincd' is deprecated and will be removed in a future release. Use 'linked' instead.\x1b[0m\n");
|
|
37
|
-
process.env.LINKED_SUPPRESS_DEPRECATION = '1';
|
|
38
|
-
}
|
|
39
|
-
Promise.resolve().then(() => __importStar(require('./cli.js')));
|
|
40
|
-
//# sourceMappingURL=cli-deprecated.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli-deprecated.js","sourceRoot":"","sources":["../../src/cli-deprecated.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,2BAA2B,EAAE,CAAC;IAC7C,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,2GAA2G,CAC5G,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,2BAA2B,GAAG,GAAG,CAAC;AAChD,CAAC;AACD,kDAAO,UAAU,IAAE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli-deprecated.d.ts","sourceRoot":"","sources":["../../src/cli-deprecated.ts"],"names":[],"mappings":""}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env tsx
|
|
2
|
-
if (!process.env.LINKED_SUPPRESS_DEPRECATION) {
|
|
3
|
-
process.stderr.write("\x1b[33m⚠️ 'lincd' is deprecated and will be removed in a future release. Use 'linked' instead.\x1b[0m\n");
|
|
4
|
-
process.env.LINKED_SUPPRESS_DEPRECATION = '1';
|
|
5
|
-
}
|
|
6
|
-
import('./cli.js');
|
|
7
|
-
//# sourceMappingURL=cli-deprecated.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli-deprecated.js","sourceRoot":"","sources":["../../src/cli-deprecated.ts"],"names":[],"mappings":";AACA,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,2BAA2B,EAAE,CAAC;IAC7C,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,2GAA2G,CAC5G,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,2BAA2B,GAAG,GAAG,CAAC;AAChD,CAAC;AACD,MAAM,CAAC,UAAU,CAAC,CAAC"}
|