@linktr.ee/create-link-app 1.7.16 → 1.8.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.
@@ -13,6 +13,7 @@ class TestUrlMatchRules extends base_1.default {
13
13
  async run() {
14
14
  const { args, flags } = await this.parse(TestUrlMatchRules);
15
15
  const appConfig = await this.getAppConfig(flags.qa ? 'qa' : 'production');
16
+ const linkTypeServiceUrl = `${flags.endpoint ?? appConfig.link_types_url}/link-types`;
16
17
  const accessToken = (0, access_token_1.getAccessToken)(appConfig.auth.audience);
17
18
  const url = args.url;
18
19
  if (!url) {
@@ -35,8 +36,10 @@ class TestUrlMatchRules extends base_1.default {
35
36
  this.error('❌ url_match_rules.json is invalid');
36
37
  }
37
38
  try {
38
- const result = await (0, test_url_match_rules_1.default)(url, urlMatchRules, accessToken);
39
- this.log(result);
39
+ const result = await (0, test_url_match_rules_1.default)(linkTypeServiceUrl, url, urlMatchRules, accessToken);
40
+ const success = result.success;
41
+ this.log(`${success ? '🎉' : '❌'} Test URL Match Rules Result:`);
42
+ this.log(JSON.stringify(result, null, 2));
40
43
  }
41
44
  catch (error) {
42
45
  this.error(`❌ Something went wrong:\n${error.message ?? 'Unknown error'}`, { exit: 1 });
@@ -58,5 +61,9 @@ TestUrlMatchRules.flags = {
58
61
  description: 'Use QA environment. Admin use only.',
59
62
  hidden: true,
60
63
  }),
64
+ endpoint: core_1.Flags.string({
65
+ description: 'Custom API endpoint to push assets to. Admin use only.',
66
+ hidden: true,
67
+ }),
61
68
  };
62
69
  const resolveProjPath = (givenPath, relativePath) => path_1.default.resolve(givenPath ?? process.cwd(), relativePath);
@@ -4,17 +4,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const axios_1 = __importDefault(require("axios"));
7
- async function testUrlMatchRules(url, urlMatchRules, accessToken) {
7
+ async function testUrlMatchRules(endpoint, url, rules, accessToken) {
8
8
  try {
9
- const linkAppCreateUrl = `${url}/test-url-match-rules`;
10
- const response = await axios_1.default.post(linkAppCreateUrl, {
9
+ const response = await axios_1.default.post(`${endpoint}/test-url-match-rules`, {
10
+ url,
11
+ rules,
12
+ }, {
11
13
  headers: {
12
14
  Authorization: `Bearer ${accessToken}`,
13
15
  },
14
- data: {
15
- url,
16
- rules: urlMatchRules,
17
- },
18
16
  });
19
17
  return response.data;
20
18
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.7.16",
2
+ "version": "1.8.0",
3
3
  "commands": {
4
4
  "build": {
5
5
  "id": "build",
@@ -309,6 +309,13 @@
309
309
  "description": "Use QA environment. Admin use only.",
310
310
  "hidden": true,
311
311
  "allowNo": false
312
+ },
313
+ "endpoint": {
314
+ "name": "endpoint",
315
+ "type": "option",
316
+ "description": "Custom API endpoint to push assets to. Admin use only.",
317
+ "hidden": true,
318
+ "multiple": false
312
319
  }
313
320
  },
314
321
  "args": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@linktr.ee/create-link-app",
3
- "version": "1.7.16",
3
+ "version": "1.8.0",
4
4
  "description": "Create a Link App on Linktr.ee.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "Linktree",
@@ -0,0 +1,6 @@
1
+ module.exports = {
2
+ plugins: {
3
+ tailwindcss: {},
4
+ autoprefixer: {},
5
+ }
6
+ }
@@ -5,7 +5,7 @@ import './tailwind.css'
5
5
  function App(props: AppProps) {
6
6
  return (
7
7
  <div className="px-6 pt-12 pb-11 h-full">
8
- <h1>My first link app!</h1>
8
+ <h1 className="text-2xl font-bold">My first link app!</h1>
9
9
  <p>Congratulations, you now have a Linktree link!</p>
10
10
  <button className="bg-black text-white py-2 px-4 rounded-full my-2" onClick={() => window.open(props.url, '_blank')}>
11
11
  Visit your URL
@@ -1,4 +1,4 @@
1
1
  /* tailwind.css */
2
-
2
+ @tailwind base;
3
3
  @tailwind components;
4
4
  @tailwind utilities;
@@ -0,0 +1,8 @@
1
+ /** @type {import('tailwindcss').Config} */
2
+ module.exports = {
3
+ content: ["./src/**/*.{js,jsx,ts,tsx}"],
4
+ theme: {
5
+ extend: {},
6
+ },
7
+ plugins: [],
8
+ };