@linktr.ee/create-link-app 0.3.0-next.0 → 0.3.0-next.10
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/README.md +23 -7
- package/dist/commands/storybook.js +28 -0
- package/dist/lib/create/create-project.js +3 -0
- package/dist/postcss/postcss.config.js +20 -0
- package/dist/storybook/main.js +62 -0
- package/dist/storybook/preview.js +12 -0
- package/dist/webpack/webpack.config.js +78 -6
- package/html-template/development.html +1 -1
- package/html-template/production.html +1 -1
- package/oclif.manifest.json +241 -1
- package/package.json +24 -1
- package/templates/common/fixtures/props-data.json +1 -2
- package/templates/react/package.json +3 -1
- package/templates/react/src/index.jsx +4 -13
- package/templates/react/src/tailwind.css +5 -0
- package/templates/react-ts/package.json +3 -1
- package/templates/react-ts/src/index.tsx +4 -13
- package/templates/react-ts/src/stories/LinkApp.stories.tsx +38 -0
- package/templates/react-ts/src/tailwind.css +5 -0
- package/templates/react-ts/src/types/global.d.ts +4 -5
- package/templates/react-ts/src/types/index.ts +4 -3
- package/CHANGELOG.md +0 -25
- package/templates/react/src/images/logo.png +0 -0
- package/templates/react-ts/src/images/logo.png +0 -0
package/README.md
CHANGED
|
@@ -24,9 +24,10 @@ yarn create @linktr.ee/create-link-app my-link-app
|
|
|
24
24
|
* [`create-link-app deploy`](#create-link-app-deploy)
|
|
25
25
|
* [`create-link-app dev`](#create-link-app-dev)
|
|
26
26
|
* [`create-link-app grant-access LINK_APP_ID USERNAME`](#create-link-app-grant-access-link_app_id-username)
|
|
27
|
-
* [`create-link-app help [
|
|
27
|
+
* [`create-link-app help [COMMANDS]`](#create-link-app-help-commands)
|
|
28
28
|
* [`create-link-app login`](#create-link-app-login)
|
|
29
29
|
* [`create-link-app logout`](#create-link-app-logout)
|
|
30
|
+
* [`create-link-app storybook`](#create-link-app-storybook)
|
|
30
31
|
|
|
31
32
|
## `create-link-app build`
|
|
32
33
|
|
|
@@ -46,7 +47,7 @@ Initialize a new Link App project
|
|
|
46
47
|
|
|
47
48
|
```
|
|
48
49
|
USAGE
|
|
49
|
-
$ create-link-app create
|
|
50
|
+
$ create-link-app create NAME [-t react|react-ts] [-p <value>]
|
|
50
51
|
|
|
51
52
|
ARGUMENTS
|
|
52
53
|
NAME Name of the Link App
|
|
@@ -112,7 +113,7 @@ Grant access to other developers to push updates for your Link App
|
|
|
112
113
|
|
|
113
114
|
```
|
|
114
115
|
USAGE
|
|
115
|
-
$ create-link-app grant-access
|
|
116
|
+
$ create-link-app grant-access LINK_APP_ID USERNAME
|
|
116
117
|
|
|
117
118
|
ARGUMENTS
|
|
118
119
|
LINK_APP_ID The Link App's ID you wish to grant access to
|
|
@@ -125,16 +126,16 @@ EXAMPLES
|
|
|
125
126
|
$ create-link-app grant-access my-link-app friend
|
|
126
127
|
```
|
|
127
128
|
|
|
128
|
-
## `create-link-app help [
|
|
129
|
+
## `create-link-app help [COMMANDS]`
|
|
129
130
|
|
|
130
131
|
Display help for create-link-app.
|
|
131
132
|
|
|
132
133
|
```
|
|
133
134
|
USAGE
|
|
134
|
-
$ create-link-app help [
|
|
135
|
+
$ create-link-app help [COMMANDS] [-n]
|
|
135
136
|
|
|
136
137
|
ARGUMENTS
|
|
137
|
-
|
|
138
|
+
COMMANDS Command to show help for.
|
|
138
139
|
|
|
139
140
|
FLAGS
|
|
140
141
|
-n, --nested-commands Include all nested commands in the output.
|
|
@@ -143,7 +144,7 @@ DESCRIPTION
|
|
|
143
144
|
Display help for create-link-app.
|
|
144
145
|
```
|
|
145
146
|
|
|
146
|
-
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.
|
|
147
|
+
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.2.9/src/commands/help.ts)_
|
|
147
148
|
|
|
148
149
|
## `create-link-app login`
|
|
149
150
|
|
|
@@ -168,4 +169,19 @@ USAGE
|
|
|
168
169
|
DESCRIPTION
|
|
169
170
|
Logout and clear browser session
|
|
170
171
|
```
|
|
172
|
+
|
|
173
|
+
## `create-link-app storybook`
|
|
174
|
+
|
|
175
|
+
Start the Stortybook development server
|
|
176
|
+
|
|
177
|
+
```
|
|
178
|
+
USAGE
|
|
179
|
+
$ create-link-app storybook [-p <value>]
|
|
180
|
+
|
|
181
|
+
FLAGS
|
|
182
|
+
-p, --port=<value> [default: 6006] Port to run the Storybook server on
|
|
183
|
+
|
|
184
|
+
DESCRIPTION
|
|
185
|
+
Start the Stortybook development server
|
|
186
|
+
```
|
|
171
187
|
<!-- commandsstop -->
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const core_1 = require("@oclif/core");
|
|
7
|
+
const child_process_1 = require("child_process");
|
|
8
|
+
const base_1 = __importDefault(require("../base"));
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
class Storybook extends base_1.default {
|
|
11
|
+
async run() {
|
|
12
|
+
const configPath = path_1.default.resolve(__dirname, '..', 'storybook');
|
|
13
|
+
const { flags } = await this.parse(Storybook);
|
|
14
|
+
const storybook = (0, child_process_1.spawn)(`start-storybook -p ${flags.port} -c ${configPath}`, { shell: true, stdio: 'inherit' });
|
|
15
|
+
storybook.on('error', (err) => {
|
|
16
|
+
throw err;
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.default = Storybook;
|
|
21
|
+
Storybook.description = 'Start the Stortybook development server';
|
|
22
|
+
Storybook.flags = {
|
|
23
|
+
port: core_1.Flags.integer({
|
|
24
|
+
char: 'p',
|
|
25
|
+
description: 'Port to run the Storybook server on',
|
|
26
|
+
default: 6006,
|
|
27
|
+
}),
|
|
28
|
+
};
|
|
@@ -14,6 +14,9 @@ const createProject = async (template, targetDir) => {
|
|
|
14
14
|
await fs_extra_1.default.copy(templateDir, targetDir);
|
|
15
15
|
await fs_extra_1.default.copy(templateCommonDir, targetDir);
|
|
16
16
|
await fs_extra_1.default.move(`${targetDir}/gitignore`, `${targetDir}/.gitignore`);
|
|
17
|
+
if (await fs_extra_1.default.existsSync(`${targetDir}/src/types/global.d.ts`)) {
|
|
18
|
+
await fs_extra_1.default.unlink(`${targetDir}/src/types/global.d.ts`);
|
|
19
|
+
}
|
|
17
20
|
// update `name` field in project manifest
|
|
18
21
|
const manifest = await fs_extra_1.default.readJson(`${targetDir}/manifest.json`);
|
|
19
22
|
manifest.name = (0, project_name_to_title_1.default)(path_1.default.basename(targetDir));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const path_1 = __importDefault(require("path"));
|
|
7
|
+
const tailwindcss_1 = __importDefault(require("tailwindcss"));
|
|
8
|
+
const autoprefixer_1 = __importDefault(require("autoprefixer"));
|
|
9
|
+
const componentLibraryContentPath = path_1.default.join(require.resolve('@linktr.ee/component-library/tailwind.config').split('/').slice(0, -1).join('/'), 'dist', '**', '*.js');
|
|
10
|
+
const config = {
|
|
11
|
+
plugins: [
|
|
12
|
+
(0, tailwindcss_1.default)({
|
|
13
|
+
content: [`${process.cwd()}/src/**/*.{js,jsx,ts,tsx}`, componentLibraryContentPath],
|
|
14
|
+
presets: [require('@linktr.ee/component-library/tailwind.config')],
|
|
15
|
+
plugins: [],
|
|
16
|
+
}),
|
|
17
|
+
(0, autoprefixer_1.default)(),
|
|
18
|
+
],
|
|
19
|
+
};
|
|
20
|
+
module.exports = config;
|
|
@@ -0,0 +1,62 @@
|
|
|
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 (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
const postcss_1 = __importDefault(require("postcss"));
|
|
30
|
+
const postcssOptions = __importStar(require("../postcss/postcss.config"));
|
|
31
|
+
const config = {
|
|
32
|
+
stories: [`${process.cwd()}/src/**/*.stories.@(js|jsx|ts|tsx)`],
|
|
33
|
+
addons: [
|
|
34
|
+
'@storybook/addon-links',
|
|
35
|
+
'@storybook/addon-essentials',
|
|
36
|
+
{
|
|
37
|
+
name: 'storybook-addon-turbo-build',
|
|
38
|
+
options: {
|
|
39
|
+
optimizationLevel: 2,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
/**
|
|
44
|
+
* Fix Storybook issue with PostCSS@8
|
|
45
|
+
* @see https://github.com/storybookjs/storybook/issues/12668#issuecomment-773958085
|
|
46
|
+
*/
|
|
47
|
+
name: '@storybook/addon-postcss',
|
|
48
|
+
options: {
|
|
49
|
+
cssLoaderOptions: { importLoaders: 1 },
|
|
50
|
+
postcssLoaderOptions: {
|
|
51
|
+
implementation: postcss_1.default,
|
|
52
|
+
postcssOptions: { ...postcssOptions },
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
framework: '@storybook/react',
|
|
58
|
+
core: {
|
|
59
|
+
builder: 'webpack5',
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
module.exports = config;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parameters = void 0;
|
|
4
|
+
exports.parameters = {
|
|
5
|
+
actions: { argTypesRegex: '^on[A-Z].*' },
|
|
6
|
+
controls: {
|
|
7
|
+
matchers: {
|
|
8
|
+
color: /(background|color)$/i,
|
|
9
|
+
date: /Date$/,
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
};
|
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
+
if (mod && mod.__esModule) return mod;
|
|
21
|
+
var result = {};
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
+
__setModuleDefault(result, mod);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
3
26
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
27
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
28
|
};
|
|
@@ -8,19 +31,28 @@ const fork_ts_checker_webpack_plugin_1 = __importDefault(require("fork-ts-checke
|
|
|
8
31
|
const fs_1 = __importDefault(require("fs"));
|
|
9
32
|
const html_webpack_plugin_1 = __importDefault(require("html-webpack-plugin"));
|
|
10
33
|
const inject_body_webpack_plugin_1 = __importDefault(require("inject-body-webpack-plugin"));
|
|
34
|
+
const mini_css_extract_plugin_1 = __importDefault(require("mini-css-extract-plugin"));
|
|
11
35
|
const path_1 = __importDefault(require("path"));
|
|
12
36
|
const webpack_1 = require("webpack");
|
|
37
|
+
const camelcase_1 = __importDefault(require("camelcase"));
|
|
38
|
+
const slugify_1 = __importDefault(require("slugify"));
|
|
39
|
+
const postcssOptions = __importStar(require("../postcss/postcss.config"));
|
|
40
|
+
const { ModuleFederationPlugin } = webpack_1.container;
|
|
13
41
|
function default_1(env, options) {
|
|
14
42
|
const appDir = process.cwd();
|
|
15
43
|
const entryFile = path_1.default.resolve(__dirname, `${env}.entry`);
|
|
16
44
|
const htmlTemplateFile = path_1.default.resolve(__dirname, '..', '..', 'html-template', `${env}.html`);
|
|
45
|
+
const manifestJson = JSON.parse(fs_1.default.readFileSync(path_1.default.resolve(appDir, 'manifest.json'), 'utf8'));
|
|
46
|
+
const linkTypeName = manifestJson.name.replace(/[^A-Za-z0-9 ]/g, '');
|
|
47
|
+
const linkTypeSlug = (0, slugify_1.default)(linkTypeName, { lower: true });
|
|
48
|
+
const linkTypeId = (0, camelcase_1.default)(linkTypeSlug, { pascalCase: true });
|
|
17
49
|
const hasTsconfig = fileExists(path_1.default.resolve(appDir, 'tsconfig.json'));
|
|
18
50
|
const config = {
|
|
19
51
|
target: 'web',
|
|
20
52
|
mode: env,
|
|
21
53
|
entry: entryFile,
|
|
22
54
|
output: {
|
|
23
|
-
publicPath: '',
|
|
55
|
+
publicPath: 'auto',
|
|
24
56
|
path: path_1.default.resolve(appDir, 'dist'),
|
|
25
57
|
assetModuleFilename: 'images/[hash][ext][query]',
|
|
26
58
|
},
|
|
@@ -43,6 +75,19 @@ function default_1(env, options) {
|
|
|
43
75
|
test: /\.(png|jpe?g|gif|svg)$/i,
|
|
44
76
|
type: 'asset/inline',
|
|
45
77
|
},
|
|
78
|
+
{
|
|
79
|
+
test: /\.css$/,
|
|
80
|
+
use: [
|
|
81
|
+
mini_css_extract_plugin_1.default.loader,
|
|
82
|
+
'css-loader',
|
|
83
|
+
{
|
|
84
|
+
loader: 'postcss-loader',
|
|
85
|
+
options: {
|
|
86
|
+
postcssOptions: { ...postcssOptions },
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
},
|
|
46
91
|
],
|
|
47
92
|
},
|
|
48
93
|
resolve: {
|
|
@@ -57,6 +102,7 @@ function default_1(env, options) {
|
|
|
57
102
|
plugins: [
|
|
58
103
|
new html_webpack_plugin_1.default({
|
|
59
104
|
template: htmlTemplateFile,
|
|
105
|
+
excludeChunks: [`LinkApp_${linkTypeId}`],
|
|
60
106
|
}),
|
|
61
107
|
],
|
|
62
108
|
};
|
|
@@ -70,13 +116,16 @@ function default_1(env, options) {
|
|
|
70
116
|
...config.resolve.alias,
|
|
71
117
|
'@linktr.ee/extension-dev-data': path_1.default.resolve(appDir, 'fixtures', 'props-data.json'),
|
|
72
118
|
};
|
|
119
|
+
config.plugins.push(new mini_css_extract_plugin_1.default());
|
|
73
120
|
}
|
|
74
121
|
if (env === 'production') {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
122
|
+
// TODO: Figure out how to manage externals with Module Federation
|
|
123
|
+
// Possibly make the index.html a host app, via separate webpack config
|
|
124
|
+
// config.externals = {
|
|
125
|
+
// react: 'React',
|
|
126
|
+
// 'react-dom': 'ReactDOM',
|
|
127
|
+
// 'styled-components': 'styled',
|
|
128
|
+
// }
|
|
80
129
|
config.performance = {
|
|
81
130
|
maxEntrypointSize: 1048576,
|
|
82
131
|
maxAssetSize: 350000,
|
|
@@ -90,6 +139,29 @@ function default_1(env, options) {
|
|
|
90
139
|
new inject_body_webpack_plugin_1.default({
|
|
91
140
|
position: 'start',
|
|
92
141
|
content: `<!-- ${getBuildInfo()} -->`,
|
|
142
|
+
}), new ModuleFederationPlugin({
|
|
143
|
+
name: `LinkApp_${linkTypeId}`,
|
|
144
|
+
filename: 'remoteEntry.js',
|
|
145
|
+
exposes: {
|
|
146
|
+
['./App']: path_1.default.resolve(appDir, 'src'),
|
|
147
|
+
},
|
|
148
|
+
shared: {
|
|
149
|
+
react: {
|
|
150
|
+
singleton: true,
|
|
151
|
+
requiredVersion: '17 || 18',
|
|
152
|
+
},
|
|
153
|
+
'react-dom': {
|
|
154
|
+
singleton: true,
|
|
155
|
+
requiredVersion: '17 || 18',
|
|
156
|
+
},
|
|
157
|
+
// 'styled-components': {
|
|
158
|
+
// singleton: true,
|
|
159
|
+
// requiredVersion: '5',
|
|
160
|
+
// },
|
|
161
|
+
},
|
|
162
|
+
}), new mini_css_extract_plugin_1.default({
|
|
163
|
+
filename: '[name].[contenthash].css',
|
|
164
|
+
chunkFilename: '[id].[contenthash].css',
|
|
93
165
|
}));
|
|
94
166
|
}
|
|
95
167
|
return config;
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1,241 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": "0.3.0-next.10",
|
|
3
|
+
"commands": {
|
|
4
|
+
"build": {
|
|
5
|
+
"id": "build",
|
|
6
|
+
"description": "Build Link App project to static assets used for production",
|
|
7
|
+
"strict": true,
|
|
8
|
+
"pluginName": "@linktr.ee/create-link-app",
|
|
9
|
+
"pluginAlias": "@linktr.ee/create-link-app",
|
|
10
|
+
"pluginType": "core",
|
|
11
|
+
"aliases": [],
|
|
12
|
+
"flags": {
|
|
13
|
+
"allow-any-origin": {
|
|
14
|
+
"name": "allow-any-origin",
|
|
15
|
+
"type": "boolean",
|
|
16
|
+
"description": "Allow Link App iframe to be loadable from non-Linktree origins for debugging",
|
|
17
|
+
"hidden": true,
|
|
18
|
+
"allowNo": false
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"args": {}
|
|
22
|
+
},
|
|
23
|
+
"create": {
|
|
24
|
+
"id": "create",
|
|
25
|
+
"description": "Initialize a new Link App project",
|
|
26
|
+
"strict": true,
|
|
27
|
+
"pluginName": "@linktr.ee/create-link-app",
|
|
28
|
+
"pluginAlias": "@linktr.ee/create-link-app",
|
|
29
|
+
"pluginType": "core",
|
|
30
|
+
"aliases": [],
|
|
31
|
+
"examples": [
|
|
32
|
+
"$ create-link-app create my-link-app",
|
|
33
|
+
"$ create-link-app create my-link-app --template react",
|
|
34
|
+
"$ create-link-app create my-link-app --path my/custom/path"
|
|
35
|
+
],
|
|
36
|
+
"flags": {
|
|
37
|
+
"template": {
|
|
38
|
+
"name": "template",
|
|
39
|
+
"type": "option",
|
|
40
|
+
"char": "t",
|
|
41
|
+
"description": "Template to use for the project",
|
|
42
|
+
"multiple": false,
|
|
43
|
+
"options": [
|
|
44
|
+
"react",
|
|
45
|
+
"react-ts"
|
|
46
|
+
],
|
|
47
|
+
"default": "react-ts"
|
|
48
|
+
},
|
|
49
|
+
"path": {
|
|
50
|
+
"name": "path",
|
|
51
|
+
"type": "option",
|
|
52
|
+
"char": "p",
|
|
53
|
+
"description": "Path to create the project in",
|
|
54
|
+
"multiple": false
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"args": {
|
|
58
|
+
"name": {
|
|
59
|
+
"name": "name",
|
|
60
|
+
"description": "Name of the Link App",
|
|
61
|
+
"required": true
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"deploy": {
|
|
66
|
+
"id": "deploy",
|
|
67
|
+
"description": "Deploy your Link App and test it on Linktr.ee",
|
|
68
|
+
"strict": true,
|
|
69
|
+
"pluginName": "@linktr.ee/create-link-app",
|
|
70
|
+
"pluginAlias": "@linktr.ee/create-link-app",
|
|
71
|
+
"pluginType": "core",
|
|
72
|
+
"aliases": [],
|
|
73
|
+
"flags": {
|
|
74
|
+
"path": {
|
|
75
|
+
"name": "path",
|
|
76
|
+
"type": "option",
|
|
77
|
+
"char": "p",
|
|
78
|
+
"description": "Specify custom path to project directory",
|
|
79
|
+
"multiple": false
|
|
80
|
+
},
|
|
81
|
+
"update": {
|
|
82
|
+
"name": "update",
|
|
83
|
+
"type": "boolean",
|
|
84
|
+
"description": "Push update for existing Link App",
|
|
85
|
+
"allowNo": false
|
|
86
|
+
},
|
|
87
|
+
"endpoint": {
|
|
88
|
+
"name": "endpoint",
|
|
89
|
+
"type": "option",
|
|
90
|
+
"description": "Custom API endpoint to push assets to",
|
|
91
|
+
"hidden": true,
|
|
92
|
+
"multiple": false
|
|
93
|
+
},
|
|
94
|
+
"qa": {
|
|
95
|
+
"name": "qa",
|
|
96
|
+
"type": "boolean",
|
|
97
|
+
"description": "Use QA environment",
|
|
98
|
+
"hidden": true,
|
|
99
|
+
"allowNo": false
|
|
100
|
+
},
|
|
101
|
+
"force-update": {
|
|
102
|
+
"name": "force-update",
|
|
103
|
+
"type": "boolean",
|
|
104
|
+
"description": "Allow Link Type Admins to push updates to Link Apps in PUBLISHED state",
|
|
105
|
+
"hidden": true,
|
|
106
|
+
"allowNo": false
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"args": {}
|
|
110
|
+
},
|
|
111
|
+
"dev": {
|
|
112
|
+
"id": "dev",
|
|
113
|
+
"description": "Start development server for Link App project",
|
|
114
|
+
"strict": true,
|
|
115
|
+
"pluginName": "@linktr.ee/create-link-app",
|
|
116
|
+
"pluginAlias": "@linktr.ee/create-link-app",
|
|
117
|
+
"pluginType": "core",
|
|
118
|
+
"aliases": [],
|
|
119
|
+
"examples": [
|
|
120
|
+
"$ create-link-app dev",
|
|
121
|
+
"$ create-link-app dev --port 8000",
|
|
122
|
+
"$ create-link-app dev --https"
|
|
123
|
+
],
|
|
124
|
+
"flags": {
|
|
125
|
+
"port": {
|
|
126
|
+
"name": "port",
|
|
127
|
+
"type": "option",
|
|
128
|
+
"char": "p",
|
|
129
|
+
"description": "Development server listening port",
|
|
130
|
+
"multiple": false,
|
|
131
|
+
"default": 3000
|
|
132
|
+
},
|
|
133
|
+
"https": {
|
|
134
|
+
"name": "https",
|
|
135
|
+
"type": "boolean",
|
|
136
|
+
"description": "Use HTTPS for development server",
|
|
137
|
+
"allowNo": false
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"args": {}
|
|
141
|
+
},
|
|
142
|
+
"grant-access": {
|
|
143
|
+
"id": "grant-access",
|
|
144
|
+
"description": "Grant access to other developers to push updates for your Link App",
|
|
145
|
+
"strict": true,
|
|
146
|
+
"pluginName": "@linktr.ee/create-link-app",
|
|
147
|
+
"pluginAlias": "@linktr.ee/create-link-app",
|
|
148
|
+
"pluginType": "core",
|
|
149
|
+
"aliases": [],
|
|
150
|
+
"examples": [
|
|
151
|
+
"$ create-link-app grant-access my-link-app friend"
|
|
152
|
+
],
|
|
153
|
+
"flags": {
|
|
154
|
+
"endpoint": {
|
|
155
|
+
"name": "endpoint",
|
|
156
|
+
"type": "option",
|
|
157
|
+
"description": "Custom API endpoint to push assets to",
|
|
158
|
+
"hidden": true,
|
|
159
|
+
"multiple": false
|
|
160
|
+
},
|
|
161
|
+
"qa": {
|
|
162
|
+
"name": "qa",
|
|
163
|
+
"type": "boolean",
|
|
164
|
+
"description": "Use QA environment",
|
|
165
|
+
"hidden": true,
|
|
166
|
+
"allowNo": false
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
"args": {
|
|
170
|
+
"link_app_id": {
|
|
171
|
+
"name": "link_app_id",
|
|
172
|
+
"description": "The Link App's ID you wish to grant access to",
|
|
173
|
+
"required": true
|
|
174
|
+
},
|
|
175
|
+
"username": {
|
|
176
|
+
"name": "username",
|
|
177
|
+
"description": "The Linktree username of the developer you wish to grant access to",
|
|
178
|
+
"required": true
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
"login": {
|
|
183
|
+
"id": "login",
|
|
184
|
+
"description": "Login using your Linktree credentials to deploy Link Apps",
|
|
185
|
+
"strict": true,
|
|
186
|
+
"pluginName": "@linktr.ee/create-link-app",
|
|
187
|
+
"pluginAlias": "@linktr.ee/create-link-app",
|
|
188
|
+
"pluginType": "core",
|
|
189
|
+
"aliases": [],
|
|
190
|
+
"flags": {
|
|
191
|
+
"qa": {
|
|
192
|
+
"name": "qa",
|
|
193
|
+
"type": "boolean",
|
|
194
|
+
"description": "Use QA environment",
|
|
195
|
+
"hidden": true,
|
|
196
|
+
"allowNo": false
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
"args": {}
|
|
200
|
+
},
|
|
201
|
+
"logout": {
|
|
202
|
+
"id": "logout",
|
|
203
|
+
"description": "Logout and clear browser session",
|
|
204
|
+
"strict": true,
|
|
205
|
+
"pluginName": "@linktr.ee/create-link-app",
|
|
206
|
+
"pluginAlias": "@linktr.ee/create-link-app",
|
|
207
|
+
"pluginType": "core",
|
|
208
|
+
"aliases": [],
|
|
209
|
+
"flags": {
|
|
210
|
+
"qa": {
|
|
211
|
+
"name": "qa",
|
|
212
|
+
"type": "boolean",
|
|
213
|
+
"description": "Use QA environment",
|
|
214
|
+
"hidden": true,
|
|
215
|
+
"allowNo": false
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
"args": {}
|
|
219
|
+
},
|
|
220
|
+
"storybook": {
|
|
221
|
+
"id": "storybook",
|
|
222
|
+
"description": "Start the Stortybook development server",
|
|
223
|
+
"strict": true,
|
|
224
|
+
"pluginName": "@linktr.ee/create-link-app",
|
|
225
|
+
"pluginAlias": "@linktr.ee/create-link-app",
|
|
226
|
+
"pluginType": "core",
|
|
227
|
+
"aliases": [],
|
|
228
|
+
"flags": {
|
|
229
|
+
"port": {
|
|
230
|
+
"name": "port",
|
|
231
|
+
"type": "option",
|
|
232
|
+
"char": "p",
|
|
233
|
+
"description": "Port to run the Storybook server on",
|
|
234
|
+
"multiple": false,
|
|
235
|
+
"default": 6006
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
"args": {}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linktr.ee/create-link-app",
|
|
3
|
-
"version": "0.3.0-next.
|
|
3
|
+
"version": "0.3.0-next.10",
|
|
4
4
|
"description": "Create a Link App on Linktr.ee.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "Linktree",
|
|
@@ -34,22 +34,45 @@
|
|
|
34
34
|
"@babel/preset-react": "^7.17.12",
|
|
35
35
|
"@babel/preset-typescript": "^7.17.12",
|
|
36
36
|
"@babel/runtime": "^7.18.3",
|
|
37
|
+
"@linktr.ee/component-library": "^7.0.17",
|
|
37
38
|
"@oclif/core": "^1.9.0",
|
|
38
39
|
"@oclif/plugin-help": "^5.1.12",
|
|
40
|
+
"@storybook/addon-actions": "^6.5.9",
|
|
41
|
+
"@storybook/addon-essentials": "^6.5.9",
|
|
42
|
+
"@storybook/addon-interactions": "^6.5.9",
|
|
43
|
+
"@storybook/addon-links": "^6.5.9",
|
|
44
|
+
"@storybook/addon-postcss": "^2.0.0",
|
|
45
|
+
"@storybook/builder-webpack5": "^6.5.9",
|
|
46
|
+
"@storybook/manager-webpack5": "^6.5.9",
|
|
47
|
+
"@storybook/react": "^6.5.9",
|
|
48
|
+
"@testing-library/react": "^12.1.4",
|
|
49
|
+
"@testing-library/user-event": "14",
|
|
39
50
|
"archiver": "^5.3.1",
|
|
51
|
+
"autoprefixer": "^10.4.14",
|
|
40
52
|
"axios": "^0.27.2",
|
|
41
53
|
"babel-loader": "^8.2.5",
|
|
54
|
+
"camelcase": "^6.3.0",
|
|
55
|
+
"css-loader": "^6.7.3",
|
|
42
56
|
"fork-ts-checker-webpack-plugin": "^7.2.11",
|
|
43
57
|
"form-data": "^4.0.0",
|
|
44
58
|
"fs-extra": "^10.1.0",
|
|
45
59
|
"html-webpack-plugin": "^5.5.0",
|
|
46
60
|
"inject-body-webpack-plugin": "^1.3.0",
|
|
47
61
|
"jsonwebtoken": "^8.5.1",
|
|
62
|
+
"mini-css-extract-plugin": "^2.7.5",
|
|
48
63
|
"netrc-parser": "^3.1.6",
|
|
49
64
|
"openid-client": "^5.1.6",
|
|
65
|
+
"postcss": "^8.4.21",
|
|
66
|
+
"postcss-loader": "^4.3.0",
|
|
67
|
+
"prop-types": "^15.8.1",
|
|
50
68
|
"react": "^17.0.2",
|
|
51
69
|
"react-dom": "^17.0.2",
|
|
70
|
+
"slugify": "^1.6.6",
|
|
71
|
+
"storybook-addon-designs": "^6.3.1",
|
|
72
|
+
"storybook-addon-turbo-build": "^1.1.0",
|
|
73
|
+
"style-loader": "^3.3.2",
|
|
52
74
|
"styled-components": "^5.3.5",
|
|
75
|
+
"tailwindcss": "^3.3.1",
|
|
53
76
|
"typescript": "^4.7.3",
|
|
54
77
|
"webpack": "^5.75.0",
|
|
55
78
|
"webpack-dev-server": "^4.11.1"
|
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
"scripts": {
|
|
4
4
|
"build": "create-link-app build",
|
|
5
5
|
"deploy": "create-link-app deploy",
|
|
6
|
+
"storybook": "create-link-app storybook",
|
|
6
7
|
"dev": "create-link-app dev"
|
|
7
8
|
},
|
|
8
9
|
"devDependencies": {
|
|
9
|
-
"@linktr.ee/
|
|
10
|
+
"@linktr.ee/component-library": "latest",
|
|
11
|
+
"@linktr.ee/create-link-app": "next",
|
|
10
12
|
"@linktr.ee/ui-link-kit": "latest"
|
|
11
13
|
}
|
|
12
14
|
}
|
|
@@ -1,18 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import P from '@linktr.ee/component-library/P'
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import './tailwind.css'
|
|
4
4
|
|
|
5
|
-
function App({
|
|
6
|
-
return
|
|
7
|
-
<Container
|
|
8
|
-
primaryCta={toggle ? { label: 'Visit our UI docs for more info', href: 'https://blstrco.github.io/ui-link-kit/' } : null}
|
|
9
|
-
secondaryCta={toggle ? { label: 'Original url for your Linktree link', href: __linkUrl } : null}
|
|
10
|
-
logo={logo}
|
|
11
|
-
>
|
|
12
|
-
<Header heading={`Hello ${your_name}!`} secondaryHeading="Congratulations, you now have a Linktree link!" layout="hero" />
|
|
13
|
-
<Description>{your_name}</Description>
|
|
14
|
-
</Container>
|
|
15
|
-
)
|
|
5
|
+
function App({ title }) {
|
|
6
|
+
return <P>{title}</P>
|
|
16
7
|
}
|
|
17
8
|
|
|
18
9
|
export default App
|
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
"scripts": {
|
|
4
4
|
"build": "create-link-app build",
|
|
5
5
|
"deploy": "create-link-app deploy",
|
|
6
|
+
"storybook": "create-link-app storybook",
|
|
6
7
|
"dev": "create-link-app dev"
|
|
7
8
|
},
|
|
8
9
|
"devDependencies": {
|
|
9
|
-
"@linktr.ee/
|
|
10
|
+
"@linktr.ee/component-library": "latest",
|
|
11
|
+
"@linktr.ee/create-link-app": "next",
|
|
10
12
|
"@linktr.ee/ui-link-kit": "latest",
|
|
11
13
|
"@types/react": "^17.0.0",
|
|
12
14
|
"@types/react-dom": "^17.0.0"
|
|
@@ -1,19 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import P from '@linktr.ee/component-library/P'
|
|
2
2
|
import { SettingsData } from './types'
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import './tailwind.css'
|
|
5
5
|
|
|
6
|
-
function App({
|
|
7
|
-
return
|
|
8
|
-
<Container
|
|
9
|
-
primaryCta={toggle ? { label: 'Visit our UI docs for more info', href: 'https://blstrco.github.io/ui-link-kit/' } : null}
|
|
10
|
-
secondaryCta={toggle ? { label: 'Original url for your Linktree link', href: __linkUrl } : null}
|
|
11
|
-
logo={logo}
|
|
12
|
-
>
|
|
13
|
-
<Header heading={`Hello ${your_name}!`} secondaryHeading="Congratulations, you now have a Linktree link!" layout="hero" />
|
|
14
|
-
<Description>{your_name}</Description>
|
|
15
|
-
</Container>
|
|
16
|
-
)
|
|
6
|
+
function App({ title }: SettingsData) {
|
|
7
|
+
return <P>{title}</P>
|
|
17
8
|
}
|
|
18
9
|
|
|
19
10
|
export default App
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
|
3
|
+
import { name } from '../../manifest.json'
|
|
4
|
+
|
|
5
|
+
import LinkApp from '..'
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: `Link App/${name}`,
|
|
9
|
+
component: LinkApp,
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: 'fullscreen',
|
|
13
|
+
},
|
|
14
|
+
} as ComponentMeta<typeof LinkApp>
|
|
15
|
+
|
|
16
|
+
export const Stack: ComponentStory<typeof LinkApp> = () => (
|
|
17
|
+
<div className="bg-marble rounded-lg p-2 m-2 w-[375px]">
|
|
18
|
+
<LinkApp layout="STACK" editing={false} title="Test Stack" />
|
|
19
|
+
</div>
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
export const Grid: ComponentStory<typeof LinkApp> = () => (
|
|
23
|
+
<div className="bg-marble rounded-lg p-2 m-2 w-[150px]">
|
|
24
|
+
<LinkApp layout="GRID" editing={false} title="Test Grid" />
|
|
25
|
+
</div>
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
export const Carousel: ComponentStory<typeof LinkApp> = () => (
|
|
29
|
+
<div className="bg-marble rounded-lg p-2 m-2 w-[225px]">
|
|
30
|
+
<LinkApp layout="CAROUSEL" editing={false} title="Test Carousel" />
|
|
31
|
+
</div>
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
export const Featured: ComponentStory<typeof LinkApp> = () => (
|
|
35
|
+
<div className="bg-marble rounded-lg p-2 m-2 w-[384px]">
|
|
36
|
+
<LinkApp layout="FEATURED" editing={false} title="Test Featured" />
|
|
37
|
+
</div>
|
|
38
|
+
)
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
declare module '
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
declare module '*.svg'
|
|
1
|
+
// @HACK: This file is removed at build time, but we need it for type checking
|
|
2
|
+
declare module '*manifest.json' {
|
|
3
|
+
export const name: string
|
|
4
|
+
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# @linktr.ee/create-link-app
|
|
2
|
-
|
|
3
|
-
## 0.3.0-next.0
|
|
4
|
-
|
|
5
|
-
### Minor Changes
|
|
6
|
-
|
|
7
|
-
- Adds support for Federated Module entry point for Link Apps
|
|
8
|
-
|
|
9
|
-
## 0.2.0
|
|
10
|
-
|
|
11
|
-
### Minor Changes
|
|
12
|
-
|
|
13
|
-
- f3cb1ab: Update application config URL and format
|
|
14
|
-
|
|
15
|
-
### Patch Changes
|
|
16
|
-
|
|
17
|
-
- 6dd47b2: Update main app & legacy app code scaffolding
|
|
18
|
-
- 41123c7: Set manifest `name` field during project creation
|
|
19
|
-
- 8811cd7: Fix issue where webpack wasn't bundling images correctly
|
|
20
|
-
|
|
21
|
-
## 0.1.0
|
|
22
|
-
|
|
23
|
-
### Minor Changes
|
|
24
|
-
|
|
25
|
-
- Initial release
|
|
Binary file
|
|
Binary file
|